Merge pull request #2977 from hansva/master
Sonar cleanup
diff --git a/core/src/main/java/org/apache/hop/core/plugins/HopURLClassLoader.java b/core/src/main/java/org/apache/hop/core/plugins/HopURLClassLoader.java
index b987fca..d1df3e3 100644
--- a/core/src/main/java/org/apache/hop/core/plugins/HopURLClassLoader.java
+++ b/core/src/main/java/org/apache/hop/core/plugins/HopURLClassLoader.java
@@ -49,6 +49,7 @@
this.name = name;
}
+ @Override
public String getName() {
return name;
}
diff --git a/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSampler.java b/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSampler.java
index 6f00af6..041fa8b 100644
--- a/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSampler.java
+++ b/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSampler.java
@@ -37,7 +37,6 @@
public class RandomRowsExecutionDataSampler
extends ExecutionDataSamplerBase<RandomRowsExecutionDataSamplerStore>
implements IExecutionDataSampler<RandomRowsExecutionDataSamplerStore> {
- private static final Class<?> PKG = RandomRowsExecutionDataSampler.class; // For Translator
public RandomRowsExecutionDataSampler() {
super();
diff --git a/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSamplerStore.java b/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSamplerStore.java
index d7b0ad2..8224266 100644
--- a/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSamplerStore.java
+++ b/engine/src/main/java/org/apache/hop/execution/sampler/plugins/random/RandomRowsExecutionDataSamplerStore.java
@@ -114,6 +114,7 @@
*
* @return value of samplerMeta
*/
+ @Override
public ExecutionDataSamplerMeta getSamplerMeta() {
return samplerMeta;
}
diff --git a/engine/src/main/java/org/apache/hop/partition/PartitionSchema.java b/engine/src/main/java/org/apache/hop/partition/PartitionSchema.java
index af00c23..0258f89 100644
--- a/engine/src/main/java/org/apache/hop/partition/PartitionSchema.java
+++ b/engine/src/main/java/org/apache/hop/partition/PartitionSchema.java
@@ -80,6 +80,7 @@
return name;
}
+ @Override
public boolean equals(Object obj) {
if (obj == null || name == null) {
return false;
@@ -87,6 +88,7 @@
return name.equals(((PartitionSchema) obj).name);
}
+ @Override
public int hashCode() {
return name.hashCode();
}
diff --git a/engine/src/main/java/org/apache/hop/pipeline/transform/DynamicWaitTimes.java b/engine/src/main/java/org/apache/hop/pipeline/transform/DynamicWaitTimes.java
index 687f8a8..672a801 100644
--- a/engine/src/main/java/org/apache/hop/pipeline/transform/DynamicWaitTimes.java
+++ b/engine/src/main/java/org/apache/hop/pipeline/transform/DynamicWaitTimes.java
@@ -152,6 +152,7 @@
return statusList.stream().noneMatch(SingleStreamStatus::allowAdjust);
}
+ @Override
protected void doReset(int index) {
statusList.get(index).reset();
}
diff --git a/engine/src/main/java/org/apache/hop/server/HopServer.java b/engine/src/main/java/org/apache/hop/server/HopServer.java
index 4887c0d..eeef474 100644
--- a/engine/src/main/java/org/apache/hop/server/HopServer.java
+++ b/engine/src/main/java/org/apache/hop/server/HopServer.java
@@ -330,6 +330,7 @@
return "Hop Server";
}
+ @Override
public boolean equals(Object obj) {
if (!(obj instanceof HopServer)) {
return false;
@@ -338,6 +339,7 @@
return name.equalsIgnoreCase(server.getName());
}
+ @Override
public int hashCode() {
return name.toLowerCase().hashCode();
}
diff --git a/engine/src/main/java/org/apache/hop/www/HopServer.java b/engine/src/main/java/org/apache/hop/www/HopServer.java
index fe0ba00..d444c13 100644
--- a/engine/src/main/java/org/apache/hop/www/HopServer.java
+++ b/engine/src/main/java/org/apache/hop/www/HopServer.java
@@ -67,17 +67,6 @@
import picocli.CommandLine;
import picocli.CommandLine.Parameters;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.WebTarget;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Stream;
-
public class HopServer implements Runnable, IHasHopMetadataProvider {
private static final Class<?> PKG = HopServer.class; // For Translator
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java
index d6b3e3b..f700ed1 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java
@@ -944,7 +944,9 @@
wIfFileExists.addSelectionListener(
new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {}
+ public void widgetSelected(SelectionEvent e) {
+ //Ignore widget selected event
+ }
});
// Add filenames to result filenames...
@@ -1334,6 +1336,7 @@
wlAddTime.setEnabled(!wSpecifyFormat.getSelection());
}
+ @Override
public void dispose() {
closeFtpConnection();
super.dispose();
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java
index 786ba75..30ef83e 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java
@@ -17,6 +17,7 @@
package org.apache.hop.workflow.actions.ftpdelete;
+import java.net.InetAddress;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
@@ -56,8 +57,6 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import java.net.InetAddress;
-
/** This dialog allows you to edit the FTP Delete action settings. */
public class ActionFtpDeleteDialog extends ActionDialog implements IActionDialog {
private static final Class<?> PKG = ActionFtpDelete.class; // For Translator
@@ -151,8 +150,6 @@
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);
- WorkflowMeta workflowMeta = getWorkflowMeta();
-
ModifyListener lsMod =
e -> {
pwdFolder = null;
@@ -1053,7 +1050,6 @@
boolean success = false;
String realServername = null;
try {
- WorkflowMeta workflowMeta = getWorkflowMeta();
if (ftpclient == null || !ftpclient.isConnected()) {
// Create ftp client to host:port ...
@@ -1092,8 +1088,6 @@
boolean retval = false;
try {
- WorkflowMeta workflowMeta = getWorkflowMeta();
-
if (sftpclient == null) {
// Create sftp client to host ...
sftpclient =
@@ -1133,6 +1127,7 @@
wNrErrorsLessThan.setEnabled(wSuccessCondition.getSelectionIndex() != 0);
}
+ @Override
public void dispose() {
closeFtpConnections();
super.dispose();
@@ -1215,7 +1210,6 @@
actionFtpDelete.setRemoteDirectory(wFtpDirectory.getText());
actionFtpDelete.setWildcard(wWildcard.getText());
actionFtpDelete.setTimeout(Const.toInt(wTimeout.getText(), 10000));
-
actionFtpDelete.setUseProxy(wUseProxy.getSelection());
actionFtpDelete.setProxyHost(wProxyHost.getText());
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java
index caf004c..25b9c45 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java
@@ -128,8 +128,6 @@
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);
- WorkflowMeta workflowMeta = getWorkflowMeta();
-
ModifyListener lsMod =
e -> {
ftpclient = null;
@@ -868,7 +866,6 @@
boolean retval = false;
String realServername = null;
try {
- WorkflowMeta workflowMeta = getWorkflowMeta();
ActionFtpPut actionFtpPut = new ActionFtpPut();
getInfo(actionFtpPut);
@@ -916,6 +913,7 @@
return retval;
}
+ @Override
public void dispose() {
closeFtpConnection();
super.dispose();
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java
index 3e255b2..884fb13 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java
@@ -17,6 +17,7 @@
package org.apache.hop.workflow.actions.sftp;
+import java.net.InetAddress;
import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
import org.apache.hop.core.util.Utils;
@@ -52,8 +53,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import java.net.InetAddress;
-
/** This dialog allows you to edit the SFTP action settings. */
public class ActionSftpDialog extends ActionDialog implements IActionDialog {
private static final Class<?> PKG = ActionSftp.class; // For Translator
@@ -810,7 +809,6 @@
private boolean connectToSftp(boolean checkFolder, String remotefoldername) {
boolean retval = false;
try {
- WorkflowMeta workflowMeta = getWorkflowMeta();
if (sftpclient == null) {
// Create sftp client to host ...
@@ -875,6 +873,7 @@
}
}
+ @Override
public void dispose() {
closeFtpConnections();
super.dispose();
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java
index b79be8a..8d2b7de 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java
@@ -17,6 +17,7 @@
package org.apache.hop.workflow.actions.sftpput;
+import java.net.InetAddress;
import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
import org.apache.hop.core.util.Utils;
@@ -53,8 +54,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import java.net.InetAddress;
-
/** This dialog allows you to edit the FTP Put action settings. */
public class ActionSftpPutDialog extends ActionDialog implements IActionDialog {
private static final Class<?> PKG = ActionSftpPut.class; // For Translator
@@ -978,7 +977,6 @@
private boolean connectToSftp(boolean checkFolder, String remotefoldername) {
boolean retval = false;
try {
- WorkflowMeta workflowMeta = getWorkflowMeta();
if (sftpclient == null) {
// Create sftp client to host ...
@@ -1044,6 +1042,7 @@
}
}
+ @Override
public void dispose() {
// Close open connections
closeFtpConnections();
diff --git a/plugins/actions/getpop/src/main/java/org/apache/hop/workflow/actions/getpop/ActionGetPOPDialog.java b/plugins/actions/getpop/src/main/java/org/apache/hop/workflow/actions/getpop/ActionGetPOPDialog.java
index 6fe2de3..69b8a08 100644
--- a/plugins/actions/getpop/src/main/java/org/apache/hop/workflow/actions/getpop/ActionGetPOPDialog.java
+++ b/plugins/actions/getpop/src/main/java/org/apache/hop/workflow/actions/getpop/ActionGetPOPDialog.java
@@ -19,6 +19,8 @@
package org.apache.hop.workflow.actions.getpop;
import jakarta.mail.Folder;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
import org.apache.commons.lang.StringUtils;
import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
@@ -59,9 +61,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
/** This dialog allows you to edit the Get POP action settings. */
public class ActionGetPOPDialog extends ActionDialog implements IActionDialog {
private static final Class<?> PKG = ActionGetPOP.class; // For Translator
@@ -362,29 +361,31 @@
});
// USE connection with XOAUTH2
- Label wlUseXOAUTH2 = new Label( wServerSettings, SWT.RIGHT );
- wlUseXOAUTH2.setText( BaseMessages.getString( PKG, "ActionGetPOP.UseXOAUTH2Mails.Label" ) );
- PropsUi.setLook( wlUseXOAUTH2 );
+ Label wlUseXOAUTH2 = new Label(wServerSettings, SWT.RIGHT);
+ wlUseXOAUTH2.setText(BaseMessages.getString(PKG, "ActionGetPOP.UseXOAUTH2Mails.Label"));
+ PropsUi.setLook(wlUseXOAUTH2);
FormData fdlUseXOAUTH2 = new FormData();
- fdlUseXOAUTH2.left = new FormAttachment( 0, 0 );
- fdlUseXOAUTH2.top = new FormAttachment( wUseSSL, margin );
- fdlUseXOAUTH2.right = new FormAttachment( middle, -margin );
- wlUseXOAUTH2.setLayoutData( fdlUseXOAUTH2 );
- wUseXOAUTH2 = new Button( wServerSettings, SWT.CHECK );
- PropsUi.setLook( wUseXOAUTH2 );
+ fdlUseXOAUTH2.left = new FormAttachment(0, 0);
+ fdlUseXOAUTH2.top = new FormAttachment(wUseSSL, margin);
+ fdlUseXOAUTH2.right = new FormAttachment(middle, -margin);
+ wlUseXOAUTH2.setLayoutData(fdlUseXOAUTH2);
+ wUseXOAUTH2 = new Button(wServerSettings, SWT.CHECK);
+ PropsUi.setLook(wUseXOAUTH2);
FormData fdUseXOAUTH2 = new FormData();
- wUseXOAUTH2.setToolTipText( BaseMessages.getString( PKG, "ActionGetPOP.UseXOAUTH2Mails.Tooltip" ) );
- fdUseXOAUTH2.left = new FormAttachment( middle, 0 );
- fdUseXOAUTH2.top = new FormAttachment( wUseSSL, margin );
- fdUseXOAUTH2.right = new FormAttachment( 100, 0 );
- wUseXOAUTH2.setLayoutData( fdUseXOAUTH2 );
+ wUseXOAUTH2.setToolTipText(BaseMessages.getString(PKG, "ActionGetPOP.UseXOAUTH2Mails.Tooltip"));
+ fdUseXOAUTH2.left = new FormAttachment(middle, 0);
+ fdUseXOAUTH2.top = new FormAttachment(wUseSSL, margin);
+ fdUseXOAUTH2.right = new FormAttachment(100, 0);
+ wUseXOAUTH2.setLayoutData(fdUseXOAUTH2);
- wUseXOAUTH2.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- closeMailConnection();
- refreshPort( true );
- }
- } );
+ wUseXOAUTH2.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ closeMailConnection();
+ refreshPort(true);
+ }
+ });
// port
Label wlPort = new Label(wServerSettings, SWT.RIGHT);
@@ -1412,7 +1413,7 @@
dialog.setLayout(new GridLayout(3, false));
final DateTime calendar = new DateTime(dialog, SWT.CALENDAR);
- final DateTime time = new DateTime(dialog, SWT.TIME | SWT.TIME);
+ final DateTime time = new DateTime(dialog, SWT.TIME);
new Label(dialog, SWT.NONE);
new Label(dialog, SWT.NONE);
@@ -1479,7 +1480,7 @@
dialogto.setLayout(new GridLayout(3, false));
final DateTime calendarto = new DateTime(dialogto, SWT.CALENDAR | SWT.BORDER);
- final DateTime timeto = new DateTime(dialogto, SWT.TIME | SWT.TIME);
+ final DateTime timeto = new DateTime(dialogto, SWT.TIME);
new Label(dialogto, SWT.NONE);
new Label(dialogto, SWT.NONE);
Button okto = new Button(dialogto, SWT.PUSH);
@@ -1687,8 +1688,8 @@
private void conditionReceivedDate() {
boolean activeReceivedDate =
- !(MailConnectionMeta.getConditionDateByDesc(wConditionOnReceivedDate.getText())
- == MailConnectionMeta.CONDITION_DATE_IGNORE);
+ (MailConnectionMeta.getConditionDateByDesc(wConditionOnReceivedDate.getText())
+ != MailConnectionMeta.CONDITION_DATE_IGNORE);
boolean useBetween =
(MailConnectionMeta.getConditionDateByDesc(wConditionOnReceivedDate.getText())
== MailConnectionMeta.CONDITION_DATE_BETWEEN);
@@ -1867,6 +1868,7 @@
wFirstmails.setEnabled(ok);
}
+ @Override
public void dispose() {
closeMailConnection();
super.dispose();
diff --git a/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java b/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java
index c59ad3d..d9fa294 100644
--- a/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java
+++ b/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java
@@ -1002,6 +1002,7 @@
wAlterGroup.setVisible(wAction.getSelectionIndex() == WarehouseManager.MANAGEMENT_ACTION_ALTER);
}
+ @Override
public void dispose() {
WindowProperty winprop = new WindowProperty(shell);
props.setScreen(winprop);
diff --git a/plugins/engines/beam/src/main/java/org/apache/hop/beam/core/transform/TransformBatchTransform.java b/plugins/engines/beam/src/main/java/org/apache/hop/beam/core/transform/TransformBatchTransform.java
index 46f711f..b6ac113 100644
--- a/plugins/engines/beam/src/main/java/org/apache/hop/beam/core/transform/TransformBatchTransform.java
+++ b/plugins/engines/beam/src/main/java/org/apache/hop/beam/core/transform/TransformBatchTransform.java
@@ -337,6 +337,7 @@
}
}
+ @Override
protected void sendSamplesToLocation(boolean finished) throws HopException {
ExecutionDataBuilder dataBuilder =
ExecutionDataBuilder.of()
diff --git a/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncStatusServlet.java b/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncStatusServlet.java
index da03c05..a32f48f 100644
--- a/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncStatusServlet.java
+++ b/plugins/misc/async/src/main/java/org/apache/hop/www/async/AsyncStatusServlet.java
@@ -18,6 +18,13 @@
package org.apache.hop.www.async;
import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.hop.core.Const;
import org.apache.hop.core.annotations.HopServerServlet;
@@ -38,14 +45,6 @@
import org.apache.hop.www.PipelineMap;
import org.apache.hop.www.WebServiceServlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-
@HopServerServlet(
id = "asyncStatus",
name = "Get the status of an asynchronously executing workflow")
@@ -63,6 +62,7 @@
super(pipelineMap);
}
+ @Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
diff --git a/plugins/tech/azure/src/main/java/org/apache/hop/pipeline/transforms/eventhubs/write/AzureWriterMeta.java b/plugins/tech/azure/src/main/java/org/apache/hop/pipeline/transforms/eventhubs/write/AzureWriterMeta.java
index ef0a23a..a328bed 100644
--- a/plugins/tech/azure/src/main/java/org/apache/hop/pipeline/transforms/eventhubs/write/AzureWriterMeta.java
+++ b/plugins/tech/azure/src/main/java/org/apache/hop/pipeline/transforms/eventhubs/write/AzureWriterMeta.java
@@ -67,6 +67,7 @@
this.messageField = m.messageField;
}
+ @Override
public AzureWriterMeta clone() {
return new AzureWriterMeta(this);
}
diff --git a/plugins/tech/cassandra/src/main/java/org/apache/hop/workflow/actions/execcql/ExecCqlDialog.java b/plugins/tech/cassandra/src/main/java/org/apache/hop/workflow/actions/execcql/ExecCqlDialog.java
index d265d75..d198a24 100644
--- a/plugins/tech/cassandra/src/main/java/org/apache/hop/workflow/actions/execcql/ExecCqlDialog.java
+++ b/plugins/tech/cassandra/src/main/java/org/apache/hop/workflow/actions/execcql/ExecCqlDialog.java
@@ -215,6 +215,7 @@
dispose();
}
+ @Override
public void dispose() {
props.setScreen(new WindowProperty(shell));
shell.dispose();
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/actions/cypherscript/CypherScript.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/actions/cypherscript/CypherScript.java
index a864795..81f361b 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/actions/cypherscript/CypherScript.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/actions/cypherscript/CypherScript.java
@@ -67,6 +67,7 @@
this.replacingVariables = s.replacingVariables;
}
+ @Override
public CypherScript clone() {
return new CypherScript(this);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerCypherTab.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerCypherTab.java
index 3d0f705..6c2386f 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerCypherTab.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerCypherTab.java
@@ -18,23 +18,13 @@
package org.apache.hop.neo4j.execution.path.pipeline;
-import org.apache.hop.core.Const;
import org.apache.hop.core.gui.plugin.GuiPlugin;
import org.apache.hop.core.gui.plugin.tab.GuiTab;
import org.apache.hop.execution.ExecutionInfoLocation;
-import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.neo4j.execution.NeoExecutionInfoLocation;
import org.apache.hop.neo4j.execution.path.base.NeoExecutionViewerCypherTab;
-import org.apache.hop.neo4j.execution.path.base.NeoExecutionViewerLineageTab;
-import org.apache.hop.neo4j.execution.path.base.NeoExecutionViewerTabBase;
-import org.apache.hop.ui.core.PropsUi;
-import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.hopgui.perspective.execution.PipelineExecutionViewer;
-import org.apache.hop.ui.hopgui.shared.BaseExecutionViewer;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Text;
@GuiPlugin
@@ -47,9 +37,10 @@
}
@GuiTab(
- id = "90010-pipeline-execution-viewer-neo4j-cypher-tab",
- parentId = PipelineExecutionViewer.PIPELINE_EXECUTION_VIEWER_TABS,
- description = "Neo4j Cypher")
+ id = "90010-pipeline-execution-viewer-neo4j-cypher-tab",
+ parentId = PipelineExecutionViewer.PIPELINE_EXECUTION_VIEWER_TABS,
+ description = "Neo4j Cypher")
+ @Override
public void addNeo4jCypherTab(CTabFolder tabFolder) {
super.addNeo4jCypherTab(tabFolder);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerLineageTab.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerLineageTab.java
index a093a79..028f7e6 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerLineageTab.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/pipeline/NeoPipelineExecutionViewerLineageTab.java
@@ -18,40 +18,16 @@
package org.apache.hop.neo4j.execution.path.pipeline;
-import org.apache.hop.core.Const;
import org.apache.hop.core.gui.plugin.GuiPlugin;
import org.apache.hop.core.gui.plugin.tab.GuiTab;
import org.apache.hop.execution.ExecutionInfoLocation;
-import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.neo4j.execution.NeoExecutionInfoLocation;
import org.apache.hop.neo4j.execution.path.base.NeoExecutionViewerLineageTab;
-import org.apache.hop.neo4j.execution.path.base.NeoExecutionViewerTabBase;
-import org.apache.hop.neo4j.execution.path.PathResult;
-import org.apache.hop.neo4j.logging.util.LoggingCore;
-import org.apache.hop.ui.core.PropsUi;
-import org.apache.hop.ui.core.gui.GuiResource;
-import org.apache.hop.ui.core.widget.TreeMemory;
import org.apache.hop.ui.hopgui.perspective.execution.PipelineExecutionViewer;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.neo4j.driver.Record;
-import org.neo4j.driver.Result;
-import org.neo4j.driver.Session;
-import org.neo4j.driver.Value;
-import org.neo4j.driver.types.Node;
-import org.neo4j.driver.types.Path;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
@GuiPlugin
public class NeoPipelineExecutionViewerLineageTab extends NeoExecutionViewerLineageTab {
@@ -68,8 +44,9 @@
id = "90000-pipeline-execution-viewer-neo4j-execution-lineage-tab",
parentId = PipelineExecutionViewer.PIPELINE_EXECUTION_VIEWER_TABS,
description = "Execution lineage")
+ @Override
public void addNeoExecutionPathTab(CTabFolder tabFolder) {
- super.addNeoExecutionPathTab(tabFolder);
+ super.addNeoExecutionPathTab(tabFolder);
}
/**
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerCypherTab.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerCypherTab.java
index 43da622..96eab3f 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerCypherTab.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerCypherTab.java
@@ -40,6 +40,7 @@
id = "90010-workflow-execution-viewer-neo4j-cypher-tab",
parentId = WorkflowExecutionViewer.WORKFLOW_EXECUTION_VIEWER_TABS,
description = "Neo4j Cypher")
+ @Override
public void addNeo4jCypherTab(CTabFolder tabFolder) {
super.addNeo4jCypherTab(tabFolder);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerLineageTab.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerLineageTab.java
index 61a475b..a1ebcb2 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerLineageTab.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/execution/path/workflow/NeoWorkflowExecutionViewerLineageTab.java
@@ -23,7 +23,6 @@
import org.apache.hop.execution.ExecutionInfoLocation;
import org.apache.hop.neo4j.execution.NeoExecutionInfoLocation;
import org.apache.hop.neo4j.execution.path.base.NeoExecutionViewerLineageTab;
-import org.apache.hop.ui.hopgui.perspective.execution.PipelineExecutionViewer;
import org.apache.hop.ui.hopgui.perspective.execution.WorkflowExecutionViewer;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.graphics.Color;
@@ -45,8 +44,9 @@
id = "90000-workflow-execution-viewer-neo4j-execution-lineage-tab",
parentId = WorkflowExecutionViewer.WORKFLOW_EXECUTION_VIEWER_TABS,
description = "Execution lineage")
+ @Override
public void addNeoExecutionPathTab(CTabFolder tabFolder) {
- super.addNeoExecutionPathTab(tabFolder);
+ super.addNeoExecutionPathTab(tabFolder);
}
/**
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/CreateOperation.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/CreateOperation.java
index 0402844..edeac36 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/CreateOperation.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/CreateOperation.java
@@ -32,6 +32,7 @@
super(o);
}
+ @Override
public CreateOperation clone() {
return new CreateOperation(this);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/EdgeMatchOperation.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/EdgeMatchOperation.java
index f2c20cf..75c575e 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/EdgeMatchOperation.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/EdgeMatchOperation.java
@@ -59,6 +59,7 @@
this.targetAlias = o.targetAlias;
}
+ @Override
public EdgeMatchOperation clone() {
return new EdgeMatchOperation(this);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MatchOperation.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MatchOperation.java
index 5b9ddef..2509384 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MatchOperation.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MatchOperation.java
@@ -32,6 +32,7 @@
super(o);
}
+ @Override
public MatchOperation clone() {
return new MatchOperation(this);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MergeOperation.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MergeOperation.java
index 85fe4d1..0c357af 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MergeOperation.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/MergeOperation.java
@@ -33,6 +33,7 @@
super(o);
}
+ @Override
public MergeOperation clone() {
return new MergeOperation(this);
}
diff --git a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/SetOperation.java b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/SetOperation.java
index 4b8df2d..43035c6 100644
--- a/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/SetOperation.java
+++ b/plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/transforms/cypherbuilder/operation/SetOperation.java
@@ -33,6 +33,7 @@
super(o);
}
+ @Override
public SetOperation clone() {
return new SetOperation(this);
}
diff --git a/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesAccumulator.java b/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesAccumulator.java
index 9014d43..4b8e119 100644
--- a/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesAccumulator.java
+++ b/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesAccumulator.java
@@ -27,7 +27,7 @@
import org.apache.hop.pipeline.transform.TransformMeta;
public class RulesAccumulator extends BaseTransform<RulesAccumulatorMeta, RulesAccumulatorData> {
- private static Class<?> PKG = Rules.class; // for i18n purposes
+ private static final Class<?> PKG = Rules.class; // for i18n purposes
public RulesAccumulator(
TransformMeta transformMeta,
@@ -39,6 +39,7 @@
super(transformMeta, meta, data, copyNr, pipelineMeta, pipeline);
}
+ @Override
public boolean init() {
if ( super.init() ) {
@@ -74,10 +75,7 @@
}
}
- public void dispose( ) {
- super.dispose();
- }
-
+ @Override
public boolean processRow() throws HopException {
try {
Object[] r = getRow(); // get row, set busy!
diff --git a/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesExecutor.java b/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesExecutor.java
index e8ff29a..c42dcbf 100644
--- a/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesExecutor.java
+++ b/plugins/transforms/drools/src/main/java/org/apache/hop/pipeline/transforms/drools/RulesExecutor.java
@@ -28,7 +28,7 @@
import java.util.Arrays;
public class RulesExecutor extends BaseTransform<RulesExecutorMeta, RulesExecutorData> {
- private static Class<?> PKG = Rules.class; // for i18n purposes
+ private static final Class<?> PKG = Rules.class; // for i18n purposes
public RulesExecutor(
TransformMeta transformMeta,
@@ -40,6 +40,7 @@
super(transformMeta, meta, data, copyNr, pipelineMeta, pipeline);
}
+ @Override
public boolean init() {
if (super.init()) {
@@ -70,10 +71,7 @@
return true;
}
- public void dispose() {
- super.dispose();
- }
-
+ @Override
public boolean processRow() throws HopException {
Object[] r = getRow(); // get row, set busy!
diff --git a/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadata.java b/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadata.java
index 1d9cef6..c757466 100644
--- a/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadata.java
+++ b/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadata.java
@@ -246,6 +246,7 @@
return outputRow;
}
+ @Override
public boolean processRow() throws HopException {
// get incoming row, getRow() potentially blocks waiting for more rows, returns null if no more
@@ -379,7 +380,6 @@
ResultSet resultSet = (ResultSet) data.method.invoke(databaseMetaData, data.arguments);
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
int columnCount = resultSetMetaData.getColumnCount();
- IValueMeta IValueMeta;
Object value;
boolean outputRows = false;
int k;
diff --git a/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadataMeta.java b/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadataMeta.java
index efabbfd..db9e42e 100644
--- a/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadataMeta.java
+++ b/plugins/transforms/jdbc-metadata/src/main/java/org/apache/pipeline/transform/jdbcmetadata/JdbcMetadataMeta.java
@@ -49,7 +49,7 @@
documentationUrl = "/pipeline/transforms/jdbcmetadata.html")
public class JdbcMetadataMeta extends BaseTransformMeta<JdbcMetadata, JdbcMetadataData> {
- public static Class<DatabaseMetaData> DatabaseMetaDataClass;
+ public static Class<DatabaseMetaData> databaseMetaDataClass;
private static final Map<Integer, String> OPTIONS_SCOPE = new HashMap<Integer, String>();
@@ -366,22 +366,15 @@
};
/**
- * The PKG member is used when looking up internationalized strings. The properties file with
- * localized keys is expected to reside in {the package of the class
- * specified}/messages/messages_{locale}.properties
- */
- private static Class<?> PKG = JdbcMetadataMeta.class; // for i18n purposes
-
- /**
* Constructor should call super() to make sure the base class has a chance to initialize
* properly.
*/
@SuppressWarnings("unchecked")
public JdbcMetadataMeta() {
super();
- if (JdbcMetadataMeta.DatabaseMetaDataClass == null) {
+ if (JdbcMetadataMeta.databaseMetaDataClass == null) {
try {
- JdbcMetadataMeta.DatabaseMetaDataClass =
+ JdbcMetadataMeta.databaseMetaDataClass =
(Class<DatabaseMetaData>) Class.forName("java.sql.DatabaseMetaData");
} catch (Exception exception) {
throw new IllegalArgumentException(exception);
@@ -389,6 +382,7 @@
}
}
+ @Override
public void setDefault() {
methodName = "getCatalogs";
argumentSourceFields = false;
@@ -591,11 +585,13 @@
*
* @return a deep copy of this
*/
+ @Override
public Object clone() {
Object retval = super.clone();
return retval;
}
+ @Override
public void getFields(
IRowMeta rowMeta,
String origin,
diff --git a/plugins/transforms/mailinput/src/main/java/org/apache/hop/pipeline/transforms/mailinput/MailInputDialog.java b/plugins/transforms/mailinput/src/main/java/org/apache/hop/pipeline/transforms/mailinput/MailInputDialog.java
index f4f7022..37752c5 100644
--- a/plugins/transforms/mailinput/src/main/java/org/apache/hop/pipeline/transforms/mailinput/MailInputDialog.java
+++ b/plugins/transforms/mailinput/src/main/java/org/apache/hop/pipeline/transforms/mailinput/MailInputDialog.java
@@ -344,6 +344,7 @@
wUseXOAUTH2.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
closeMailConnection();
refreshPort(true);
@@ -1399,8 +1400,8 @@
input.getBatchSize() == null
? String.valueOf(MailInputMeta.DEFAULT_BATCH_SIZE)
: input.getBatchSize().toString());
- wStartMessage.setText(input.getStart() == null ? "" : input.getStart().toString());
- wEndMessage.setText(input.getEnd() == null ? "" : input.getEnd().toString());
+ wStartMessage.setText(input.getStart() == null ? "" : input.getStart());
+ wEndMessage.setText(input.getEnd() == null ? "" : input.getEnd());
wIgnoreFieldErrors.setSelection(input.isStopOnError());
setBatchSettingsEnabled();
diff --git a/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoader.java b/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoader.java
index f11b201..27e5697 100644
--- a/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoader.java
+++ b/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoader.java
@@ -29,7 +29,15 @@
//
//
-
+import com.google.common.annotations.VisibleForTesting;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
import org.apache.commons.vfs2.FileObject;
import org.apache.hop.core.Const;
import org.apache.hop.core.database.DatabaseMeta;
@@ -47,21 +55,11 @@
import org.apache.hop.pipeline.engine.IPipelineEngine;
import org.apache.hop.pipeline.transform.BaseTransform;
import org.apache.hop.pipeline.transform.TransformMeta;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.List;
-import com.google.common.annotations.VisibleForTesting;
-/**
- * Performs a bulk load to an oracle table.
- */
-public class OraBulkLoader extends BaseTransform<OraBulkLoaderMeta, OraBulkLoaderData> {
- private static Class<?> PKG = OraBulkLoaderMeta.class; // for i18n purposes, needed by Translator2!!
+/** Performs a bulk load to an oracle table. */
+public class OraBulkLoader extends BaseTransform<OraBulkLoaderMeta, OraBulkLoaderData> {
+ private static final Class<?> PKG =
+ OraBulkLoaderMeta.class; // for i18n purposes, needed by Translator2!!
public static final int EX_SUCC = 0;
@@ -85,30 +83,29 @@
private InputStream input;
private String type;
- StreamLogger( InputStream is, String type ) {
+ StreamLogger(InputStream is, String type) {
this.input = is;
this.type = type + ">";
}
+
@Override
public void run() {
try {
- final BufferedReader br = new BufferedReader( new InputStreamReader( input ) );
+ final BufferedReader br = new BufferedReader(new InputStreamReader(input));
String line;
- while ( ( line = br.readLine() ) != null ) {
+ while ((line = br.readLine()) != null) {
// Only perform the concatenation if at basic level. Otherwise,
// this just reads from the stream.
- if ( log.isBasic() ) {
- logBasic( type + line );
+ if (log.isBasic()) {
+ logBasic(type + line);
}
}
- } catch ( IOException ioe ) {
+ } catch (IOException ioe) {
ioe.printStackTrace();
}
-
}
-
}
-
+
public OraBulkLoader(
TransformMeta transformMeta,
OraBulkLoaderMeta meta,
@@ -119,41 +116,41 @@
super(transformMeta, meta, data, copyNr, pipelineMeta, pipeline);
}
- private String substituteRecordTerminator( String terminator ) {
+ private String substituteRecordTerminator(String terminator) {
final StringBuilder in = new StringBuilder();
int length;
boolean escaped = false;
- terminator = resolve( terminator );
+ terminator = resolve(terminator);
length = terminator.length();
- for ( int i = 0; i < length; i++ ) {
- final char c = terminator.charAt( i );
+ for (int i = 0; i < length; i++) {
+ final char c = terminator.charAt(i);
- if ( escaped ) {
- switch ( c ) {
+ if (escaped) {
+ switch (c) {
case 'n':
- in.append( '\n' );
+ in.append('\n');
break;
case 'r':
- in.append( '\r' );
+ in.append('\r');
break;
default:
- in.append( c );
+ in.append(c);
break;
}
escaped = false;
- } else if ( c == '\\' ) {
+ } else if (c == '\\') {
escaped = true;
} else {
- in.append( c );
+ in.append(c);
}
}
return in.toString();
}
- private String encodeRecordTerminator( String terminator, String encoding ) throws HopException {
- final String in = substituteRecordTerminator( terminator );
+ private String encodeRecordTerminator(String terminator, String encoding) throws HopException {
+ final String in = substituteRecordTerminator(terminator);
final StringBuilder out = new StringBuilder();
byte[] bytes;
@@ -161,21 +158,21 @@
// use terminator in hex representation due to character set
// terminator in hex representation must be in character set
// of data file
- if ( Utils.isEmpty( encoding ) ) {
+ if (Utils.isEmpty(encoding)) {
bytes = in.getBytes();
} else {
- bytes = in.getBytes( encoding );
+ bytes = in.getBytes(encoding);
}
- for ( byte aByte : bytes ) {
- final String hex = Integer.toHexString( aByte );
+ for (byte aByte : bytes) {
+ final String hex = Integer.toHexString(aByte);
- if ( hex.length() == 1 ) {
- out.append( '0' );
+ if (hex.length() == 1) {
+ out.append('0');
}
- out.append( hex );
+ out.append(hex);
}
- } catch ( UnsupportedEncodingException e ) {
- throw new HopException( "Unsupported character encoding: " + encoding, e );
+ } catch (UnsupportedEncodingException e) {
+ throw new HopException("Unsupported character encoding: " + encoding, e);
}
return out.toString();
@@ -184,88 +181,96 @@
/**
* Get the contents of the control file as specified in the meta object
*
- * @param meta
- * the meta object to model the control file after
- *
+ * @param meta the meta object to model the control file after
* @return a string containing the control file contents
*/
- public String getControlFileContents( OraBulkLoaderMeta meta, IRowMeta rowMeta, Object[] row ) throws HopException {
+ public String getControlFileContents(OraBulkLoaderMeta meta, IRowMeta rowMeta, Object[] row)
+ throws HopException {
DatabaseMeta dm = meta.getDatabaseMeta();
- String inputName = "'" + getFilename( getFileObject( meta.getDataFile(), variables ) ) + "'";
+ String inputName = "'" + getFilename(getFileObject(meta.getDataFile(), variables)) + "'";
String loadAction = meta.getLoadAction();
- StringBuilder contents = new StringBuilder( 500 );
- contents.append( "OPTIONS(" ).append( Const.CR );
- contents.append( " ERRORS=\'" ).append( meta.getMaxErrors() ).append( "\'" ).append( Const.CR );
+ StringBuilder contents = new StringBuilder(500);
+ contents.append("OPTIONS(").append(Const.CR);
+ contents.append(" ERRORS=\'").append(meta.getMaxErrors()).append("\'").append(Const.CR);
- if ( meta.getCommitSizeAsInt( this ) != 0 && !( meta.isDirectPath() && getTransformMeta().getCopies(variables) > 1 ) ) {
+ if (meta.getCommitSizeAsInt(this) != 0
+ && !(meta.isDirectPath() && getTransformMeta().getCopies(variables) > 1)) {
// For the second part of the above expressions: ROWS is not supported
// in parallel mode (by sqlldr).
- contents.append( " , ROWS=\'" ).append( meta.getCommitSize() ).append( "\'" ).append( Const.CR );
+ contents.append(" , ROWS=\'").append(meta.getCommitSize()).append("\'").append(Const.CR);
}
- if ( meta.getBindSizeAsInt( this ) != 0 ) {
- contents.append( " , BINDSIZE=\'" ).append( meta.getBindSize() ).append( "\'" ).append( Const.CR );
+ if (meta.getBindSizeAsInt(this) != 0) {
+ contents.append(" , BINDSIZE=\'").append(meta.getBindSize()).append("\'").append(Const.CR);
}
- if ( meta.getReadSizeAsInt( this ) != 0 ) {
- contents.append( " , READSIZE=\'" ).append( meta.getReadSize() ).append( "\'" ).append( Const.CR );
+ if (meta.getReadSizeAsInt(this) != 0) {
+ contents.append(" , READSIZE=\'").append(meta.getReadSize()).append("\'").append(Const.CR);
}
- contents.append( ")" ).append( Const.CR );
+ contents.append(")").append(Const.CR);
- contents.append( "LOAD DATA" ).append( Const.CR );
- if ( !Utils.isEmpty( meta.getCharacterSetName() ) ) {
- contents.append( "CHARACTERSET " ).append( meta.getCharacterSetName() ).append( Const.CR );
+ contents.append("LOAD DATA").append(Const.CR);
+ if (!Utils.isEmpty(meta.getCharacterSetName())) {
+ contents.append("CHARACTERSET ").append(meta.getCharacterSetName()).append(Const.CR);
}
- if ( !OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() )
- || !Utils.isEmpty( meta.getAltRecordTerm() ) ) {
+ if (!OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals(meta.getLoadMethod())
+ || !Utils.isEmpty(meta.getAltRecordTerm())) {
String infile = inputName;
- if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() ) ) {
+ if (OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals(meta.getLoadMethod())) {
infile = "''";
}
// For concurrent input, data command line argument must be specified
- contents.append( "INFILE " ).append( infile );
- if ( !Utils.isEmpty( meta.getAltRecordTerm() ) ) {
- contents.append( " \"STR x'" ).append(
- encodeRecordTerminator( meta.getAltRecordTerm(), meta.getEncoding() ) ).append( "'\"" );
+ contents.append("INFILE ").append(infile);
+ if (!Utils.isEmpty(meta.getAltRecordTerm())) {
+ contents
+ .append(" \"STR x'")
+ .append(encodeRecordTerminator(meta.getAltRecordTerm(), meta.getEncoding()))
+ .append("'\"");
}
- contents.append( Const.CR );
+ contents.append(Const.CR);
}
contents
- .append( "INTO TABLE " ).append(
- dm.getQuotedSchemaTableCombination(variables, meta.getSchemaName(), meta.getTableName() ))
- .append( Const.CR ).append( loadAction ).append( Const.CR ).append(
- "FIELDS TERMINATED BY ',' ENCLOSED BY '\"'" )
- .append( Const.CR ).append( "TRAILING NULLCOLS" )
- .append( Const.CR ).append( '(' );
+ .append("INTO TABLE ")
+ .append(
+ dm.getQuotedSchemaTableCombination(
+ variables, meta.getSchemaName(), meta.getTableName()))
+ .append(Const.CR)
+ .append(loadAction)
+ .append(Const.CR)
+ .append("FIELDS TERMINATED BY ',' ENCLOSED BY '\"'")
+ .append(Const.CR)
+ .append("TRAILING NULLCOLS")
+ .append(Const.CR)
+ .append('(');
List<OraBulkLoaderMappingMeta> mappings = meta.getMappings();
- if ( mappings == null || mappings.isEmpty() ) {
- throw new HopException( "No fields defined to load to database" );
+ if (mappings == null || mappings.isEmpty()) {
+ throw new HopException("No fields defined to load to database");
}
boolean firstMapping = true;
- for (OraBulkLoaderMappingMeta mapping: mappings) {
- if ( !firstMapping ) {
- contents.append( ", " ).append( Const.CR );
+ for (OraBulkLoaderMappingMeta mapping : mappings) {
+ if (!firstMapping) {
+ contents.append(", ").append(Const.CR);
}
firstMapping = false;
- contents.append( dm.quoteField( mapping.getFieldTable() ) );
+ contents.append(dm.quoteField(mapping.getFieldTable()));
- int pos = rowMeta.indexOfValue( mapping.getFieldStream() );
- if ( pos < 0 ) {
- throw new HopException( "Could not find field " + mapping.getFieldStream() + " in stream" );
+ int pos = rowMeta.indexOfValue(mapping.getFieldStream());
+ if (pos < 0) {
+ throw new HopException("Could not find field " + mapping.getFieldStream() + " in stream");
}
- IValueMeta v = rowMeta.getValueMeta( pos );
- switch ( v.getType() ) {
+ IValueMeta v = rowMeta.getValueMeta(pos);
+ switch (v.getType()) {
case IValueMeta.TYPE_STRING:
- if ( v.getLength() > 255 ) {
- contents.append( " CHAR(" ).append( v.getLength() ).append( ")" );
+ if (v.getLength() > 255) {
+ contents.append(" CHAR(").append(v.getLength()).append(")");
} else {
- contents.append( " CHAR" );
+ contents.append(" CHAR");
}
break;
case IValueMeta.TYPE_INTEGER:
@@ -273,26 +278,26 @@
case IValueMeta.TYPE_BIGNUMBER:
break;
case IValueMeta.TYPE_DATE:
- if ( OraBulkLoaderMeta.DATE_MASK_DATE.equals( mapping.getDateMask() ) ) {
- contents.append( " DATE 'yyyy-mm-dd'" );
- } else if ( OraBulkLoaderMeta.DATE_MASK_DATETIME.equals( mapping.getDateMask() ) ) {
- contents.append( " TIMESTAMP 'yyyy-mm-dd hh24:mi:ss.ff'" );
+ if (OraBulkLoaderMeta.DATE_MASK_DATE.equals(mapping.getDateMask())) {
+ contents.append(" DATE 'yyyy-mm-dd'");
+ } else if (OraBulkLoaderMeta.DATE_MASK_DATETIME.equals(mapping.getDateMask())) {
+ contents.append(" TIMESTAMP 'yyyy-mm-dd hh24:mi:ss.ff'");
} else {
// If not specified the default is date.
- contents.append( " DATE 'yyyy-mm-dd'" );
+ contents.append(" DATE 'yyyy-mm-dd'");
}
break;
case IValueMeta.TYPE_BINARY:
- contents.append( " ENCLOSED BY '<startlob>' AND '<endlob>'" );
+ contents.append(" ENCLOSED BY '<startlob>' AND '<endlob>'");
break;
case IValueMeta.TYPE_TIMESTAMP:
- contents.append( " TIMESTAMP 'yyyy-mm-dd hh24:mi:ss.ff'" );
+ contents.append(" TIMESTAMP 'yyyy-mm-dd hh24:mi:ss.ff'");
break;
default:
break;
}
}
- contents.append( ")" );
+ contents.append(")");
return contents.toString();
}
@@ -304,24 +309,25 @@
* @param meta transform meta
* @throws HopException
*/
- public void createControlFile( String filename, Object[] row, OraBulkLoaderMeta meta ) throws HopException {
+ public void createControlFile(String filename, Object[] row, OraBulkLoaderMeta meta)
+ throws HopException {
FileWriter fw = null;
try {
- File controlFile = new File( getFileObject( filename, variables ).getURL().getFile() );
+ File controlFile = new File(getFileObject(filename, variables).getURL().getFile());
// Need to ensure that the parent directory they set exists for the control file.
controlFile.getParentFile().mkdirs();
controlFile.createNewFile();
- fw = new FileWriter( controlFile );
- fw.write( getControlFileContents( meta, getInputRowMeta(), row ) );
- } catch ( IOException ex ) {
- throw new HopException( ex.getMessage(), ex );
+ fw = new FileWriter(controlFile);
+ fw.write(getControlFileContents(meta, getInputRowMeta(), row));
+ } catch (IOException ex) {
+ throw new HopException(ex.getMessage(), ex);
} finally {
try {
- if ( fw != null ) {
+ if (fw != null) {
fw.close();
}
- } catch ( Exception ex ) {
+ } catch (Exception ex) {
// Ignore errors
}
}
@@ -330,87 +336,77 @@
/**
* Create the command line for an sqlldr process depending on the meta information supplied.
*
- * @param meta
- * The meta data to create the command line from
- * @param password
- * Use the real password or not
- *
+ * @param meta The meta data to create the command line from
+ * @param password Use the real password or not
* @return The string to execute.
- *
- * @throws HopException
- * Upon any exception
+ * @throws HopException Upon any exception
*/
- public String createCommandLine( OraBulkLoaderMeta meta, boolean password ) throws HopException {
- StringBuilder sb = new StringBuilder( 300 );
+ public String createCommandLine(OraBulkLoaderMeta meta, boolean password) throws HopException {
+ StringBuilder sb = new StringBuilder(300);
- if ( meta.getSqlldr() != null ) {
+ if (meta.getSqlldr() != null) {
try {
- FileObject fileObject =
- getFileObject( meta.getSqlldr(), variables );
- String sqlldr = getFilename( fileObject );
- sb.append( sqlldr );
- } catch ( HopFileException ex ) {
- throw new HopException( "Error retrieving sqlldr string", ex );
+ FileObject fileObject = getFileObject(meta.getSqlldr(), variables);
+ String sqlldr = getFilename(fileObject);
+ sb.append(sqlldr);
+ } catch (HopFileException ex) {
+ throw new HopException("Error retrieving sqlldr string", ex);
}
} else {
- throw new HopException( "No sqlldr application specified" );
+ throw new HopException("No sqlldr application specified");
}
- if ( meta.getControlFile() != null ) {
+ if (meta.getControlFile() != null) {
try {
- FileObject fileObject =
- getFileObject( meta.getControlFile(), variables );
+ FileObject fileObject = getFileObject(meta.getControlFile(), variables);
- sb.append( " control=\'" );
- sb.append( getFilename( fileObject ) );
- sb.append( "\'" );
- } catch ( HopFileException ex ) {
- throw new HopException( "Error retrieving controlfile string", ex );
+ sb.append(" control=\'");
+ sb.append(getFilename(fileObject));
+ sb.append("\'");
+ } catch (HopFileException ex) {
+ throw new HopException("Error retrieving controlfile string", ex);
}
} else {
- throw new HopException( "No control file specified" );
+ throw new HopException("No control file specified");
}
- if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() ) ) {
- sb.append( " data=\'-\'" );
+ if (OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals(meta.getLoadMethod())) {
+ sb.append(" data=\'-\'");
}
- if ( meta.getLogFile() != null ) {
+ if (meta.getLogFile() != null) {
try {
- FileObject fileObject =
- getFileObject( meta.getLogFile(), variables );
+ FileObject fileObject = getFileObject(meta.getLogFile(), variables);
- sb.append( " log=\'" );
- sb.append( getFilename( fileObject ) );
- sb.append( "\'" );
- } catch ( HopFileException ex ) {
- throw new HopException( "Error retrieving logfile string", ex );
+ sb.append(" log=\'");
+ sb.append(getFilename(fileObject));
+ sb.append("\'");
+ } catch (HopFileException ex) {
+ throw new HopException("Error retrieving logfile string", ex);
}
}
- if ( meta.getBadFile() != null ) {
+ if (meta.getBadFile() != null) {
try {
- FileObject fileObject =
- getFileObject( meta.getBadFile(), variables );
+ FileObject fileObject = getFileObject(meta.getBadFile(), variables);
- sb.append( " bad=\'" );
- sb.append( getFilename( fileObject ) );
- sb.append( "\'" );
- } catch ( HopFileException ex ) {
- throw new HopException( "Error retrieving badfile string", ex );
+ sb.append(" bad=\'");
+ sb.append(getFilename(fileObject));
+ sb.append("\'");
+ } catch (HopFileException ex) {
+ throw new HopException("Error retrieving badfile string", ex);
}
}
- if ( meta.getDiscardFile() != null ) {
+ if (meta.getDiscardFile() != null) {
try {
- FileObject fileObject =
- getFileObject( meta.getDiscardFile(), variables );
+ FileObject fileObject = getFileObject(meta.getDiscardFile(), variables);
- sb.append( " discard=\'" );
- sb.append( getFilename( fileObject ) );
- sb.append( "\'" );
- } catch ( HopFileException ex ) {
- throw new HopException( "Error retrieving discardfile string", ex );
+ sb.append(" discard=\'");
+ sb.append(getFilename(fileObject));
+ sb.append("\'");
+ } catch (HopFileException ex) {
+ throw new HopException("Error retrieving discardfile string", ex);
}
}
@@ -458,119 +454,122 @@
return sb.toString();
}
- public void checkExitVal( int exitVal ) throws HopException {
- if ( exitVal == EX_SUCC ) {
+ public void checkExitVal(int exitVal) throws HopException {
+ if (exitVal == EX_SUCC) {
return;
}
- if ( meta.isFailOnWarning() && ( exitVal == EX_WARN ) ) {
- throw new HopException( "sqlldr returned warning" );
- } else if ( meta.isFailOnError() && ( exitVal != EX_WARN ) ) {
- throw new HopException( "sqlldr returned an error (exit code " + exitVal + ")" );
+ if (meta.isFailOnWarning() && (exitVal == EX_WARN)) {
+ throw new HopException("sqlldr returned warning");
+ } else if (meta.isFailOnError() && (exitVal != EX_WARN)) {
+ throw new HopException("sqlldr returned an error (exit code " + exitVal + ")");
}
}
- public boolean execute( OraBulkLoaderMeta meta, boolean wait ) throws HopException {
+ public boolean execute(OraBulkLoaderMeta meta, boolean wait) throws HopException {
Runtime runtime = Runtime.getRuntime();
try {
- sqlldrProcess = runtime.exec( createCommandLine( meta, true ) );
+ sqlldrProcess = runtime.exec(createCommandLine(meta, true));
// any error message?
- StreamLogger errorLogger = new StreamLogger( sqlldrProcess.getErrorStream(), "ERROR" );
+ StreamLogger errorLogger = new StreamLogger(sqlldrProcess.getErrorStream(), "ERROR");
// any output?
- StreamLogger outputLogger = new StreamLogger( sqlldrProcess.getInputStream(), "OUTPUT" );
+ StreamLogger outputLogger = new StreamLogger(sqlldrProcess.getInputStream(), "OUTPUT");
// kick them off
errorLogger.start();
outputLogger.start();
- if ( wait ) {
+ if (wait) {
// any error???
int exitVal = sqlldrProcess.waitFor();
sqlldrProcess = null;
- logBasic( BaseMessages.getString( PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal ) );
- checkExitVal( exitVal );
+ logBasic(BaseMessages.getString(PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal));
+ checkExitVal(exitVal);
}
- } catch ( Exception ex ) {
+ } catch (Exception ex) {
// Don't throw the message upwards, the message contains the password.
- throw new HopException( "Error while executing sqlldr \'" + createCommandLine( meta, false ) + "\'" );
+ throw new HopException(
+ "Error while executing sqlldr \'" + createCommandLine(meta, false) + "\'");
}
return true;
}
+ @Override
public boolean processRow() throws HopException {
try {
Object[] r = getRow(); // Get row from input rowset & set row busy!
- if ( r == null ) {
+ if (r == null) {
// no more input to be expected...
setOutputDone();
- if ( !preview ) {
- if ( output != null ) {
+ if (!preview) {
+ if (output != null) {
// Close the output
try {
output.close();
- } catch ( IOException e ) {
- throw new HopException( "Error while closing output", e );
+ } catch (IOException e) {
+ throw new HopException("Error while closing output", e);
}
output = null;
}
String loadMethod = meta.getLoadMethod();
- if ( OraBulkLoaderMeta.METHOD_AUTO_END.equals( loadMethod ) ) {
+ if (OraBulkLoaderMeta.METHOD_AUTO_END.equals(loadMethod)) {
// if this is the first line, we do not need to execute loader
// control file may not exists
- if ( !first ) {
- execute( meta, true );
+ if (!first) {
+ execute(meta, true);
sqlldrProcess = null;
}
- } else if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() ) ) {
+ } else if (OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals(meta.getLoadMethod())) {
try {
- if ( sqlldrProcess != null ) {
+ if (sqlldrProcess != null) {
int exitVal = sqlldrProcess.waitFor();
sqlldrProcess = null;
- logBasic( BaseMessages.getString( PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal ) );
- checkExitVal( exitVal );
- } else if ( !first ) {
- throw new HopException( "Internal error: no sqlldr process running" );
+ logBasic(
+ BaseMessages.getString(PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal));
+ checkExitVal(exitVal);
+ } else if (!first) {
+ throw new HopException("Internal error: no sqlldr process running");
}
- } catch ( Exception ex ) {
- throw new HopException( "Error while executing sqlldr", ex );
+ } catch (Exception ex) {
+ throw new HopException("Error while executing sqlldr", ex);
}
}
}
return false;
}
- if ( !preview ) {
- if ( first ) {
+ if (!preview) {
+ if (first) {
first = false;
String recTerm = Const.CR;
- if ( !Utils.isEmpty( meta.getAltRecordTerm() ) ) {
- recTerm = substituteRecordTerminator( meta.getAltRecordTerm() );
+ if (!Utils.isEmpty(meta.getAltRecordTerm())) {
+ recTerm = substituteRecordTerminator(meta.getAltRecordTerm());
}
- createControlFile( resolve( meta.getControlFile() ), r, meta );
- output = new OraBulkDataOutput( meta, recTerm );
+ createControlFile(resolve(meta.getControlFile()), r, meta);
+ output = new OraBulkDataOutput(meta, recTerm);
- if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( meta.getLoadMethod() ) ) {
- execute( meta, false );
+ if (OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals(meta.getLoadMethod())) {
+ execute(meta, false);
}
- output.open( this, sqlldrProcess );
+ output.open(this, sqlldrProcess);
}
- output.writeLine( getInputRowMeta(), r );
+ output.writeLine(getInputRowMeta(), r);
}
- putRow( getInputRowMeta(), r );
+ putRow(getInputRowMeta(), r);
incrementLinesOutput();
- } catch ( HopException e ) {
- logError( BaseMessages.getString( PKG, "OraBulkLoader.Log.ErrorInTransform" ) + e.getMessage() );
- setErrors( 1 );
+ } catch (HopException e) {
+ logError(BaseMessages.getString(PKG, "OraBulkLoader.Log.ErrorInTransform") + e.getMessage());
+ setErrors(1);
stopAll();
setOutputDone(); // signal end to receiver(s)
return false;
@@ -580,21 +579,23 @@
}
protected void verifyDatabaseConnection() throws HopException {
- if ( meta.getDatabaseMeta() == null ) {
- throw new HopException( BaseMessages.getString( PKG, "OraBulkLoaderMeta.GetSQL.NoConnectionDefined" ) );
+ if (meta.getDatabaseMeta() == null) {
+ throw new HopException(
+ BaseMessages.getString(PKG, "OraBulkLoaderMeta.GetSQL.NoConnectionDefined"));
}
}
+ @Override
public boolean init() {
IPipelineEngine pipeline = this.getPipeline();
preview = pipeline.isPreview();
- if ( super.init() ) {
+ if (super.init()) {
try {
verifyDatabaseConnection();
- } catch ( HopException ex ) {
- logError( ex.getMessage() );
+ } catch (HopException ex) {
+ logError(ex.getMessage());
return false;
}
return true;
@@ -602,83 +603,84 @@
return false;
}
+ @Override
public void dispose() {
super.dispose();
// close output stream (may terminate running sqlldr)
- if ( output != null ) {
+ if (output != null) {
// Close the output
try {
output.close();
- } catch ( IOException e ) {
- logError( "Error while closing output", e );
+ } catch (IOException e) {
+ logError("Error while closing output", e);
}
output = null;
}
// running sqlldr process must be terminated
- if ( sqlldrProcess != null ) {
+ if (sqlldrProcess != null) {
try {
int exitVal = sqlldrProcess.waitFor();
sqlldrProcess = null;
- logBasic( BaseMessages.getString( PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal ) );
- } catch ( InterruptedException e ) {
+ logBasic(BaseMessages.getString(PKG, "OraBulkLoader.Log.ExitValueSqlldr", "" + exitVal));
+ } catch (InterruptedException e) {
/* process should be destroyed */
e.printStackTrace();
- if ( sqlldrProcess != null ) {
+ if (sqlldrProcess != null) {
sqlldrProcess.destroy();
}
}
}
- if ( !preview && meta.isEraseFiles() ) {
+ if (!preview && meta.isEraseFiles()) {
// Erase the created cfg/dat files if requested. We don't erase
// the rest of the files because it would be "stupid" to erase them
// right after creation. If you don't want them, don't fill them in.
FileObject fileObject = null;
String method = meta.getLoadMethod();
- if ( OraBulkLoaderMeta.METHOD_AUTO_END.equals( method ) ) {
- if ( meta.getControlFile() != null ) {
- try {
- fileObject = getFileObject( meta.getControlFile(), variables );
- fileObject.delete();
- fileObject.close();
- } catch ( Exception ex ) {
- logError( "Error deleting control file \'"
- + getFilename( fileObject ) + "\': " + ex.getMessage(), ex );
- }
+ if (OraBulkLoaderMeta.METHOD_AUTO_END.equals(method) && meta.getControlFile() != null) {
+
+ try {
+ fileObject = getFileObject(meta.getControlFile(), variables);
+ fileObject.delete();
+ fileObject.close();
+ } catch (Exception ex) {
+ logError(
+ "Error deleting control file \'" + getFilename(fileObject) + "\': " + ex.getMessage(),
+ ex);
}
}
- if ( OraBulkLoaderMeta.METHOD_AUTO_END.equals( method ) ) {
+ if (OraBulkLoaderMeta.METHOD_AUTO_END.equals(method) && meta.getDataFile() != null) {
// In concurrent mode the data is written to the control file.
- if ( meta.getDataFile() != null ) {
- try {
- fileObject = getFileObject( meta.getDataFile(), variables );
- fileObject.delete();
- fileObject.close();
- } catch ( Exception ex ) {
- logError( "Error deleting data file \'"
- + getFilename( fileObject ) + "\': " + ex.getMessage(), ex );
- }
+
+ try {
+ fileObject = getFileObject(meta.getDataFile(), variables);
+ fileObject.delete();
+ fileObject.close();
+ } catch (Exception ex) {
+ logError(
+ "Error deleting data file \'" + getFilename(fileObject) + "\': " + ex.getMessage(),
+ ex);
}
}
- if ( OraBulkLoaderMeta.METHOD_MANUAL.equals( method ) ) {
- logBasic( "Deletion of files is not compatible with \'manual load method\'" );
+ if (OraBulkLoaderMeta.METHOD_MANUAL.equals(method)) {
+ logBasic("Deletion of files is not compatible with \'manual load method\'");
}
}
}
+
@VisibleForTesting
- String getFilename( FileObject fileObject ) {
- return HopVfs.getFilename( fileObject );
+ String getFilename(FileObject fileObject) {
+ return HopVfs.getFilename(fileObject);
}
@VisibleForTesting
- FileObject getFileObject( String fileName, IVariables variables ) throws HopFileException {
- return HopVfs.getFileObject( variables.resolve( fileName ) );
+ FileObject getFileObject(String fileName, IVariables variables) throws HopFileException {
+ return HopVfs.getFileObject(variables.resolve(fileName));
}
}
-
diff --git a/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderDialog.java b/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderDialog.java
index f75365f..e6bc71c 100644
--- a/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderDialog.java
+++ b/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderDialog.java
@@ -16,6 +16,8 @@
*/
package org.apache.hop.pipeline.transforms.orabulkloader;
+import java.util.ArrayList;
+import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.hop.core.Const;
import org.apache.hop.core.DbCache;
@@ -52,11 +54,9 @@
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
@@ -69,14 +69,11 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
-import java.util.ArrayList;
-import java.util.List;
-/**
- * Dialog class for the Oracle bulk loader transformation.
- */
-public class OraBulkLoaderDialog extends BaseTransformDialog implements ITransformDialog {
- private static Class<?> PKG = OraBulkLoaderDialog.class; // for i18n purposes, needed by Translator2!!
+/** Dialog class for the Oracle bulk loader transformation. */
+public class OraBulkLoaderDialog extends BaseTransformDialog implements ITransformDialog {
+ private static final Class<?> PKG =
+ OraBulkLoaderDialog.class; // for i18n purposes, needed by Translator2!!
private MetaSelectionLine<DatabaseMeta> wConnection;
private TextVar wSchema;
@@ -102,29 +99,28 @@
private Button wFailOnError;
private Button wParallel;
private TextVar wAltRecordTerm;
-
+
private OraBulkLoaderMeta input;
private final List<String> inputFields = new ArrayList<>();
private ColumnInfo[] ciReturn;
- private CTabFolder wTabFolder;
-
-// private Composite helpComp;
- /**
- * List of ColumnInfo that should have the field names of the selected database table
- */
- private List<ColumnInfo> tableFieldColumns = new ArrayList<ColumnInfo>();
+ /** List of ColumnInfo that should have the field names of the selected database table */
+ private List<ColumnInfo> tableFieldColumns = new ArrayList<>();
// These should not be translated, they are required to exist on all
// platforms according to the documentation of "Charset".
- private static String[] encodings = { "", "US-ASCII", "ISO-8859-1", "UTF-8", "UTF-16BE", "UTF-16LE", "UTF-16" };
+ private static String[] encodings = {
+ "", "US-ASCII", "ISO-8859-1", "UTF-8", "UTF-16BE", "UTF-16LE", "UTF-16"
+ };
- private static String[] characterSetNames = { "", "US7ASCII", "WE8ISO8859P1", "UTF8", };
+ private static String[] characterSetNames = {
+ "", "US7ASCII", "WE8ISO8859P1", "UTF8",
+ };
- private static final String[] ALL_FILETYPES = new String[] { BaseMessages.getString(
- PKG, "OraBulkLoaderDialog.Filetype.All" ) };
+ private static final String[] ALL_FILETYPES =
+ new String[] {BaseMessages.getString(PKG, "OraBulkLoaderDialog.Filetype.All")};
public OraBulkLoaderDialog(
Shell parent, IVariables variables, Object in, PipelineMeta pipelineMeta, String sname) {
@@ -133,26 +129,21 @@
}
public String open() {
+ CTabFolder wTabFolder;
Shell parent = getParent();
- shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );
- shell.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Shell.Title" ) );
- PropsUi.setLook( shell );
+ shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
+ shell.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Shell.Title"));
+ PropsUi.setLook(shell);
setShellImage(shell, input);
ModifyListener lsMod = e -> input.setChanged();
- ModifyListener lsTableMod = new ModifyListener() {
- public void modifyText( ModifyEvent arg0 ) {
- input.setChanged();
- setTableFieldCombo();
- }
- };
- SelectionListener lsSelection = new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- input.setChanged();
- setTableFieldCombo();
- }
- };
+ ModifyListener lsTableMod =
+ arg0 -> {
+ input.setChanged();
+ setTableFieldCombo();
+ };
+
changed = input.hasChanged();
FormLayout formLayout = new FormLayout();
@@ -164,39 +155,38 @@
int middle = props.getMiddlePct();
int margin = PropsUi.getMargin();
-
// Transform name line
- wlTransformName = new Label( shell, SWT.RIGHT );
- wlTransformName.setText( BaseMessages.getString( PKG, "System.Label.TransformName" ) );
- PropsUi.setLook( wlTransformName );
+ wlTransformName = new Label(shell, SWT.RIGHT);
+ wlTransformName.setText(BaseMessages.getString(PKG, "System.Label.TransformName"));
+ PropsUi.setLook(wlTransformName);
FormData fdlTransformName = new FormData();
- fdlTransformName.left = new FormAttachment( 0, 0 );
- fdlTransformName.right = new FormAttachment( middle, -margin );
- fdlTransformName.top = new FormAttachment( 0, margin );
- wlTransformName.setLayoutData( fdlTransformName );
-
- wTransformName = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- wTransformName.setText( transformName );
- PropsUi.setLook( wTransformName );
- wTransformName.addModifyListener( lsMod );
+ fdlTransformName.left = new FormAttachment(0, 0);
+ fdlTransformName.right = new FormAttachment(middle, -margin);
+ fdlTransformName.top = new FormAttachment(0, margin);
+ wlTransformName.setLayoutData(fdlTransformName);
+
+ wTransformName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ wTransformName.setText(transformName);
+ PropsUi.setLook(wTransformName);
+ wTransformName.addModifyListener(lsMod);
FormData fdTransformName = new FormData();
- fdTransformName.left = new FormAttachment( middle, 0 );
- fdTransformName.top = new FormAttachment( 0, margin );
- fdTransformName.right = new FormAttachment( 100, 0 );
- wTransformName.setLayoutData( fdTransformName );
-
+ fdTransformName.left = new FormAttachment(middle, 0);
+ fdTransformName.top = new FormAttachment(0, margin);
+ fdTransformName.right = new FormAttachment(100, 0);
+ wTransformName.setLayoutData(fdTransformName);
+
// The buttons
- wOk = new Button( shell, SWT.PUSH );
- wOk.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
- wOk.addListener( SWT.Selection, e -> ok() );
- wSql = new Button( shell, SWT.PUSH );
- wSql.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.SQL.Button" ) );
- wSql.addListener( SWT.Selection, e -> create() );
- wCancel = new Button( shell, SWT.PUSH );
- wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) );
- wCancel.addListener( SWT.Selection, e -> cancel() );
- setButtonPositions( new Button[] { wOk, wCancel, wSql }, margin, null );
-
+ wOk = new Button(shell, SWT.PUSH);
+ wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
+ wOk.addListener(SWT.Selection, e -> ok());
+ wSql = new Button(shell, SWT.PUSH);
+ wSql.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.SQL.Button"));
+ wSql.addListener(SWT.Selection, e -> create());
+ wCancel = new Button(shell, SWT.PUSH);
+ wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
+ wCancel.addListener(SWT.Selection, e -> cancel());
+ setButtonPositions(new Button[] {wOk, wCancel, wSql}, margin, null);
+
// Tab folder
wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, PropsUi.WIDGET_STYLE_DEFAULT);
@@ -207,8 +197,7 @@
fdTabFolder.right = new FormAttachment(100, 0);
fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
wTabFolder.setLayoutData(fdTabFolder);
-
-
+
CTabItem wBulkLoaderTab = new CTabItem(wTabFolder, SWT.NONE);
wBulkLoaderTab.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.BulkLoader.Label"));
@@ -218,347 +207,348 @@
fdBulkLoaderLayout.marginHeight = 3;
wBulkLoaderComposite.setLayout(fdBulkLoaderLayout);
PropsUi.setLook(wBulkLoaderComposite);
-
+
FormData fdComp = new FormData();
- fdComp.left = new FormAttachment( 0, 0 );
- fdComp.top = new FormAttachment( 0, 0 );
- fdComp.right = new FormAttachment( 100, 0 );
- fdComp.bottom = new FormAttachment( 100, 0 );
- wBulkLoaderComposite.setLayoutData( fdComp );
+ fdComp.left = new FormAttachment(0, 0);
+ fdComp.top = new FormAttachment(0, 0);
+ fdComp.right = new FormAttachment(100, 0);
+ fdComp.bottom = new FormAttachment(100, 0);
+ wBulkLoaderComposite.setLayoutData(fdComp);
// Connection line
- wConnection = addConnectionLine(wBulkLoaderComposite, wTransformName, input.getDatabaseMeta(), lsMod);
+ wConnection =
+ addConnectionLine(wBulkLoaderComposite, wTransformName, input.getDatabaseMeta(), lsMod);
// Schema line...
- Label wlSchema = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlSchema.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.TargetSchema.Label" ) );
- PropsUi.setLook( wlSchema );
+ Label wlSchema = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlSchema.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.TargetSchema.Label"));
+ PropsUi.setLook(wlSchema);
FormData fdlSchema = new FormData();
- fdlSchema.left = new FormAttachment( 0, 0 );
- fdlSchema.right = new FormAttachment( middle, -margin );
- fdlSchema.top = new FormAttachment( wConnection, margin * 2 );
- wlSchema.setLayoutData( fdlSchema );
+ fdlSchema.left = new FormAttachment(0, 0);
+ fdlSchema.right = new FormAttachment(middle, -margin);
+ fdlSchema.top = new FormAttachment(wConnection, margin * 2);
+ wlSchema.setLayoutData(fdlSchema);
- Button wbSchema = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbSchema );
- wbSchema.setText( BaseMessages.getString( PKG, "System.Button.Browse" ) );
- wbSchema.addListener( SWT.Selection, e -> getSchemaNames() );
+ Button wbSchema = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbSchema);
+ wbSchema.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
+ wbSchema.addListener(SWT.Selection, e -> getSchemaNames());
FormData fdbSchema = new FormData();
- fdbSchema.top = new FormAttachment( wConnection, 2 * margin );
- fdbSchema.right = new FormAttachment( 100, 0 );
- wbSchema.setLayoutData( fdbSchema );
+ fdbSchema.top = new FormAttachment(wConnection, 2 * margin);
+ fdbSchema.right = new FormAttachment(100, 0);
+ wbSchema.setLayoutData(fdbSchema);
- wSchema = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wSchema );
- wSchema.addModifyListener( lsTableMod );
+ wSchema = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wSchema);
+ wSchema.addModifyListener(lsTableMod);
FormData fdSchema = new FormData();
- fdSchema.left = new FormAttachment( middle, 0 );
- fdSchema.top = new FormAttachment( wConnection, margin * 2 );
- fdSchema.right = new FormAttachment( wbSchema, -margin );
- wSchema.setLayoutData( fdSchema );
-
- // Table line...
- Label wlTable = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlTable.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.TargetTable.Label" ) );
- PropsUi.setLook( wlTable );
- FormData fdlTable = new FormData();
- fdlTable.left = new FormAttachment( 0, 0 );
- fdlTable.right = new FormAttachment( middle, -margin );
- fdlTable.top = new FormAttachment( wbSchema, margin );
- wlTable.setLayoutData( fdlTable );
+ fdSchema.left = new FormAttachment(middle, 0);
+ fdSchema.top = new FormAttachment(wConnection, margin * 2);
+ fdSchema.right = new FormAttachment(wbSchema, -margin);
+ wSchema.setLayoutData(fdSchema);
- Button wbTable = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbTable );
- wbTable.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
- wbTable.addListener( SWT.Selection, e -> getTableName() );
+ // Table line...
+ Label wlTable = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlTable.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.TargetTable.Label"));
+ PropsUi.setLook(wlTable);
+ FormData fdlTable = new FormData();
+ fdlTable.left = new FormAttachment(0, 0);
+ fdlTable.right = new FormAttachment(middle, -margin);
+ fdlTable.top = new FormAttachment(wbSchema, margin);
+ wlTable.setLayoutData(fdlTable);
+
+ Button wbTable = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbTable);
+ wbTable.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
+ wbTable.addListener(SWT.Selection, e -> getTableName());
FormData fdbTable = new FormData();
- fdbTable.right = new FormAttachment( 100, 0 );
- fdbTable.top = new FormAttachment( wbSchema, margin );
- wbTable.setLayoutData( fdbTable );
- wTable = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wTable );
- wTable.addModifyListener( lsTableMod );
+ fdbTable.right = new FormAttachment(100, 0);
+ fdbTable.top = new FormAttachment(wbSchema, margin);
+ wbTable.setLayoutData(fdbTable);
+ wTable = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wTable);
+ wTable.addModifyListener(lsTableMod);
FormData fdTable = new FormData();
- fdTable.left = new FormAttachment( middle, 0 );
- fdTable.top = new FormAttachment( wbSchema, margin );
- fdTable.right = new FormAttachment( wbTable, -margin );
- wTable.setLayoutData( fdTable );
+ fdTable.left = new FormAttachment(middle, 0);
+ fdTable.top = new FormAttachment(wbSchema, margin);
+ fdTable.right = new FormAttachment(wbTable, -margin);
+ wTable.setLayoutData(fdTable);
// Sqlldr line...
- Label wlSqlldr = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlSqlldr.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Sqlldr.Label" ) );
- PropsUi.setLook( wlSqlldr );
+ Label wlSqlldr = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlSqlldr.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Sqlldr.Label"));
+ PropsUi.setLook(wlSqlldr);
FormData fdlSqlldr = new FormData();
- fdlSqlldr.left = new FormAttachment( 0, 0 );
- fdlSqlldr.right = new FormAttachment( middle, -margin );
- fdlSqlldr.top = new FormAttachment( wTable, margin );
- wlSqlldr.setLayoutData( fdlSqlldr );
+ fdlSqlldr.left = new FormAttachment(0, 0);
+ fdlSqlldr.right = new FormAttachment(middle, -margin);
+ fdlSqlldr.top = new FormAttachment(wTable, margin);
+ wlSqlldr.setLayoutData(fdlSqlldr);
- Button wbSqlldr = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbSqlldr );
- wbSqlldr.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
+ Button wbSqlldr = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbSqlldr);
+ wbSqlldr.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
FormData fdbSqlldr = new FormData();
- fdbSqlldr.right = new FormAttachment( 100, 0 );
- fdbSqlldr.top = new FormAttachment( wTable, margin );
- wbSqlldr.setLayoutData( fdbSqlldr );
- wSqlldr = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wSqlldr );
- wSqlldr.addModifyListener( lsMod );
+ fdbSqlldr.right = new FormAttachment(100, 0);
+ fdbSqlldr.top = new FormAttachment(wTable, margin);
+ wbSqlldr.setLayoutData(fdbSqlldr);
+ wSqlldr = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wSqlldr);
+ wSqlldr.addModifyListener(lsMod);
FormData fdSqlldr = new FormData();
- fdSqlldr.left = new FormAttachment( middle, 0 );
- fdSqlldr.top = new FormAttachment( wTable, margin );
- fdSqlldr.right = new FormAttachment( wbSqlldr, -margin );
- wSqlldr.setLayoutData( fdSqlldr );
+ fdSqlldr.left = new FormAttachment(middle, 0);
+ fdSqlldr.top = new FormAttachment(wTable, margin);
+ fdSqlldr.right = new FormAttachment(wbSqlldr, -margin);
+ wSqlldr.setLayoutData(fdSqlldr);
// Load Method line
- Label wlLoadMethod = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlLoadMethod.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.LoadMethod.Label" ) );
- PropsUi.setLook( wlLoadMethod );
+ Label wlLoadMethod = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlLoadMethod.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.LoadMethod.Label"));
+ PropsUi.setLook(wlLoadMethod);
FormData fdlLoadMethod = new FormData();
- fdlLoadMethod.left = new FormAttachment( 0, 0 );
- fdlLoadMethod.right = new FormAttachment( middle, -margin );
- fdlLoadMethod.top = new FormAttachment( wSqlldr, margin );
- wlLoadMethod.setLayoutData( fdlLoadMethod );
- wLoadMethod = new CCombo( wBulkLoaderComposite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER );
- wLoadMethod.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AutoEndLoadMethod.Label" ) );
- wLoadMethod.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.ManualLoadMethod.Label" ) );
- wLoadMethod.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AutoConcLoadMethod.Label" ) );
- wLoadMethod.select( 0 ); // +1: starts at -1
- wLoadMethod.addModifyListener( lsMod );
+ fdlLoadMethod.left = new FormAttachment(0, 0);
+ fdlLoadMethod.right = new FormAttachment(middle, -margin);
+ fdlLoadMethod.top = new FormAttachment(wSqlldr, margin);
+ wlLoadMethod.setLayoutData(fdlLoadMethod);
+ wLoadMethod = new CCombo(wBulkLoaderComposite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
+ wLoadMethod.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.AutoEndLoadMethod.Label"));
+ wLoadMethod.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.ManualLoadMethod.Label"));
+ wLoadMethod.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.AutoConcLoadMethod.Label"));
+ wLoadMethod.select(0); // +1: starts at -1
+ wLoadMethod.addModifyListener(lsMod);
- PropsUi.setLook( wLoadMethod );
+ PropsUi.setLook(wLoadMethod);
FormData fdLoadMethod = new FormData();
- fdLoadMethod.left = new FormAttachment( middle, 0 );
- fdLoadMethod.top = new FormAttachment( wSqlldr, margin );
- fdLoadMethod.right = new FormAttachment( 100, 0 );
- wLoadMethod.setLayoutData( fdLoadMethod );
+ fdLoadMethod.left = new FormAttachment(middle, 0);
+ fdLoadMethod.top = new FormAttachment(wSqlldr, margin);
+ fdLoadMethod.right = new FormAttachment(100, 0);
+ wLoadMethod.setLayoutData(fdLoadMethod);
fdLoadMethod = new FormData();
- fdLoadMethod.left = new FormAttachment( middle, 0 );
- fdLoadMethod.top = new FormAttachment( wSqlldr, margin );
- fdLoadMethod.right = new FormAttachment( 100, 0 );
- wLoadMethod.setLayoutData( fdLoadMethod );
+ fdLoadMethod.left = new FormAttachment(middle, 0);
+ fdLoadMethod.top = new FormAttachment(wSqlldr, margin);
+ fdLoadMethod.right = new FormAttachment(100, 0);
+ wLoadMethod.setLayoutData(fdLoadMethod);
// Load Action line
- Label wlLoadAction = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlLoadAction.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.LoadAction.Label" ) );
- PropsUi.setLook( wlLoadAction );
+ Label wlLoadAction = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlLoadAction.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.LoadAction.Label"));
+ PropsUi.setLook(wlLoadAction);
FormData fdlLoadAction = new FormData();
- fdlLoadAction.left = new FormAttachment( 0, 0 );
- fdlLoadAction.right = new FormAttachment( middle, -margin );
- fdlLoadAction.top = new FormAttachment( wLoadMethod, margin );
- wlLoadAction.setLayoutData( fdlLoadAction );
- wLoadAction = new CCombo( wBulkLoaderComposite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER );
- wLoadAction.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AppendLoadAction.Label" ) );
- wLoadAction.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InsertLoadAction.Label" ) );
- wLoadAction.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.ReplaceLoadAction.Label" ) );
- wLoadAction.add( BaseMessages.getString( PKG, "OraBulkLoaderDialog.TruncateLoadAction.Label" ) );
- wLoadAction.select( 0 ); // +1: starts at -1
- wLoadAction.addModifyListener( lsMod );
+ fdlLoadAction.left = new FormAttachment(0, 0);
+ fdlLoadAction.right = new FormAttachment(middle, -margin);
+ fdlLoadAction.top = new FormAttachment(wLoadMethod, margin);
+ wlLoadAction.setLayoutData(fdlLoadAction);
+ wLoadAction = new CCombo(wBulkLoaderComposite, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
+ wLoadAction.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.AppendLoadAction.Label"));
+ wLoadAction.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.InsertLoadAction.Label"));
+ wLoadAction.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.ReplaceLoadAction.Label"));
+ wLoadAction.add(BaseMessages.getString(PKG, "OraBulkLoaderDialog.TruncateLoadAction.Label"));
+ wLoadAction.select(0); // +1: starts at -1
+ wLoadAction.addModifyListener(lsMod);
- PropsUi.setLook( wLoadAction );
+ PropsUi.setLook(wLoadAction);
FormData fdLoadAction = new FormData();
- fdLoadAction.left = new FormAttachment( middle, 0 );
- fdLoadAction.top = new FormAttachment( wLoadMethod, margin );
- fdLoadAction.right = new FormAttachment( 100, 0 );
- wLoadAction.setLayoutData( fdLoadAction );
+ fdLoadAction.left = new FormAttachment(middle, 0);
+ fdLoadAction.top = new FormAttachment(wLoadMethod, margin);
+ fdLoadAction.right = new FormAttachment(100, 0);
+ wLoadAction.setLayoutData(fdLoadAction);
// MaxErrors file line
- Label wlMaxErrors = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlMaxErrors.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.MaxErrors.Label" ) );
- PropsUi.setLook( wlMaxErrors );
+ Label wlMaxErrors = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlMaxErrors.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.MaxErrors.Label"));
+ PropsUi.setLook(wlMaxErrors);
FormData fdlMaxErrors = new FormData();
- fdlMaxErrors.left = new FormAttachment( 0, 0 );
- fdlMaxErrors.top = new FormAttachment( wLoadAction, margin );
- fdlMaxErrors.right = new FormAttachment( middle, -margin );
- wlMaxErrors.setLayoutData( fdlMaxErrors );
- wMaxErrors = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wMaxErrors );
- wMaxErrors.addModifyListener( lsMod );
+ fdlMaxErrors.left = new FormAttachment(0, 0);
+ fdlMaxErrors.top = new FormAttachment(wLoadAction, margin);
+ fdlMaxErrors.right = new FormAttachment(middle, -margin);
+ wlMaxErrors.setLayoutData(fdlMaxErrors);
+ wMaxErrors = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wMaxErrors);
+ wMaxErrors.addModifyListener(lsMod);
FormData fdMaxErrors = new FormData();
- fdMaxErrors.left = new FormAttachment( middle, 0 );
- fdMaxErrors.top = new FormAttachment( wLoadAction, margin );
- fdMaxErrors.right = new FormAttachment( 100, 0 );
- wMaxErrors.setLayoutData( fdMaxErrors );
+ fdMaxErrors.left = new FormAttachment(middle, 0);
+ fdMaxErrors.top = new FormAttachment(wLoadAction, margin);
+ fdMaxErrors.right = new FormAttachment(100, 0);
+ wMaxErrors.setLayoutData(fdMaxErrors);
// Commmit/batch file line
- Label wlCommit = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlCommit.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Commit.Label" ) );
- PropsUi.setLook( wlCommit );
+ Label wlCommit = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlCommit.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Commit.Label"));
+ PropsUi.setLook(wlCommit);
FormData fdlCommit = new FormData();
- fdlCommit.left = new FormAttachment( 0, 0 );
- fdlCommit.top = new FormAttachment( wMaxErrors, margin );
- fdlCommit.right = new FormAttachment( middle, -margin );
- wlCommit.setLayoutData( fdlCommit );
- wCommit = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wCommit );
- wCommit.addModifyListener( lsMod );
+ fdlCommit.left = new FormAttachment(0, 0);
+ fdlCommit.top = new FormAttachment(wMaxErrors, margin);
+ fdlCommit.right = new FormAttachment(middle, -margin);
+ wlCommit.setLayoutData(fdlCommit);
+ wCommit = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wCommit);
+ wCommit.addModifyListener(lsMod);
FormData fdCommit = new FormData();
- fdCommit.left = new FormAttachment( middle, 0 );
- fdCommit.top = new FormAttachment( wMaxErrors, margin );
- fdCommit.right = new FormAttachment( 100, 0 );
- wCommit.setLayoutData( fdCommit );
+ fdCommit.left = new FormAttachment(middle, 0);
+ fdCommit.top = new FormAttachment(wMaxErrors, margin);
+ fdCommit.right = new FormAttachment(100, 0);
+ wCommit.setLayoutData(fdCommit);
// Bind size line
- Label wlBindSize = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlBindSize.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.BindSize.Label" ) );
- PropsUi.setLook( wlBindSize );
+ Label wlBindSize = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlBindSize.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.BindSize.Label"));
+ PropsUi.setLook(wlBindSize);
FormData fdlBindSize = new FormData();
- fdlBindSize.left = new FormAttachment( 0, 0 );
- fdlBindSize.top = new FormAttachment( wCommit, margin );
- fdlBindSize.right = new FormAttachment( middle, -margin );
- wlBindSize.setLayoutData( fdlBindSize );
- wBindSize = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wBindSize );
- wBindSize.addModifyListener( lsMod );
+ fdlBindSize.left = new FormAttachment(0, 0);
+ fdlBindSize.top = new FormAttachment(wCommit, margin);
+ fdlBindSize.right = new FormAttachment(middle, -margin);
+ wlBindSize.setLayoutData(fdlBindSize);
+ wBindSize = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wBindSize);
+ wBindSize.addModifyListener(lsMod);
FormData fdBindSize = new FormData();
- fdBindSize.left = new FormAttachment( middle, 0 );
- fdBindSize.top = new FormAttachment( wCommit, margin );
- fdBindSize.right = new FormAttachment( 100, 0 );
- wBindSize.setLayoutData( fdBindSize );
+ fdBindSize.left = new FormAttachment(middle, 0);
+ fdBindSize.top = new FormAttachment(wCommit, margin);
+ fdBindSize.right = new FormAttachment(100, 0);
+ wBindSize.setLayoutData(fdBindSize);
// Read size line
- Label wlReadSize = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlReadSize.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.ReadSize.Label" ) );
- PropsUi.setLook( wlReadSize );
+ Label wlReadSize = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlReadSize.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.ReadSize.Label"));
+ PropsUi.setLook(wlReadSize);
FormData fdlReadSize = new FormData();
- fdlReadSize.left = new FormAttachment( 0, 0 );
- fdlReadSize.top = new FormAttachment( wBindSize, margin );
- fdlReadSize.right = new FormAttachment( middle, -margin );
- wlReadSize.setLayoutData( fdlReadSize );
- wReadSize = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wReadSize );
- wReadSize.addModifyListener( lsMod );
+ fdlReadSize.left = new FormAttachment(0, 0);
+ fdlReadSize.top = new FormAttachment(wBindSize, margin);
+ fdlReadSize.right = new FormAttachment(middle, -margin);
+ wlReadSize.setLayoutData(fdlReadSize);
+ wReadSize = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wReadSize);
+ wReadSize.addModifyListener(lsMod);
FormData fdReadSize = new FormData();
- fdReadSize.left = new FormAttachment( middle, 0 );
- fdReadSize.top = new FormAttachment( wBindSize, margin );
- fdReadSize.right = new FormAttachment( 100, 0 );
- wReadSize.setLayoutData( fdReadSize );
+ fdReadSize.left = new FormAttachment(middle, 0);
+ fdReadSize.top = new FormAttachment(wBindSize, margin);
+ fdReadSize.right = new FormAttachment(100, 0);
+ wReadSize.setLayoutData(fdReadSize);
// Control file line
- Label wlControlFile = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlControlFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.ControlFile.Label" ) );
- PropsUi.setLook( wlControlFile );
+ Label wlControlFile = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlControlFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.ControlFile.Label"));
+ PropsUi.setLook(wlControlFile);
FormData fdlControlFile = new FormData();
- fdlControlFile.left = new FormAttachment( 0, 0 );
- fdlControlFile.top = new FormAttachment( wReadSize, margin );
- fdlControlFile.right = new FormAttachment( middle, -margin );
- wlControlFile.setLayoutData( fdlControlFile );
- Button wbControlFile = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbControlFile );
- wbControlFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
+ fdlControlFile.left = new FormAttachment(0, 0);
+ fdlControlFile.top = new FormAttachment(wReadSize, margin);
+ fdlControlFile.right = new FormAttachment(middle, -margin);
+ wlControlFile.setLayoutData(fdlControlFile);
+ Button wbControlFile = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbControlFile);
+ wbControlFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
FormData fdbControlFile = new FormData();
- fdbControlFile.right = new FormAttachment( 100, 0 );
- fdbControlFile.top = new FormAttachment( wReadSize, margin );
- wbControlFile.setLayoutData( fdbControlFile );
- wControlFile = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wControlFile );
- wControlFile.addModifyListener( lsMod );
+ fdbControlFile.right = new FormAttachment(100, 0);
+ fdbControlFile.top = new FormAttachment(wReadSize, margin);
+ wbControlFile.setLayoutData(fdbControlFile);
+ wControlFile = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wControlFile);
+ wControlFile.addModifyListener(lsMod);
FormData fdControlFile = new FormData();
- fdControlFile.left = new FormAttachment( middle, 0 );
- fdControlFile.top = new FormAttachment( wReadSize, margin );
- fdControlFile.right = new FormAttachment( wbControlFile, -margin );
- wControlFile.setLayoutData( fdControlFile );
+ fdControlFile.left = new FormAttachment(middle, 0);
+ fdControlFile.top = new FormAttachment(wReadSize, margin);
+ fdControlFile.right = new FormAttachment(wbControlFile, -margin);
+ wControlFile.setLayoutData(fdControlFile);
// Data file line
- Label wlDataFile = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlDataFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.DataFile.Label" ) );
- PropsUi.setLook( wlDataFile );
+ Label wlDataFile = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlDataFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.DataFile.Label"));
+ PropsUi.setLook(wlDataFile);
FormData fdlDataFile = new FormData();
- fdlDataFile.left = new FormAttachment( 0, 0 );
- fdlDataFile.top = new FormAttachment( wControlFile, margin );
- fdlDataFile.right = new FormAttachment( middle, -margin );
- wlDataFile.setLayoutData( fdlDataFile );
- Button wbDataFile = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbDataFile );
- wbDataFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
+ fdlDataFile.left = new FormAttachment(0, 0);
+ fdlDataFile.top = new FormAttachment(wControlFile, margin);
+ fdlDataFile.right = new FormAttachment(middle, -margin);
+ wlDataFile.setLayoutData(fdlDataFile);
+ Button wbDataFile = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbDataFile);
+ wbDataFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
FormData fdbDataFile = new FormData();
- fdbDataFile.right = new FormAttachment( 100, 0 );
- fdbDataFile.top = new FormAttachment( wControlFile, margin );
- wbDataFile.setLayoutData( fdbDataFile );
- wDataFile = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wDataFile );
- wDataFile.addModifyListener( lsMod );
+ fdbDataFile.right = new FormAttachment(100, 0);
+ fdbDataFile.top = new FormAttachment(wControlFile, margin);
+ wbDataFile.setLayoutData(fdbDataFile);
+ wDataFile = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wDataFile);
+ wDataFile.addModifyListener(lsMod);
FormData fdDataFile = new FormData();
- fdDataFile.left = new FormAttachment( middle, 0 );
- fdDataFile.top = new FormAttachment( wControlFile, margin );
- fdDataFile.right = new FormAttachment( wbDataFile, -margin );
- wDataFile.setLayoutData( fdDataFile );
+ fdDataFile.left = new FormAttachment(middle, 0);
+ fdDataFile.top = new FormAttachment(wControlFile, margin);
+ fdDataFile.right = new FormAttachment(wbDataFile, -margin);
+ wDataFile.setLayoutData(fdDataFile);
// Log file line
- Label wlLogFile = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlLogFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.LogFile.Label" ) );
- PropsUi.setLook( wlLogFile );
+ Label wlLogFile = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlLogFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.LogFile.Label"));
+ PropsUi.setLook(wlLogFile);
FormData fdlLogFile = new FormData();
- fdlLogFile.left = new FormAttachment( 0, 0 );
- fdlLogFile.top = new FormAttachment( wDataFile, margin );
- fdlLogFile.right = new FormAttachment( middle, -margin );
- wlLogFile.setLayoutData( fdlLogFile );
- Button wbLogFile = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbLogFile );
- wbLogFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
+ fdlLogFile.left = new FormAttachment(0, 0);
+ fdlLogFile.top = new FormAttachment(wDataFile, margin);
+ fdlLogFile.right = new FormAttachment(middle, -margin);
+ wlLogFile.setLayoutData(fdlLogFile);
+ Button wbLogFile = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbLogFile);
+ wbLogFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
FormData fdbLogFile = new FormData();
- fdbLogFile.right = new FormAttachment( 100, 0 );
- fdbLogFile.top = new FormAttachment( wDataFile, margin );
- wbLogFile.setLayoutData( fdbLogFile );
- wLogFile = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wLogFile );
- wLogFile.addModifyListener( lsMod );
+ fdbLogFile.right = new FormAttachment(100, 0);
+ fdbLogFile.top = new FormAttachment(wDataFile, margin);
+ wbLogFile.setLayoutData(fdbLogFile);
+ wLogFile = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wLogFile);
+ wLogFile.addModifyListener(lsMod);
FormData fdLogFile = new FormData();
- fdLogFile.left = new FormAttachment( middle, 0 );
- fdLogFile.top = new FormAttachment( wDataFile, margin );
- fdLogFile.right = new FormAttachment( wbLogFile, -margin );
- wLogFile.setLayoutData( fdLogFile );
+ fdLogFile.left = new FormAttachment(middle, 0);
+ fdLogFile.top = new FormAttachment(wDataFile, margin);
+ fdLogFile.right = new FormAttachment(wbLogFile, -margin);
+ wLogFile.setLayoutData(fdLogFile);
// Bad file line
- Label wlBadFile = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlBadFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.BadFile.Label" ) );
- PropsUi.setLook( wlBadFile );
+ Label wlBadFile = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlBadFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.BadFile.Label"));
+ PropsUi.setLook(wlBadFile);
FormData fdlBadFile = new FormData();
- fdlBadFile.left = new FormAttachment( 0, 0 );
- fdlBadFile.top = new FormAttachment( wLogFile, margin );
- fdlBadFile.right = new FormAttachment( middle, -margin );
- wlBadFile.setLayoutData( fdlBadFile );
- Button wbBadFile = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbBadFile );
- wbBadFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
+ fdlBadFile.left = new FormAttachment(0, 0);
+ fdlBadFile.top = new FormAttachment(wLogFile, margin);
+ fdlBadFile.right = new FormAttachment(middle, -margin);
+ wlBadFile.setLayoutData(fdlBadFile);
+ Button wbBadFile = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbBadFile);
+ wbBadFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
FormData fdbBadFile = new FormData();
- fdbBadFile.right = new FormAttachment( 100, 0 );
- fdbBadFile.top = new FormAttachment( wLogFile, margin );
- wbBadFile.setLayoutData( fdbBadFile );
- wBadFile = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wBadFile );
- wBadFile.addModifyListener( lsMod );
+ fdbBadFile.right = new FormAttachment(100, 0);
+ fdbBadFile.top = new FormAttachment(wLogFile, margin);
+ wbBadFile.setLayoutData(fdbBadFile);
+ wBadFile = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wBadFile);
+ wBadFile.addModifyListener(lsMod);
FormData fdBadFile = new FormData();
- fdBadFile.left = new FormAttachment( middle, 0 );
- fdBadFile.top = new FormAttachment( wLogFile, margin );
- fdBadFile.right = new FormAttachment( wbBadFile, -margin );
- wBadFile.setLayoutData( fdBadFile );
+ fdBadFile.left = new FormAttachment(middle, 0);
+ fdBadFile.top = new FormAttachment(wLogFile, margin);
+ fdBadFile.right = new FormAttachment(wbBadFile, -margin);
+ wBadFile.setLayoutData(fdBadFile);
// Discard file line
- Label wlDiscardFile = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlDiscardFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.DiscardFile.Label" ) );
- PropsUi.setLook( wlDiscardFile );
+ Label wlDiscardFile = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlDiscardFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.DiscardFile.Label"));
+ PropsUi.setLook(wlDiscardFile);
FormData fdlDiscardFile = new FormData();
- fdlDiscardFile.left = new FormAttachment( 0, 0 );
- fdlDiscardFile.top = new FormAttachment( wBadFile, margin );
- fdlDiscardFile.right = new FormAttachment( middle, -margin );
- wlDiscardFile.setLayoutData( fdlDiscardFile );
- Button wbDiscardFile = new Button( wBulkLoaderComposite, SWT.PUSH | SWT.CENTER );
- PropsUi.setLook( wbDiscardFile );
- wbDiscardFile.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Browse.Button" ) );
+ fdlDiscardFile.left = new FormAttachment(0, 0);
+ fdlDiscardFile.top = new FormAttachment(wBadFile, margin);
+ fdlDiscardFile.right = new FormAttachment(middle, -margin);
+ wlDiscardFile.setLayoutData(fdlDiscardFile);
+ Button wbDiscardFile = new Button(wBulkLoaderComposite, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbDiscardFile);
+ wbDiscardFile.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Browse.Button"));
FormData fdbDiscardFile = new FormData();
- fdbDiscardFile.right = new FormAttachment( 100, 0 );
- fdbDiscardFile.top = new FormAttachment( wBadFile, margin );
- wbDiscardFile.setLayoutData( fdbDiscardFile );
- wDiscardFile = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wDiscardFile );
- wDiscardFile.addModifyListener( lsMod );
+ fdbDiscardFile.right = new FormAttachment(100, 0);
+ fdbDiscardFile.top = new FormAttachment(wBadFile, margin);
+ wbDiscardFile.setLayoutData(fdbDiscardFile);
+ wDiscardFile = new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wDiscardFile);
+ wDiscardFile.addModifyListener(lsMod);
FormData fdDiscardFile = new FormData();
- fdDiscardFile.left = new FormAttachment( middle, 0 );
- fdDiscardFile.top = new FormAttachment( wBadFile, margin );
- fdDiscardFile.right = new FormAttachment( wbDiscardFile, -margin );
- wDiscardFile.setLayoutData( fdDiscardFile );
+ fdDiscardFile.left = new FormAttachment(middle, 0);
+ fdDiscardFile.top = new FormAttachment(wBadFile, margin);
+ fdDiscardFile.right = new FormAttachment(wbDiscardFile, -margin);
+ wDiscardFile.setLayoutData(fdDiscardFile);
//
// Control encoding line
@@ -566,174 +556,180 @@
// The drop down is editable as it may happen an encoding may not be present
// on one machine, but you may want to use it on your execution server
//
- Label wlEncoding = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlEncoding.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Encoding.Label" ) );
- PropsUi.setLook( wlEncoding );
+ Label wlEncoding = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlEncoding.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Encoding.Label"));
+ PropsUi.setLook(wlEncoding);
FormData fdlEncoding = new FormData();
- fdlEncoding.left = new FormAttachment( 0, 0 );
- fdlEncoding.top = new FormAttachment( wDiscardFile, margin );
- fdlEncoding.right = new FormAttachment( middle, -margin );
- wlEncoding.setLayoutData( fdlEncoding );
- wEncoding = new Combo( wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- wEncoding.setToolTipText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Encoding.Tooltip" ) );
- wEncoding.setItems( encodings );
- PropsUi.setLook( wEncoding );
+ fdlEncoding.left = new FormAttachment(0, 0);
+ fdlEncoding.top = new FormAttachment(wDiscardFile, margin);
+ fdlEncoding.right = new FormAttachment(middle, -margin);
+ wlEncoding.setLayoutData(fdlEncoding);
+ wEncoding = new Combo(wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ wEncoding.setToolTipText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Encoding.Tooltip"));
+ wEncoding.setItems(encodings);
+ PropsUi.setLook(wEncoding);
FormData fdEncoding = new FormData();
- fdEncoding.left = new FormAttachment( middle, 0 );
- fdEncoding.top = new FormAttachment( wDiscardFile, margin );
- fdEncoding.right = new FormAttachment( 100, 0 );
- wEncoding.setLayoutData( fdEncoding );
- wEncoding.addModifyListener( lsMod );
+ fdEncoding.left = new FormAttachment(middle, 0);
+ fdEncoding.top = new FormAttachment(wDiscardFile, margin);
+ fdEncoding.right = new FormAttachment(100, 0);
+ wEncoding.setLayoutData(fdEncoding);
+ wEncoding.addModifyListener(lsMod);
// Oracle character set name line
- Label wlCharacterSetName = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlCharacterSetName.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.CharacterSetName.Label" ) );
- PropsUi.setLook( wlCharacterSetName );
+ Label wlCharacterSetName = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlCharacterSetName.setText(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.CharacterSetName.Label"));
+ PropsUi.setLook(wlCharacterSetName);
FormData fdlCharacterSetName = new FormData();
- fdlCharacterSetName.left = new FormAttachment( 0, 0 );
- fdlCharacterSetName.top = new FormAttachment( wEncoding, margin );
- fdlCharacterSetName.right = new FormAttachment( middle, -margin );
- wlCharacterSetName.setLayoutData( fdlCharacterSetName );
- wCharacterSetName = new Combo( wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- wCharacterSetName
- .setToolTipText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.CharacterSetName.Tooltip" ) );
- wCharacterSetName.setItems( characterSetNames );
- PropsUi.setLook( wCharacterSetName );
+ fdlCharacterSetName.left = new FormAttachment(0, 0);
+ fdlCharacterSetName.top = new FormAttachment(wEncoding, margin);
+ fdlCharacterSetName.right = new FormAttachment(middle, -margin);
+ wlCharacterSetName.setLayoutData(fdlCharacterSetName);
+ wCharacterSetName = new Combo(wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ wCharacterSetName.setToolTipText(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.CharacterSetName.Tooltip"));
+ wCharacterSetName.setItems(characterSetNames);
+ PropsUi.setLook(wCharacterSetName);
FormData fdCharacterSetName = new FormData();
- fdCharacterSetName.left = new FormAttachment( middle, 0 );
- fdCharacterSetName.top = new FormAttachment( wEncoding, margin );
- fdCharacterSetName.right = new FormAttachment( 100, 0 );
- wCharacterSetName.setLayoutData( fdCharacterSetName );
- wCharacterSetName.addModifyListener( lsMod );
+ fdCharacterSetName.left = new FormAttachment(middle, 0);
+ fdCharacterSetName.top = new FormAttachment(wEncoding, margin);
+ fdCharacterSetName.right = new FormAttachment(100, 0);
+ wCharacterSetName.setLayoutData(fdCharacterSetName);
+ wCharacterSetName.addModifyListener(lsMod);
// Alternate Record Terminator
- Label wlAltRecordTerm = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlAltRecordTerm.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AltRecordTerm.Label" ) );
- PropsUi.setLook( wlAltRecordTerm );
+ Label wlAltRecordTerm = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlAltRecordTerm.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.AltRecordTerm.Label"));
+ PropsUi.setLook(wlAltRecordTerm);
FormData fdlAltRecordTerm = new FormData();
- fdlAltRecordTerm.left = new FormAttachment( 0, 0 );
- fdlAltRecordTerm.top = new FormAttachment( wCharacterSetName, margin );
- fdlAltRecordTerm.right = new FormAttachment( middle, -margin );
- wlAltRecordTerm.setLayoutData( fdlAltRecordTerm );
- wAltRecordTerm = new TextVar( variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
- PropsUi.setLook( wAltRecordTerm );
+ fdlAltRecordTerm.left = new FormAttachment(0, 0);
+ fdlAltRecordTerm.top = new FormAttachment(wCharacterSetName, margin);
+ fdlAltRecordTerm.right = new FormAttachment(middle, -margin);
+ wlAltRecordTerm.setLayoutData(fdlAltRecordTerm);
+ wAltRecordTerm =
+ new TextVar(variables, wBulkLoaderComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wAltRecordTerm);
FormData fdAltRecordTerm = new FormData();
- fdAltRecordTerm.left = new FormAttachment( middle, 0 );
- fdAltRecordTerm.top = new FormAttachment( wCharacterSetName, margin );
- fdAltRecordTerm.right = new FormAttachment( 100, 0 );
- wAltRecordTerm.setLayoutData( fdAltRecordTerm );
- wAltRecordTerm.addModifyListener( lsMod );
+ fdAltRecordTerm.left = new FormAttachment(middle, 0);
+ fdAltRecordTerm.top = new FormAttachment(wCharacterSetName, margin);
+ fdAltRecordTerm.right = new FormAttachment(100, 0);
+ wAltRecordTerm.setLayoutData(fdAltRecordTerm);
+ wAltRecordTerm.addModifyListener(lsMod);
// DirectPath line
- Label wlDirectPath = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlDirectPath.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.DirectPath.Label" ) );
- PropsUi.setLook( wlDirectPath );
+ Label wlDirectPath = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlDirectPath.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.DirectPath.Label"));
+ PropsUi.setLook(wlDirectPath);
FormData fdlDirectPath = new FormData();
- fdlDirectPath.left = new FormAttachment( 0, 0 );
- fdlDirectPath.top = new FormAttachment( wAltRecordTerm, margin );
- fdlDirectPath.right = new FormAttachment( middle, -margin );
- wlDirectPath.setLayoutData( fdlDirectPath );
- wDirectPath = new Button( wBulkLoaderComposite, SWT.CHECK );
- PropsUi.setLook( wDirectPath );
+ fdlDirectPath.left = new FormAttachment(0, 0);
+ fdlDirectPath.top = new FormAttachment(wAltRecordTerm, margin);
+ fdlDirectPath.right = new FormAttachment(middle, -margin);
+ wlDirectPath.setLayoutData(fdlDirectPath);
+ wDirectPath = new Button(wBulkLoaderComposite, SWT.CHECK);
+ PropsUi.setLook(wDirectPath);
FormData fdDirectPath = new FormData();
- fdDirectPath.left = new FormAttachment( middle, 0 );
- fdDirectPath.top = new FormAttachment( wAltRecordTerm, margin );
- fdDirectPath.right = new FormAttachment( 100, 0 );
- wDirectPath.setLayoutData( fdDirectPath );
- wDirectPath.addListener(SWT.Selection, e -> {
- input.setChanged();
- // Parallel loading is only possible with a direct path option...
- //
- if ( !wDirectPath.getSelection() ) {
- wParallel.setSelection( false );
- }
- wParallel.setEnabled(wDirectPath.getSelection());
- });
+ fdDirectPath.left = new FormAttachment(middle, 0);
+ fdDirectPath.top = new FormAttachment(wAltRecordTerm, margin);
+ fdDirectPath.right = new FormAttachment(100, 0);
+ wDirectPath.setLayoutData(fdDirectPath);
+ wDirectPath.addListener(
+ SWT.Selection,
+ e -> {
+ input.setChanged();
+ // Parallel loading is only possible with a direct path option...
+ //
+ if (!wDirectPath.getSelection()) {
+ wParallel.setSelection(false);
+ }
+ wParallel.setEnabled(wDirectPath.getSelection());
+ });
// Erase files line
- Label wlEraseFiles = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlEraseFiles.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.EraseFiles.Label" ) );
- PropsUi.setLook( wlEraseFiles );
+ Label wlEraseFiles = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlEraseFiles.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.EraseFiles.Label"));
+ PropsUi.setLook(wlEraseFiles);
FormData fdlEraseFiles = new FormData();
- fdlEraseFiles.left = new FormAttachment( 0, 0 );
- fdlEraseFiles.top = new FormAttachment( wDirectPath, margin );
- fdlEraseFiles.right = new FormAttachment( middle, -margin );
- wlEraseFiles.setLayoutData( fdlEraseFiles );
- wEraseFiles = new Button( wBulkLoaderComposite, SWT.CHECK );
- PropsUi.setLook( wEraseFiles );
+ fdlEraseFiles.left = new FormAttachment(0, 0);
+ fdlEraseFiles.top = new FormAttachment(wDirectPath, margin);
+ fdlEraseFiles.right = new FormAttachment(middle, -margin);
+ wlEraseFiles.setLayoutData(fdlEraseFiles);
+ wEraseFiles = new Button(wBulkLoaderComposite, SWT.CHECK);
+ PropsUi.setLook(wEraseFiles);
FormData fdEraseFiles = new FormData();
- fdEraseFiles.left = new FormAttachment( middle, 0 );
- fdEraseFiles.top = new FormAttachment( wDirectPath, margin );
- fdEraseFiles.right = new FormAttachment( 100, 0 );
- wEraseFiles.setLayoutData( fdEraseFiles );
- wEraseFiles.addListener( SWT.Selection, e -> input.setChanged());
+ fdEraseFiles.left = new FormAttachment(middle, 0);
+ fdEraseFiles.top = new FormAttachment(wDirectPath, margin);
+ fdEraseFiles.right = new FormAttachment(100, 0);
+ wEraseFiles.setLayoutData(fdEraseFiles);
+ wEraseFiles.addListener(SWT.Selection, e -> input.setChanged());
// Fail on warning line
- Label wlFailOnWarning = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlFailOnWarning.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.FailOnWarning.Label" ) );
- PropsUi.setLook( wlFailOnWarning );
+ Label wlFailOnWarning = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlFailOnWarning.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.FailOnWarning.Label"));
+ PropsUi.setLook(wlFailOnWarning);
FormData fdlFailOnWarning = new FormData();
- fdlFailOnWarning.left = new FormAttachment( 0, 0 );
- fdlFailOnWarning.top = new FormAttachment( wEraseFiles, margin );
- fdlFailOnWarning.right = new FormAttachment( middle, -margin );
- wlFailOnWarning.setLayoutData( fdlFailOnWarning );
- wFailOnWarning = new Button( wBulkLoaderComposite, SWT.CHECK );
- PropsUi.setLook( wFailOnWarning );
+ fdlFailOnWarning.left = new FormAttachment(0, 0);
+ fdlFailOnWarning.top = new FormAttachment(wEraseFiles, margin);
+ fdlFailOnWarning.right = new FormAttachment(middle, -margin);
+ wlFailOnWarning.setLayoutData(fdlFailOnWarning);
+ wFailOnWarning = new Button(wBulkLoaderComposite, SWT.CHECK);
+ PropsUi.setLook(wFailOnWarning);
FormData fdFailOnWarning = new FormData();
- fdFailOnWarning.left = new FormAttachment( middle, 0 );
- fdFailOnWarning.top = new FormAttachment( wEraseFiles, margin );
- fdFailOnWarning.right = new FormAttachment( 100, 0 );
- wFailOnWarning.setLayoutData( fdFailOnWarning );
- wFailOnWarning.addListener( SWT.Selection, e -> input.setChanged());
+ fdFailOnWarning.left = new FormAttachment(middle, 0);
+ fdFailOnWarning.top = new FormAttachment(wEraseFiles, margin);
+ fdFailOnWarning.right = new FormAttachment(100, 0);
+ wFailOnWarning.setLayoutData(fdFailOnWarning);
+ wFailOnWarning.addListener(SWT.Selection, e -> input.setChanged());
// Fail on error line
- Label wlFailOnError = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlFailOnError.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.FailOnError.Label" ) );
- PropsUi.setLook( wlFailOnError );
+ Label wlFailOnError = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlFailOnError.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.FailOnError.Label"));
+ PropsUi.setLook(wlFailOnError);
FormData fdlFailOnError = new FormData();
- fdlFailOnError.left = new FormAttachment( 0, 0 );
- fdlFailOnError.top = new FormAttachment( wFailOnWarning, margin );
- fdlFailOnError.right = new FormAttachment( middle, -margin );
- wlFailOnError.setLayoutData( fdlFailOnError );
- wFailOnError = new Button( wBulkLoaderComposite, SWT.CHECK );
- PropsUi.setLook( wFailOnError );
+ fdlFailOnError.left = new FormAttachment(0, 0);
+ fdlFailOnError.top = new FormAttachment(wFailOnWarning, margin);
+ fdlFailOnError.right = new FormAttachment(middle, -margin);
+ wlFailOnError.setLayoutData(fdlFailOnError);
+ wFailOnError = new Button(wBulkLoaderComposite, SWT.CHECK);
+ PropsUi.setLook(wFailOnError);
FormData fdFailOnError = new FormData();
- fdFailOnError.left = new FormAttachment( middle, 0 );
- fdFailOnError.top = new FormAttachment( wFailOnWarning, margin );
- fdFailOnError.right = new FormAttachment( 100, 0 );
- wFailOnError.setLayoutData( fdFailOnError );
- wFailOnError.addListener( SWT.Selection, e -> input.setChanged());
+ fdFailOnError.left = new FormAttachment(middle, 0);
+ fdFailOnError.top = new FormAttachment(wFailOnWarning, margin);
+ fdFailOnError.right = new FormAttachment(100, 0);
+ wFailOnError.setLayoutData(fdFailOnError);
+ wFailOnError.addListener(SWT.Selection, e -> input.setChanged());
// Fail on error line
- Label wlParallel = new Label( wBulkLoaderComposite, SWT.RIGHT );
- wlParallel.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Parallel.Label" ) );
- PropsUi.setLook( wlParallel );
+ Label wlParallel = new Label(wBulkLoaderComposite, SWT.RIGHT);
+ wlParallel.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Parallel.Label"));
+ PropsUi.setLook(wlParallel);
FormData fdlParallel = new FormData();
- fdlParallel.left = new FormAttachment( 0, 0 );
- fdlParallel.top = new FormAttachment( wFailOnError, margin );
- fdlParallel.right = new FormAttachment( middle, -margin );
- wlParallel.setLayoutData( fdlParallel );
- wParallel = new Button( wBulkLoaderComposite, SWT.CHECK );
- PropsUi.setLook( wParallel );
+ fdlParallel.left = new FormAttachment(0, 0);
+ fdlParallel.top = new FormAttachment(wFailOnError, margin);
+ fdlParallel.right = new FormAttachment(middle, -margin);
+ wlParallel.setLayoutData(fdlParallel);
+ wParallel = new Button(wBulkLoaderComposite, SWT.CHECK);
+ PropsUi.setLook(wParallel);
FormData fdParallel = new FormData();
- fdParallel.left = new FormAttachment( middle, 0 );
- fdParallel.top = new FormAttachment( wFailOnError, margin );
- fdParallel.right = new FormAttachment( 100, 0 );
- wParallel.setLayoutData( fdParallel );
- wParallel.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- input.setChanged();
- // Parallel loading is only possible with a direct path option...
- //
- if ( wParallel.getSelection() ) {
- wDirectPath.setSelection( true );
- }
- }
- } );
-
+ fdParallel.left = new FormAttachment(middle, 0);
+ fdParallel.top = new FormAttachment(wFailOnError, margin);
+ fdParallel.right = new FormAttachment(100, 0);
+ wParallel.setLayoutData(fdParallel);
+ wParallel.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ input.setChanged();
+ // Parallel loading is only possible with a direct path option...
+ //
+ if (wParallel.getSelection()) {
+ wDirectPath.setSelection(true);
+ }
+ }
+ });
+
CTabItem wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
wFieldsTab.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Fields.Label"));
-
+
Composite wFieldsComposite = new Composite(wTabFolder, SWT.NONE);
PropsUi.setLook(wFieldsComposite);
@@ -748,174 +744,202 @@
fdDataComp.right = new FormAttachment(100, 0);
fdDataComp.bottom = new FormAttachment(100, 0);
wFieldsComposite.setLayoutData(fdDataComp);
-
- int UpInsCols = 3;
- int UpInsRows = ( input.getMappings() != null ? input.getMappings().size() : 1 );
- ciReturn = new ColumnInfo[UpInsCols];
+ int upInsCols = 3;
+ int upInsRows = (input.getMappings() != null ? input.getMappings().size() : 1);
+
+ ciReturn = new ColumnInfo[upInsCols];
ciReturn[0] =
- new ColumnInfo(
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.ColumnInfo.TableField" ),
- ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false );
+ new ColumnInfo(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.ColumnInfo.TableField"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ new String[] {""},
+ false);
ciReturn[1] =
- new ColumnInfo(
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.ColumnInfo.StreamField" ),
- ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false );
+ new ColumnInfo(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.ColumnInfo.StreamField"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ new String[] {""},
+ false);
ciReturn[2] =
- new ColumnInfo(
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.ColumnInfo.DateMask" ),
- ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] {
- "", BaseMessages.getString( PKG, "OraBulkLoaderDialog.DateMask.Label" ),
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.DateTimeMask.Label" ) }, true );
- tableFieldColumns.add( ciReturn[0] );
+ new ColumnInfo(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.ColumnInfo.DateMask"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ new String[] {
+ "",
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateMask.Label"),
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateTimeMask.Label")
+ },
+ true);
+ tableFieldColumns.add(ciReturn[0]);
wReturn =
- new TableView(
- variables, wFieldsComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciReturn,
- UpInsRows, lsMod, props );
+ new TableView(
+ variables,
+ wFieldsComposite,
+ SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL,
+ ciReturn,
+ upInsRows,
+ lsMod,
+ props);
- Button wGetLU = new Button( wFieldsComposite, SWT.PUSH );
- wGetLU.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.GetFields.Label" ) );
- wGetLU.addListener( SWT.Selection, e -> getUpdate() );
+ Button wGetLU = new Button(wFieldsComposite, SWT.PUSH);
+ wGetLU.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.GetFields.Label"));
+ wGetLU.addListener(SWT.Selection, e -> getUpdate());
FormData fdGetLU = new FormData();
- fdGetLU.top = new FormAttachment( 0, 0 );
- fdGetLU.right = new FormAttachment( 100, 0 );
- fdGetLU.left = new FormAttachment( wReturn, margin );
- wGetLU.setLayoutData( fdGetLU );
+ fdGetLU.top = new FormAttachment(0, 0);
+ fdGetLU.right = new FormAttachment(100, 0);
+ fdGetLU.left = new FormAttachment(wReturn, margin);
+ wGetLU.setLayoutData(fdGetLU);
- Button wDoMapping = new Button( wFieldsComposite, SWT.PUSH );
- wDoMapping.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.EditMapping.Label" ) );
+ Button wDoMapping = new Button(wFieldsComposite, SWT.PUSH);
+ wDoMapping.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.EditMapping.Label"));
FormData fdDoMapping = new FormData();
- fdDoMapping.top = new FormAttachment( wGetLU, margin );
- fdDoMapping.right = new FormAttachment( 100, 0 );
- wDoMapping.setLayoutData( fdDoMapping );
- wDoMapping.addListener( SWT.Selection, e -> generateMappings());
+ fdDoMapping.top = new FormAttachment(wGetLU, margin);
+ fdDoMapping.right = new FormAttachment(100, 0);
+ wDoMapping.setLayoutData(fdDoMapping);
+ wDoMapping.addListener(SWT.Selection, e -> generateMappings());
FormData fdReturn = new FormData();
- fdReturn.left = new FormAttachment( 0, 0 );
- fdReturn.top = new FormAttachment( 0, 0 );
- fdReturn.right = new FormAttachment( wDoMapping, -margin );
- fdReturn.bottom = new FormAttachment(100, 0 );
- wReturn.setLayoutData( fdReturn );
-
+ fdReturn.left = new FormAttachment(0, 0);
+ fdReturn.top = new FormAttachment(0, 0);
+ fdReturn.right = new FormAttachment(wDoMapping, -margin);
+ fdReturn.bottom = new FormAttachment(100, 0);
+ wReturn.setLayoutData(fdReturn);
wBulkLoaderTab.setControl(wBulkLoaderComposite);
wFieldsTab.setControl(wFieldsComposite);
-
+
//
// Search the fields in the background
//
- final Runnable runnable = new Runnable() {
- public void run() {
- TransformMeta transformMeta = pipelineMeta.findTransform( transformName );
- if ( transformMeta != null ) {
- try {
- IRowMeta row = pipelineMeta.getPrevTransformFields( variables, transformMeta );
+ final Runnable runnable =
+ () -> {
+ TransformMeta transformMeta = pipelineMeta.findTransform(transformName);
+ if (transformMeta != null) {
+ try {
+ IRowMeta row = pipelineMeta.getPrevTransformFields(variables, transformMeta);
- // Remember these fields...
- for ( int i = 0; i < row.size(); i++ ) {
- inputFields.add(row.getValueMeta(i).getName());
+ // Remember these fields...
+ for (int i = 0; i < row.size(); i++) {
+ inputFields.add(row.getValueMeta(i).getName());
+ }
+
+ setComboBoxes();
+ } catch (HopException e) {
+ logError(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
}
-
- setComboBoxes();
- } catch ( HopException e ) {
- logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ) );
}
- }
- }
- };
- new Thread( runnable ).start();
+ };
+ new Thread(runnable).start();
- wbSqlldr.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- FileDialog dialog = new FileDialog( shell, SWT.OPEN );
- dialog.setFilterExtensions( new String[] { "*" } );
- if ( wSqlldr.getText() != null ) {
- dialog.setFileName( wSqlldr.getText() );
- }
- dialog.setFilterNames( ALL_FILETYPES );
- if ( dialog.open() != null ) {
- wSqlldr.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
- }
- }
- } );
+ wbSqlldr.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] {"*"});
+ if (wSqlldr.getText() != null) {
+ dialog.setFileName(wSqlldr.getText());
+ }
+ dialog.setFilterNames(ALL_FILETYPES);
+ if (dialog.open() != null) {
+ wSqlldr.setText(dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
+ }
+ }
+ });
- wbControlFile.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- FileDialog dialog = new FileDialog( shell, SWT.OPEN );
- dialog.setFilterExtensions( new String[] { "*" } );
- if ( wControlFile.getText() != null ) {
- dialog.setFileName( wControlFile.getText() );
- }
- dialog.setFilterNames( ALL_FILETYPES );
- if ( dialog.open() != null ) {
- wControlFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
- }
- }
- } );
+ wbControlFile.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] {"*"});
+ if (wControlFile.getText() != null) {
+ dialog.setFileName(wControlFile.getText());
+ }
+ dialog.setFilterNames(ALL_FILETYPES);
+ if (dialog.open() != null) {
+ wControlFile.setText(
+ dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
+ }
+ }
+ });
- wbDataFile.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- FileDialog dialog = new FileDialog( shell, SWT.OPEN );
- dialog.setFilterExtensions( new String[] { "*" } );
- if ( wDataFile.getText() != null ) {
- dialog.setFileName( wDataFile.getText() );
- }
- dialog.setFilterNames( ALL_FILETYPES );
- if ( dialog.open() != null ) {
- wDataFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
- }
- }
- } );
+ wbDataFile.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] {"*"});
+ if (wDataFile.getText() != null) {
+ dialog.setFileName(wDataFile.getText());
+ }
+ dialog.setFilterNames(ALL_FILETYPES);
+ if (dialog.open() != null) {
+ wDataFile.setText(
+ dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
+ }
+ }
+ });
- wbLogFile.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- FileDialog dialog = new FileDialog( shell, SWT.OPEN );
- dialog.setFilterExtensions( new String[] { "*" } );
- if ( wLogFile.getText() != null ) {
- dialog.setFileName( wLogFile.getText() );
- }
- dialog.setFilterNames( ALL_FILETYPES );
- if ( dialog.open() != null ) {
- wLogFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
- }
- }
- } );
+ wbLogFile.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] {"*"});
+ if (wLogFile.getText() != null) {
+ dialog.setFileName(wLogFile.getText());
+ }
+ dialog.setFilterNames(ALL_FILETYPES);
+ if (dialog.open() != null) {
+ wLogFile.setText(
+ dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
+ }
+ }
+ });
- wbBadFile.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- FileDialog dialog = new FileDialog( shell, SWT.OPEN );
- dialog.setFilterExtensions( new String[] { "*" } );
- if ( wBadFile.getText() != null ) {
- dialog.setFileName( wBadFile.getText() );
- }
- dialog.setFilterNames( ALL_FILETYPES );
- if ( dialog.open() != null ) {
- wBadFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
- }
- }
- } );
+ wbBadFile.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] {"*"});
+ if (wBadFile.getText() != null) {
+ dialog.setFileName(wBadFile.getText());
+ }
+ dialog.setFilterNames(ALL_FILETYPES);
+ if (dialog.open() != null) {
+ wBadFile.setText(
+ dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
+ }
+ }
+ });
- wbDiscardFile.addSelectionListener( new SelectionAdapter() {
- public void widgetSelected( SelectionEvent e ) {
- FileDialog dialog = new FileDialog( shell, SWT.OPEN );
- dialog.setFilterExtensions( new String[] { "*" } );
- if ( wDiscardFile.getText() != null ) {
- dialog.setFileName( wDiscardFile.getText() );
- }
- dialog.setFilterNames( ALL_FILETYPES );
- if ( dialog.open() != null ) {
- wDiscardFile.setText( dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName() );
- }
- }
- } );
+ wbDiscardFile.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] {"*"});
+ if (wDiscardFile.getText() != null) {
+ dialog.setFileName(wDiscardFile.getText());
+ }
+ dialog.setFilterNames(ALL_FILETYPES);
+ if (dialog.open() != null) {
+ wDiscardFile.setText(
+ dialog.getFilterPath() + Const.FILE_SEPARATOR + dialog.getFileName());
+ }
+ }
+ });
getData();
wTabFolder.setSelection(0);
setTableFieldCombo();
- input.setChanged( changed );
+ input.setChanged(changed);
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
-
+
return transformName;
}
@@ -923,175 +947,173 @@
// Something was changed in the row.
//
String[] fieldNames = ConstUi.sortFieldNames(inputFields);
- ciReturn[1].setComboValues( fieldNames );
+ ciReturn[1].setComboValues(fieldNames);
}
private void setTableFieldCombo() {
- Runnable fieldLoader = new Runnable() {
- public void run() {
- if ( !wTable.isDisposed() && !wConnection.isDisposed() && !wSchema.isDisposed() ) {
- final String tableName = wTable.getText(), connectionName = wConnection.getText(), schemaName =
- wSchema.getText();
+ Runnable fieldLoader =
+ () -> {
+ if (!wTable.isDisposed() && !wConnection.isDisposed() && !wSchema.isDisposed()) {
+ final String tableName = wTable.getText(),
+ connectionName = wConnection.getText(),
+ schemaName = wSchema.getText();
- // clear
- for ( ColumnInfo colInfo : tableFieldColumns ) {
- colInfo.setComboValues( new String[] {} );
- }
- if ( !Utils.isEmpty( tableName ) ) {
- DatabaseMeta databaseMeta = pipelineMeta.findDatabase( connectionName, variables );
- if ( databaseMeta != null ) {
- Database db = new Database(loggingObject, variables, databaseMeta);
-
- try {
- db.connect();
+ // clear
+ for (ColumnInfo colInfo : tableFieldColumns) {
+ colInfo.setComboValues(new String[] {});
+ }
+ if (!Utils.isEmpty(tableName)) {
+ DatabaseMeta databaseMeta = pipelineMeta.findDatabase(connectionName, variables);
+ if (databaseMeta != null) {
+ Database db = new Database(loggingObject, variables, databaseMeta);
- String schemaTable =
- databaseMeta.getQuotedSchemaTableCombination(
- variables, schemaName, tableName);
- IRowMeta rowMeta = db.getTableFields( schemaTable );
- if ( null != rowMeta ) {
- String[] fieldNames = rowMeta.getFieldNames();
- if ( null != fieldNames ) {
- for ( ColumnInfo colInfo : tableFieldColumns ) {
- colInfo.setComboValues( fieldNames );
+ try {
+ db.connect();
+
+ String schemaTable =
+ databaseMeta.getQuotedSchemaTableCombination(
+ variables, schemaName, tableName);
+ IRowMeta rowMeta = db.getTableFields(schemaTable);
+ if (null != rowMeta) {
+ String[] fieldNames = rowMeta.getFieldNames();
+ if (null != fieldNames) {
+ for (ColumnInfo colInfo : tableFieldColumns) {
+ colInfo.setComboValues(fieldNames);
+ }
}
}
- }
- } catch ( Exception e ) {
- for ( ColumnInfo colInfo : tableFieldColumns ) {
- colInfo.setComboValues( new String[] {} );
- }
- // ignore any errors here. drop downs will not be
- // filled, but no problem for the user
- } finally {
- try {
- if ( db != null ) {
- db.disconnect();
+ } catch (Exception e) {
+ for (ColumnInfo colInfo : tableFieldColumns) {
+ colInfo.setComboValues(new String[] {});
}
- } catch ( Exception ignored ) {
- // ignore any errors here.
- db = null;
+ // ignore any errors here. drop downs will not be
+ // filled, but no problem for the user
+ } finally {
+ try {
+ if (db != null) {
+ db.disconnect();
+ }
+ } catch (Exception ignored) {
+ // ignore any errors here.
+ db = null;
+ }
}
}
}
}
- }
- }
- };
- shell.getDisplay().asyncExec( fieldLoader );
+ };
+ shell.getDisplay().asyncExec(fieldLoader);
}
- /**
- * Copy information from the meta-data input to the dialog fields.
- */
+ /** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if ( log.isDebug() ) {
- logDebug( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Log.GettingKeyInfo" ) );
+ if (log.isDebug()) {
+ logDebug(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Log.GettingKeyInfo"));
}
- wMaxErrors.setText( "" + input.getMaxErrors() );
- wCommit.setText( "" + input.getCommitSize() );
- wBindSize.setText( "" + input.getBindSize() );
- wReadSize.setText( "" + input.getReadSize() );
+ wMaxErrors.setText("" + input.getMaxErrors());
+ wCommit.setText("" + input.getCommitSize());
+ wBindSize.setText("" + input.getBindSize());
+ wReadSize.setText("" + input.getReadSize());
for (int i = 0; i < input.getMappings().size(); i++) {
- TableItem item = wReturn.table.getItem( i );
+ TableItem item = wReturn.table.getItem(i);
OraBulkLoaderMappingMeta mapping = input.getMappings().get(i);
-
- if ( mapping.getFieldTable() != null ) {
- item.setText( 1, mapping.getFieldTable() );
+
+ if (mapping.getFieldTable() != null) {
+ item.setText(1, mapping.getFieldTable());
}
- if ( mapping.getFieldStream() != null ) {
- item.setText( 2, mapping.getFieldStream() );
+ if (mapping.getFieldStream() != null) {
+ item.setText(2, mapping.getFieldStream());
}
String dateMask = mapping.getDateMask();
- if ( dateMask != null ) {
- if ( OraBulkLoaderMeta.DATE_MASK_DATE.equals( dateMask ) ) {
- item.setText( 3, BaseMessages.getString( PKG, "OraBulkLoaderDialog.DateMask.Label" ) );
- } else if ( OraBulkLoaderMeta.DATE_MASK_DATETIME.equals( dateMask ) ) {
- item.setText( 3, BaseMessages.getString( PKG, "OraBulkLoaderDialog.DateTimeMask.Label" ) );
+ if (dateMask != null) {
+ if (OraBulkLoaderMeta.DATE_MASK_DATE.equals(dateMask)) {
+ item.setText(3, BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateMask.Label"));
+ } else if (OraBulkLoaderMeta.DATE_MASK_DATETIME.equals(dateMask)) {
+ item.setText(3, BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateTimeMask.Label"));
} else {
- item.setText( 3, "" );
+ item.setText(3, "");
}
} else {
- item.setText( 3, "" );
+ item.setText(3, "");
}
- }
+ }
if (input.getDatabaseMeta() != null) {
wConnection.setText(input.getDatabaseMeta().getName());
}
- if ( input.getSchemaName() != null ) {
- wSchema.setText( input.getSchemaName() );
+ if (input.getSchemaName() != null) {
+ wSchema.setText(input.getSchemaName());
}
- if ( input.getTableName() != null ) {
- wTable.setText( input.getTableName() );
+ if (input.getTableName() != null) {
+ wTable.setText(input.getTableName());
}
- if ( input.getSqlldr() != null ) {
- wSqlldr.setText( input.getSqlldr() );
+ if (input.getSqlldr() != null) {
+ wSqlldr.setText(input.getSqlldr());
}
- if ( input.getControlFile() != null ) {
- wControlFile.setText( input.getControlFile() );
+ if (input.getControlFile() != null) {
+ wControlFile.setText(input.getControlFile());
}
- if ( input.getDataFile() != null ) {
- wDataFile.setText( input.getDataFile() );
+ if (input.getDataFile() != null) {
+ wDataFile.setText(input.getDataFile());
}
- if ( input.getLogFile() != null ) {
- wLogFile.setText( input.getLogFile() );
+ if (input.getLogFile() != null) {
+ wLogFile.setText(input.getLogFile());
}
- if ( input.getBadFile() != null ) {
- wBadFile.setText( input.getBadFile() );
+ if (input.getBadFile() != null) {
+ wBadFile.setText(input.getBadFile());
}
- if ( input.getDiscardFile() != null ) {
- wDiscardFile.setText( input.getDiscardFile() );
+ if (input.getDiscardFile() != null) {
+ wDiscardFile.setText(input.getDiscardFile());
}
- if ( input.getEncoding() != null ) {
- wEncoding.setText( input.getEncoding() );
+ if (input.getEncoding() != null) {
+ wEncoding.setText(input.getEncoding());
}
- if ( input.getCharacterSetName() != null ) {
- wCharacterSetName.setText( input.getCharacterSetName() );
+ if (input.getCharacterSetName() != null) {
+ wCharacterSetName.setText(input.getCharacterSetName());
}
- if ( input.getAltRecordTerm() != null ) {
- wAltRecordTerm.setText( input.getAltRecordTerm() );
+ if (input.getAltRecordTerm() != null) {
+ wAltRecordTerm.setText(input.getAltRecordTerm());
}
- wDirectPath.setSelection( input.isDirectPath() );
- wEraseFiles.setSelection( input.isEraseFiles() );
- wFailOnError.setSelection( input.isFailOnError() );
- wParallel.setSelection( input.isParallel() );
- wFailOnWarning.setSelection( input.isFailOnWarning() );
+ wDirectPath.setSelection(input.isDirectPath());
+ wEraseFiles.setSelection(input.isEraseFiles());
+ wFailOnError.setSelection(input.isFailOnError());
+ wParallel.setSelection(input.isParallel());
+ wFailOnWarning.setSelection(input.isFailOnWarning());
String method = input.getLoadMethod();
- if ( OraBulkLoaderMeta.METHOD_AUTO_END.equals( method ) ) {
- wLoadMethod.select( 0 );
- } else if ( OraBulkLoaderMeta.METHOD_MANUAL.equals( method ) ) {
- wLoadMethod.select( 1 );
- } else if ( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals( method ) ) {
- wLoadMethod.select( 2 );
+ if (OraBulkLoaderMeta.METHOD_AUTO_END.equals(method)) {
+ wLoadMethod.select(0);
+ } else if (OraBulkLoaderMeta.METHOD_MANUAL.equals(method)) {
+ wLoadMethod.select(1);
+ } else if (OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT.equals(method)) {
+ wLoadMethod.select(2);
} else {
- if ( log.isDebug() ) {
- logDebug( "Internal error: load_method set to default 'auto at end'" );
+ if (log.isDebug()) {
+ logDebug("Internal error: load_method set to default 'auto at end'");
}
- wLoadMethod.select( 0 );
+ wLoadMethod.select(0);
}
String action = input.getLoadAction();
- if ( OraBulkLoaderMeta.ACTION_APPEND.equals( action ) ) {
- wLoadAction.select( 0 );
- } else if ( OraBulkLoaderMeta.ACTION_INSERT.equals( action ) ) {
- wLoadAction.select( 1 );
- } else if ( OraBulkLoaderMeta.ACTION_REPLACE.equals( action ) ) {
- wLoadAction.select( 2 );
- } else if ( OraBulkLoaderMeta.ACTION_TRUNCATE.equals( action ) ) {
- wLoadAction.select( 3 );
+ if (OraBulkLoaderMeta.ACTION_APPEND.equals(action)) {
+ wLoadAction.select(0);
+ } else if (OraBulkLoaderMeta.ACTION_INSERT.equals(action)) {
+ wLoadAction.select(1);
+ } else if (OraBulkLoaderMeta.ACTION_REPLACE.equals(action)) {
+ wLoadAction.select(2);
+ } else if (OraBulkLoaderMeta.ACTION_TRUNCATE.equals(action)) {
+ wLoadAction.select(3);
} else {
- if ( log.isDebug() ) {
- logDebug( "Internal error: load_action set to default 'append'" );
+ if (log.isDebug()) {
+ logDebug("Internal error: load_action set to default 'append'");
}
- wLoadAction.select( 0 );
+ wLoadAction.select(0);
}
wReturn.setRowNums();
- wReturn.optWidth( true );
+ wReturn.optWidth(true);
wTransformName.selectAll();
wTransformName.setFocus();
@@ -1099,109 +1121,121 @@
private void cancel() {
transformName = null;
- input.setChanged( changed );
+ input.setChanged(changed);
dispose();
}
- private void getInfo( OraBulkLoaderMeta meta ) {
- meta.setMaxErrors( wMaxErrors.getText() );
- meta.setCommitSize( wCommit.getText() );
- meta.setBindSize( wBindSize.getText() );
- meta.setReadSize( wReadSize.getText() );
+ private void getInfo(OraBulkLoaderMeta meta) {
+ meta.setMaxErrors(wMaxErrors.getText());
+ meta.setCommitSize(wCommit.getText());
+ meta.setBindSize(wBindSize.getText());
+ meta.setReadSize(wReadSize.getText());
int nrfields = wReturn.nrNonEmpty();
- if ( log.isDebug() ) {
- logDebug( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Log.FoundFields", "" + nrfields ) );
+ if (log.isDebug()) {
+ logDebug(BaseMessages.getString(PKG, "OraBulkLoaderDialog.Log.FoundFields", "" + nrfields));
}
List<OraBulkLoaderMappingMeta> mappings = new ArrayList<>();
- for ( int i = 0; i < nrfields; i++ ) {
+ for (int i = 0; i < nrfields; i++) {
OraBulkLoaderMappingMeta mapping = new OraBulkLoaderMappingMeta();
-
- TableItem item = wReturn.getNonEmpty( i );
- mapping.setFieldTable(item.getText( 1 ));
- mapping.setFieldStream(item.getText( 2 ));
- if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.DateMask.Label" ).equals( item.getText( 3 ) ) ) {
+ TableItem item = wReturn.getNonEmpty(i);
+ mapping.setFieldTable(item.getText(1));
+ mapping.setFieldStream(item.getText(2));
+
+ if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateMask.Label")
+ .equals(item.getText(3))) {
mapping.setDateMask(OraBulkLoaderMeta.DATE_MASK_DATE);
- } else if ( BaseMessages
- .getString( PKG, "OraBulkLoaderDialog.DateTimeMask.Label" ).equals( item.getText( 3 ) ) ) {
+ } else if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateTimeMask.Label")
+ .equals(item.getText(3))) {
mapping.setDateMask(OraBulkLoaderMeta.DATE_MASK_DATETIME);
}
-
+
mappings.add(mapping);
}
-
+
meta.setMappings(mappings);
- meta.setSchemaName( wSchema.getText() );
- meta.setTableName( wTable.getText() );
- meta.setDatabaseMeta( pipelineMeta.findDatabase( wConnection.getText(), variables ) );
- meta.setSqlldr( wSqlldr.getText() );
- meta.setControlFile( wControlFile.getText() );
- meta.setDataFile( wDataFile.getText() );
- meta.setLogFile( wLogFile.getText() );
- meta.setBadFile( wBadFile.getText() );
- meta.setDiscardFile( wDiscardFile.getText() );
- meta.setEncoding( wEncoding.getText() );
- meta.setCharacterSetName( wCharacterSetName.getText() );
- meta.setAltRecordTerm( wAltRecordTerm.getText() );
- meta.setDirectPath( wDirectPath.getSelection() );
- meta.setEraseFiles( wEraseFiles.getSelection() );
- meta.setFailOnError( wFailOnError.getSelection() );
- meta.setParallel( wParallel.getSelection() );
- meta.setFailOnWarning( wFailOnWarning.getSelection() );
+ meta.setSchemaName(wSchema.getText());
+ meta.setTableName(wTable.getText());
+ meta.setDatabaseMeta(pipelineMeta.findDatabase(wConnection.getText(), variables));
+ meta.setSqlldr(wSqlldr.getText());
+ meta.setControlFile(wControlFile.getText());
+ meta.setDataFile(wDataFile.getText());
+ meta.setLogFile(wLogFile.getText());
+ meta.setBadFile(wBadFile.getText());
+ meta.setDiscardFile(wDiscardFile.getText());
+ meta.setEncoding(wEncoding.getText());
+ meta.setCharacterSetName(wCharacterSetName.getText());
+ meta.setAltRecordTerm(wAltRecordTerm.getText());
+ meta.setDirectPath(wDirectPath.getSelection());
+ meta.setEraseFiles(wEraseFiles.getSelection());
+ meta.setFailOnError(wFailOnError.getSelection());
+ meta.setParallel(wParallel.getSelection());
+ meta.setFailOnWarning(wFailOnWarning.getSelection());
/*
* Set the load method
*/
String method = wLoadMethod.getText();
- if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AutoConcLoadMethod.Label" ).equals( method ) ) {
- meta.setLoadMethod( OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT );
- } else if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AutoEndLoadMethod.Label" ).equals( method ) ) {
- meta.setLoadMethod( OraBulkLoaderMeta.METHOD_AUTO_END );
- } else if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.ManualLoadMethod.Label" ).equals( method ) ) {
- meta.setLoadMethod( OraBulkLoaderMeta.METHOD_MANUAL );
+ if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.AutoConcLoadMethod.Label")
+ .equals(method)) {
+ meta.setLoadMethod(OraBulkLoaderMeta.METHOD_AUTO_CONCURRENT);
+ } else if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.AutoEndLoadMethod.Label")
+ .equals(method)) {
+ meta.setLoadMethod(OraBulkLoaderMeta.METHOD_AUTO_END);
+ } else if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.ManualLoadMethod.Label")
+ .equals(method)) {
+ meta.setLoadMethod(OraBulkLoaderMeta.METHOD_MANUAL);
} else {
- if ( log.isDebug() ) {
- logDebug( "Internal error: load_method set to default 'auto concurrent', value found '" + method + "'." );
+ if (log.isDebug()) {
+ logDebug(
+ "Internal error: load_method set to default 'auto concurrent', value found '"
+ + method
+ + "'.");
}
- meta.setLoadMethod( OraBulkLoaderMeta.METHOD_AUTO_END );
+ meta.setLoadMethod(OraBulkLoaderMeta.METHOD_AUTO_END);
}
/*
* Set the load action
*/
String action = wLoadAction.getText();
- if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.AppendLoadAction.Label" ).equals( action ) ) {
- meta.setLoadAction( OraBulkLoaderMeta.ACTION_APPEND );
- } else if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InsertLoadAction.Label" ).equals( action ) ) {
- meta.setLoadAction( OraBulkLoaderMeta.ACTION_INSERT );
- } else if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.ReplaceLoadAction.Label" ).equals( action ) ) {
- meta.setLoadAction( OraBulkLoaderMeta.ACTION_REPLACE );
- } else if ( BaseMessages.getString( PKG, "OraBulkLoaderDialog.TruncateLoadAction.Label" ).equals( action ) ) {
- meta.setLoadAction( OraBulkLoaderMeta.ACTION_TRUNCATE );
+ if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.AppendLoadAction.Label").equals(action)) {
+ meta.setLoadAction(OraBulkLoaderMeta.ACTION_APPEND);
+ } else if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.InsertLoadAction.Label")
+ .equals(action)) {
+ meta.setLoadAction(OraBulkLoaderMeta.ACTION_INSERT);
+ } else if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.ReplaceLoadAction.Label")
+ .equals(action)) {
+ meta.setLoadAction(OraBulkLoaderMeta.ACTION_REPLACE);
+ } else if (BaseMessages.getString(PKG, "OraBulkLoaderDialog.TruncateLoadAction.Label")
+ .equals(action)) {
+ meta.setLoadAction(OraBulkLoaderMeta.ACTION_TRUNCATE);
} else {
- if ( log.isDebug() ) {
- logDebug( "Internal error: load_action set to default 'append', value found '" + action + "'." );
+ if (log.isDebug()) {
+ logDebug(
+ "Internal error: load_action set to default 'append', value found '" + action + "'.");
}
- meta.setLoadAction( OraBulkLoaderMeta.ACTION_APPEND );
+ meta.setLoadAction(OraBulkLoaderMeta.ACTION_APPEND);
}
transformName = wTransformName.getText();
}
private void ok() {
- if ( Utils.isEmpty( wTransformName.getText() ) ) {
+ if (Utils.isEmpty(wTransformName.getText())) {
return;
}
// Get the information for the dialog into the input structure.
- getInfo( input );
+ getInfo(input);
- if ( input.getDatabaseMeta() == null ) {
- MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
- mb.setMessage( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogMessage" ) );
- mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogTitle" ) );
+ if (input.getDatabaseMeta() == null) {
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
+ mb.setMessage(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.InvalidConnection.DialogMessage"));
+ mb.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.InvalidConnection.DialogTitle"));
mb.open();
}
@@ -1209,34 +1243,41 @@
}
private void getSchemaNames() {
- DatabaseMeta databaseMeta = pipelineMeta.findDatabase( wConnection.getText(), variables );
- if ( databaseMeta != null ) {
+ DatabaseMeta databaseMeta = pipelineMeta.findDatabase(wConnection.getText(), variables);
+ if (databaseMeta != null) {
Database database = new Database(loggingObject, variables, databaseMeta);
try {
database.connect();
String[] schemas = database.getSchemas();
- if ( null != schemas && schemas.length > 0 ) {
- schemas = Const.sortStrings( schemas );
+ if (null != schemas && schemas.length > 0) {
+ schemas = Const.sortStrings(schemas);
EnterSelectionDialog dialog =
- new EnterSelectionDialog( shell, schemas, BaseMessages.getString(
- PKG, "OraBulkLoaderDialog.AvailableSchemas.Title", wConnection.getText() ), BaseMessages
- .getString( PKG, "OraBulkLoaderDialog.AvailableSchemas.Message", wConnection.getText() ) );
+ new EnterSelectionDialog(
+ shell,
+ schemas,
+ BaseMessages.getString(
+ PKG, "OraBulkLoaderDialog.AvailableSchemas.Title", wConnection.getText()),
+ BaseMessages.getString(
+ PKG, "OraBulkLoaderDialog.AvailableSchemas.Message", wConnection.getText()));
String d = dialog.open();
- if ( d != null ) {
- wSchema.setText( Const.NVL( d, "" ) );
+ if (d != null) {
+ wSchema.setText(Const.NVL(d, ""));
setTableFieldCombo();
}
} else {
- MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
- mb.setMessage( BaseMessages.getString( PKG, "OraBulkLoaderDialog.NoSchema.Error" ) );
- mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.GetSchemas.Error" ) );
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
+ mb.setMessage(BaseMessages.getString(PKG, "OraBulkLoaderDialog.NoSchema.Error"));
+ mb.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.GetSchemas.Error"));
mb.open();
}
- } catch ( Exception e ) {
- new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
- .getString( PKG, "OraBulkLoaderDialog.ErrorGettingSchemas" ), e );
+ } catch (Exception e) {
+ new ErrorDialog(
+ shell,
+ BaseMessages.getString(PKG, "System.Dialog.Error.Title"),
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.ErrorGettingSchemas"),
+ e);
} finally {
database.disconnect();
}
@@ -1250,49 +1291,57 @@
return;
}
DatabaseMeta databaseMeta = pipelineMeta.findDatabase(connectionName, variables);
-
- if ( databaseMeta != null ) {
- if ( log.isDebug() ) {
- logDebug( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Log.LookingAtConnection" ) + databaseMeta.toString() );
+
+ if (databaseMeta != null) {
+ if (log.isDebug()) {
+ logDebug(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.Log.LookingAtConnection")
+ + databaseMeta.toString());
}
DatabaseExplorerDialog dialog =
new DatabaseExplorerDialog(
shell, SWT.NONE, variables, databaseMeta, pipelineMeta.getDatabases());
- dialog.setSelectedSchemaAndTable( variables.resolve(wSchema.getText()), variables.resolve(wTable.getText()) );
+ dialog.setSelectedSchemaAndTable(
+ variables.resolve(wSchema.getText()), variables.resolve(wTable.getText()));
if (dialog.open()) {
wSchema.setText(Const.NVL(dialog.getSchemaName(), ""));
wTable.setText(Const.NVL(dialog.getTableName(), ""));
}
} else {
- MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
- mb.setMessage( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogMessage" ) );
- mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.InvalidConnection.DialogTitle" ) );
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
+ mb.setMessage(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.InvalidConnection.DialogMessage"));
+ mb.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.InvalidConnection.DialogTitle"));
mb.open();
}
}
private void getUpdate() {
try {
- IRowMeta r = pipelineMeta.getPrevInfoFields( variables, transformName );
- if ( r != null ) {
+ IRowMeta r = pipelineMeta.getPrevInfoFields(variables, transformName);
+ if (r != null) {
ITableItemInsertListener listener =
(tableItem, v) -> {
- if ( v.getType() == IValueMeta.TYPE_DATE ) {
+ if (v.getType() == IValueMeta.TYPE_DATE) {
// The default is date mask.
- tableItem.setText( 3, BaseMessages.getString( PKG, "OraBulkLoaderDialog.DateMask.Label" ) );
+ tableItem.setText(
+ 3, BaseMessages.getString(PKG, "OraBulkLoaderDialog.DateMask.Label"));
} else {
- tableItem.setText( 3, "" );
+ tableItem.setText(3, "");
}
return true;
};
-
- BaseTransformDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
+
+ BaseTransformDialog.getFieldsFromPrevious(
+ r, wReturn, 1, new int[] {1, 2}, new int[] {}, -1, -1, listener);
}
- } catch ( HopException ke ) {
+ } catch (HopException ke) {
new ErrorDialog(
- shell, BaseMessages.getString( PKG, "OraBulkLoaderDialog.FailedToGetFields.DialogTitle" ), BaseMessages
- .getString( PKG, "OraBulkLoaderDialog.FailedToGetFields.DialogMessage" ), ke );
+ shell,
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.FailedToGetFields.DialogTitle"),
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.FailedToGetFields.DialogMessage"),
+ ke);
}
}
@@ -1301,45 +1350,53 @@
private void create() {
try {
OraBulkLoaderMeta info = new OraBulkLoaderMeta();
- getInfo( info );
+ getInfo(info);
String name = transformName; // new name might not yet be linked to other transforms!
TransformMeta transformMeta =
new TransformMeta(
BaseMessages.getString(PKG, "OraBulkLoaderDialog.TransformMeta.Title"), name, info);
- IRowMeta prev = pipelineMeta.getPrevTransformFields(variables, transformName );
+ IRowMeta prev = pipelineMeta.getPrevTransformFields(variables, transformName);
SqlStatement sql =
info.getSqlStatements(variables, pipelineMeta, transformMeta, prev, metadataProvider);
- if ( !sql.hasError() ) {
- if ( sql.hasSql() ) {
+ if (!sql.hasError()) {
+ if (sql.hasSql()) {
SqlEditor sqledit =
- new SqlEditor( shell, SWT.NONE, variables, info.getDatabaseMeta(), DbCache.getInstance(), sql
- .getSql() );
+ new SqlEditor(
+ shell,
+ SWT.NONE,
+ variables,
+ info.getDatabaseMeta(),
+ DbCache.getInstance(),
+ sql.getSql());
sqledit.open();
} else {
- MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );
- mb.setMessage( BaseMessages.getString( PKG, "OraBulkLoaderDialog.NoSQLNeeds.DialogMessage" ) );
- mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.NoSQLNeeds.DialogTitle" ) );
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
+ mb.setMessage(
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.NoSQLNeeds.DialogMessage"));
+ mb.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.NoSQLNeeds.DialogTitle"));
mb.open();
}
} else {
- MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
- mb.setMessage( sql.getError() );
- mb.setText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.SQLError.DialogTitle" ) );
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
+ mb.setMessage(sql.getError());
+ mb.setText(BaseMessages.getString(PKG, "OraBulkLoaderDialog.SQLError.DialogTitle"));
mb.open();
}
- } catch ( HopException ke ) {
+ } catch (HopException ke) {
new ErrorDialog(
- shell, BaseMessages.getString( PKG, "OraBulkLoaderDialog.CouldNotBuildSQL.DialogTitle" ), BaseMessages
- .getString( PKG, "OraBulkLoaderDialog.CouldNotBuildSQL.DialogMessage" ), ke );
+ shell,
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.CouldNotBuildSQL.DialogTitle"),
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.CouldNotBuildSQL.DialogMessage"),
+ ke);
}
-
}
/**
- * Reads in the fields from the previous transforms and from the ONE next transform and opens an EnterMappingDialog with this
- * information. After the user did the mapping, those information is put into the Select/Rename table.
+ * Reads in the fields from the previous transforms and from the ONE next transform and opens an
+ * EnterMappingDialog with this information. After the user did the mapping, those information is
+ * put into the Select/Rename table.
*/
private void generateMappings() {
@@ -1349,113 +1406,139 @@
IRowMeta targetFields;
try {
- sourceFields = pipelineMeta.getPrevTransformFields(variables, transformMeta );
- } catch ( HopException e ) {
- new ErrorDialog( shell,
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindSourceFields.Title" ),
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindSourceFields.Message" ), e );
+ sourceFields = pipelineMeta.getPrevTransformFields(variables, transformMeta);
+ } catch (HopException e) {
+ new ErrorDialog(
+ shell,
+ BaseMessages.getString(
+ PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindSourceFields.Title"),
+ BaseMessages.getString(
+ PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindSourceFields.Message"),
+ e);
return;
}
// refresh data
- input.setDatabaseMeta( pipelineMeta.findDatabase( wConnection.getText(), variables ) );
- input.setTableName( variables.resolve( wTable.getText() ) );
+ input.setDatabaseMeta(pipelineMeta.findDatabase(wConnection.getText(), variables));
+ input.setTableName(variables.resolve(wTable.getText()));
ITransformMeta transformMetaInterface = transformMeta.getTransform();
try {
- targetFields = transformMetaInterface.getRequiredFields( variables );
- } catch ( HopException e ) {
- new ErrorDialog( shell, BaseMessages.getString(
- PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindTargetFields.Title" ), BaseMessages.getString(
- PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindTargetFields.Message" ), e );
+ targetFields = transformMetaInterface.getRequiredFields(variables);
+ } catch (HopException e) {
+ new ErrorDialog(
+ shell,
+ BaseMessages.getString(
+ PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindTargetFields.Title"),
+ BaseMessages.getString(
+ PKG, "OraBulkLoaderDialog.DoMapping.UnableToFindTargetFields.Message"),
+ e);
return;
}
String[] inputNames = new String[sourceFields.size()];
- for ( int i = 0; i < sourceFields.size(); i++ ) {
- IValueMeta value = sourceFields.getValueMeta( i );
+ for (int i = 0; i < sourceFields.size(); i++) {
+ IValueMeta value = sourceFields.getValueMeta(i);
inputNames[i] = value.getName() + " (" + value.getOrigin() + ")";
}
-
+
// Create the existing mapping list...
//
- List<SourceToTargetMapping> mappings = new ArrayList<SourceToTargetMapping>();
+ List<SourceToTargetMapping> mappings = new ArrayList<>();
StringBuilder missingSourceFields = new StringBuilder();
StringBuilder missingTargetFields = new StringBuilder();
int nrFields = wReturn.nrNonEmpty();
- for ( int i = 0; i < nrFields; i++ ) {
- TableItem item = wReturn.getNonEmpty( i );
- String source = item.getText( 2 );
- String target = item.getText( 1 );
+ for (int i = 0; i < nrFields; i++) {
+ TableItem item = wReturn.getNonEmpty(i);
+ String source = item.getText(2);
+ String target = item.getText(1);
- int sourceIndex = sourceFields.indexOfValue( source );
- if ( sourceIndex < 0 ) {
- missingSourceFields.append( Const.CR ).append( " " ).append( source ).append( " --> " ).append( target );
+ int sourceIndex = sourceFields.indexOfValue(source);
+ if (sourceIndex < 0) {
+ missingSourceFields
+ .append(Const.CR)
+ .append(" ")
+ .append(source)
+ .append(" --> ")
+ .append(target);
}
- int targetIndex = targetFields.indexOfValue( target );
- if ( targetIndex < 0 ) {
- missingTargetFields.append( Const.CR ).append( " " ).append( source ).append( " --> " ).append( target );
+ int targetIndex = targetFields.indexOfValue(target);
+ if (targetIndex < 0) {
+ missingTargetFields
+ .append(Const.CR)
+ .append(" ")
+ .append(source)
+ .append(" --> ")
+ .append(target);
}
- if ( sourceIndex < 0 || targetIndex < 0 ) {
+ if (sourceIndex < 0 || targetIndex < 0) {
continue;
}
- SourceToTargetMapping mapping = new SourceToTargetMapping( sourceIndex, targetIndex );
- mappings.add( mapping );
+ SourceToTargetMapping mapping = new SourceToTargetMapping(sourceIndex, targetIndex);
+ mappings.add(mapping);
}
// show a confirm dialog if some missing field was found
//
- if ( missingSourceFields.length() > 0 || missingTargetFields.length() > 0 ) {
+ if (missingSourceFields.length() > 0 || missingTargetFields.length() > 0) {
String message = "";
- if ( missingSourceFields.length() > 0 ) {
+ if (missingSourceFields.length() > 0) {
message +=
- BaseMessages.getString(
- PKG, "OraBulkLoaderDialog.DoMapping.SomeSourceFieldsNotFound", missingSourceFields.toString() )
- + Const.CR;
+ BaseMessages.getString(
+ PKG,
+ "OraBulkLoaderDialog.DoMapping.SomeSourceFieldsNotFound",
+ missingSourceFields.toString())
+ + Const.CR;
}
- if ( missingTargetFields.length() > 0 ) {
+ if (missingTargetFields.length() > 0) {
message +=
- BaseMessages.getString(
- PKG, "OraBulkLoaderDialog.DoMapping.SomeTargetFieldsNotFound", missingSourceFields.toString() )
- + Const.CR;
+ BaseMessages.getString(
+ PKG,
+ "OraBulkLoaderDialog.DoMapping.SomeTargetFieldsNotFound",
+ missingSourceFields.toString())
+ + Const.CR;
}
message += Const.CR;
message +=
- BaseMessages.getString( PKG, "OraBulkLoaderDialog.DoMapping.SomeFieldsNotFoundContinue" ) + Const.CR;
-
+ BaseMessages.getString(PKG, "OraBulkLoaderDialog.DoMapping.SomeFieldsNotFoundContinue")
+ + Const.CR;
+
int answer =
BaseDialog.openMessageBox(
shell,
BaseMessages.getString(PKG, "OraBulkLoaderDialog.DoMapping.SomeFieldsNotFoundTitle"),
message,
SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
- boolean goOn = (answer & SWT.OK) != 0;
-
- if ( !goOn ) {
+ boolean goOn = (answer & SWT.OK) != 0;
+
+ if (!goOn) {
return;
}
}
EnterMappingDialog d =
- new EnterMappingDialog( OraBulkLoaderDialog.this.shell, sourceFields.getFieldNames(), targetFields
- .getFieldNames(), mappings );
+ new EnterMappingDialog(
+ OraBulkLoaderDialog.this.shell,
+ sourceFields.getFieldNames(),
+ targetFields.getFieldNames(),
+ mappings);
mappings = d.open();
// mappings == null if the user pressed cancel
//
- if ( mappings != null ) {
+ if (mappings != null) {
// Clear and re-populate!
//
wReturn.table.removeAll();
- wReturn.table.setItemCount( mappings.size() );
- for ( int i = 0; i < mappings.size(); i++ ) {
- SourceToTargetMapping mapping = mappings.get( i );
- TableItem item = wReturn.table.getItem( i );
- item.setText( 2, sourceFields.getValueMeta( mapping.getSourcePosition() ).getName() );
- item.setText( 1, targetFields.getValueMeta( mapping.getTargetPosition() ).getName() );
+ wReturn.table.setItemCount(mappings.size());
+ for (int i = 0; i < mappings.size(); i++) {
+ SourceToTargetMapping mapping = mappings.get(i);
+ TableItem item = wReturn.table.getItem(i);
+ item.setText(2, sourceFields.getValueMeta(mapping.getSourcePosition()).getName());
+ item.setText(1, targetFields.getValueMeta(mapping.getTargetPosition()).getName());
}
wReturn.setRowNums();
- wReturn.optWidth( true );
+ wReturn.optWidth(true);
}
}
}
diff --git a/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderMeta.java b/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderMeta.java
index 7fb8452..006150e 100644
--- a/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderMeta.java
+++ b/plugins/transforms/orabulkloader/src/main/java/org/apache/hop/pipeline/transforms/orabulkloader/OraBulkLoaderMeta.java
@@ -51,12 +51,12 @@
documentationUrl = "/pipeline/transforms/orabulkloader.html")
public class OraBulkLoaderMeta extends BaseTransformMeta<OraBulkLoader, OraBulkLoaderData> implements
IProvidesDatabaseConnectionInformation {
- private static Class<?> PKG = OraBulkLoaderMeta.class; // for i18n purposes, needed by Translator2!!
+ private static final Class<?> PKG = OraBulkLoaderMeta.class; // for i18n purposes, needed by Translator2!!
- private static int DEFAULT_COMMIT_SIZE = 100000; // The bigger the better for Oracle
- private static int DEFAULT_BIND_SIZE = 0;
- private static int DEFAULT_READ_SIZE = 0;
- private static int DEFAULT_MAX_ERRORS = 50;
+ private static final int DEFAULT_COMMIT_SIZE = 100000; // The bigger the better for Oracle
+ private static final int DEFAULT_BIND_SIZE = 0;
+ private static final int DEFAULT_READ_SIZE = 0;
+ private static final int DEFAULT_MAX_ERRORS = 50;
/** Database connection */
@HopMetadataProperty(
@@ -353,6 +353,7 @@
}
+ @Override
public void setDefault() {
databaseMeta = null;
commitSize = Integer.toString( DEFAULT_COMMIT_SIZE );
@@ -380,6 +381,8 @@
mappings = new ArrayList<>();
}
+
+ @Override
public void check(
List<ICheckResult> remarks,
PipelineMeta pipelineMeta,
@@ -391,7 +394,7 @@
IVariables variables,
IHopMetadataProvider metadataProvider) {
CheckResult cr;
- String error_message = "";
+ String errorMessage = "";
if ( databaseMeta != null ) {
Database db = new Database( loggingObject, variables, databaseMeta );
@@ -405,8 +408,8 @@
remarks.add( cr );
boolean first = true;
- boolean error_found = false;
- error_message = "";
+ boolean errorFound = false;
+ errorMessage = "";
// Check fields in table
String schemaTable =
@@ -420,8 +423,8 @@
// How about the fields to insert/dateMask in the table?
first = true;
- error_found = false;
- error_message = "";
+ errorFound = false;
+ errorMessage = "";
for (int i = 0; i < mappings.size(); i++) {
String field = mappings.get(i).getFieldTable();
@@ -430,17 +433,17 @@
if ( v == null ) {
if ( first ) {
first = false;
- error_message +=
+ errorMessage +=
BaseMessages.getString(
PKG, "OraBulkLoaderMeta.CheckResult.MissingFieldsToLoadInTargetTable" )
+ Const.CR;
}
- error_found = true;
- error_message += "\t\t" + field + Const.CR;
+ errorFound = true;
+ errorMessage += "\t\t" + field + Const.CR;
}
}
- if ( error_found ) {
- cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, error_message, transformMeta );
+ if ( errorFound ) {
+ cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta );
} else {
cr =
new CheckResult( ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(
@@ -448,8 +451,8 @@
}
remarks.add( cr );
} else {
- error_message = BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.CouldNotReadTableInfo" );
- cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, error_message, transformMeta );
+ errorMessage = BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.CouldNotReadTableInfo" );
+ cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta );
remarks.add( cr );
}
}
@@ -462,23 +465,23 @@
remarks.add( cr );
boolean first = true;
- error_message = "";
- boolean error_found = false;
+ errorMessage = "";
+ boolean errorFound = false;
for (int i = 0; i < mappings.size(); i++) {
IValueMeta valueMeta = prev.searchValueMeta(mappings.get(i).getFieldStream());
if ( valueMeta == null ) {
if ( first ) {
first = false;
- error_message +=
+ errorMessage +=
BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.MissingFieldsInInput" ) + Const.CR;
}
- error_found = true;
- error_message += "\t\t" + mappings.get(i).getFieldStream() + Const.CR;
+ errorFound = true;
+ errorMessage += "\t\t" + mappings.get(i).getFieldStream() + Const.CR;
}
}
- if ( error_found ) {
- cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, error_message, transformMeta );
+ if ( errorFound ) {
+ cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta );
} else {
cr =
new CheckResult( ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(
@@ -486,22 +489,22 @@
}
remarks.add( cr );
} else {
- error_message =
+ errorMessage =
BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.MissingFieldsInInput3" ) + Const.CR;
- cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, error_message, transformMeta );
+ cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta );
remarks.add( cr );
}
} catch ( HopException e ) {
- error_message =
+ errorMessage =
BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.DatabaseErrorOccurred" ) + e.getMessage();
- cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, error_message, transformMeta );
+ cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta );
remarks.add( cr );
} finally {
db.disconnect();
}
} else {
- error_message = BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.InvalidConnection" );
- cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, error_message, transformMeta );
+ errorMessage = BaseMessages.getString( PKG, "OraBulkLoaderMeta.CheckResult.InvalidConnection" );
+ cr = new CheckResult( ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta );
remarks.add( cr );
}
@@ -614,6 +617,7 @@
this.directPath = directPath;
}
+ @Override
public IRowMeta getRequiredFields( IVariables variables ) throws HopException {
String realTableName = variables.resolve( tableName );
String realSchemaName = variables.resolve( schemaName );
diff --git a/plugins/transforms/propertyinput/src/main/java/org/apache/hop/pipeline/transforms/propertyinput/PropertyInputMeta.java b/plugins/transforms/propertyinput/src/main/java/org/apache/hop/pipeline/transforms/propertyinput/PropertyInputMeta.java
index 869e6fe..cba7dca 100644
--- a/plugins/transforms/propertyinput/src/main/java/org/apache/hop/pipeline/transforms/propertyinput/PropertyInputMeta.java
+++ b/plugins/transforms/propertyinput/src/main/java/org/apache/hop/pipeline/transforms/propertyinput/PropertyInputMeta.java
@@ -194,6 +194,7 @@
m.inputFields.forEach(f -> this.inputFields.add(new PIField(f)));
}
+ @Override
public PropertyInputMeta clone() {
return new PropertyInputMeta(this);
}
diff --git a/plugins/transforms/serverstatus/src/main/java/org/apache/hop/pipeline/transforms/serverstatus/GetServerStatusMeta.java b/plugins/transforms/serverstatus/src/main/java/org/apache/hop/pipeline/transforms/serverstatus/GetServerStatusMeta.java
index 7e6b660..b708dba 100644
--- a/plugins/transforms/serverstatus/src/main/java/org/apache/hop/pipeline/transforms/serverstatus/GetServerStatusMeta.java
+++ b/plugins/transforms/serverstatus/src/main/java/org/apache/hop/pipeline/transforms/serverstatus/GetServerStatusMeta.java
@@ -122,6 +122,7 @@
this.responseNsField = meta.responseNsField;
}
+ @Override
public GetServerStatusMeta clone() {
return new GetServerStatusMeta(this);
}
diff --git a/plugins/transforms/tika/src/main/java/org/apache/hop/pipeline/transforms/tika/TikaMeta.java b/plugins/transforms/tika/src/main/java/org/apache/hop/pipeline/transforms/tika/TikaMeta.java
index 653d0f4..b53396c 100755
--- a/plugins/transforms/tika/src/main/java/org/apache/hop/pipeline/transforms/tika/TikaMeta.java
+++ b/plugins/transforms/tika/src/main/java/org/apache/hop/pipeline/transforms/tika/TikaMeta.java
@@ -199,6 +199,7 @@
this.metadataFieldName = meta.metadataFieldName;
}
+ @Override
public TikaMeta clone() {
return new TikaMeta(this);
}
@@ -380,7 +381,7 @@
} else {
FileInputList fileInputList = getFiles(variables);
- if (fileInputList == null || fileInputList.getFiles().size() == 0) {
+ if (fileInputList == null || fileInputList.getFiles().isEmpty()) {
cr =
new CheckResult(
ICheckResult.TYPE_RESULT_ERROR,
@@ -432,6 +433,7 @@
}
}
+ @Override
public boolean supportsErrorHandling() {
return true;
}
diff --git a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
index 03d38ae..9459f6e 100644
--- a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
+++ b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
@@ -20,6 +20,14 @@
import com.google.common.annotations.VisibleForTesting;
import com.vertica.jdbc.VerticaConnection;
import com.vertica.jdbc.VerticaCopyStream;
+import java.io.*;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.Executors;
+import java.util.stream.Collectors;
+import javax.sql.PooledConnection;
import org.apache.commons.dbcp.DelegatingConnection;
import org.apache.hop.core.database.Database;
import org.apache.hop.core.database.DatabaseMeta;
@@ -41,17 +49,8 @@
import org.apache.hop.pipeline.transforms.vertica.bulkloader.nativebinary.ColumnType;
import org.apache.hop.pipeline.transforms.vertica.bulkloader.nativebinary.StreamEncoder;
-import javax.sql.PooledConnection;
-import java.io.*;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.Executors;
-import java.util.stream.Collectors;
-
public class VerticaBulkLoader extends BaseTransform<VerticaBulkLoaderMeta, VerticaBulkLoaderData> {
- private static Class<?> PKG =
+ private static final Class<?> PKG =
VerticaBulkLoader.class; // for i18n purposes, needed by Translator2!!
private static final SimpleDateFormat SIMPLE_DATE_FORMAT =
@@ -69,6 +68,7 @@
super(transformMeta, meta, data, copyNr, pipelineMeta, pipeline);
}
+ @Override
public boolean processRow() throws HopException {
Object[] r = getRow(); // this also waits for a previous transform to be
// finished.
@@ -310,7 +310,8 @@
return new ColumnSpec(ColumnSpec.ConstantWidthType.FLOAT);
} else if (targetColumnTypeName.equals("CHAR")) {
return new ColumnSpec(ColumnSpec.UserDefinedWidthType.CHAR, targetValueMeta.getLength());
- } else if (targetColumnTypeName.equals("VARCHAR") || targetColumnTypeName.equals("CHARACTER VARYING")) {
+ } else if (targetColumnTypeName.equals("VARCHAR")
+ || targetColumnTypeName.equals("CHARACTER VARYING")) {
return new ColumnSpec(ColumnSpec.VariableWidthType.VARCHAR, targetValueMeta.getLength());
} else if (targetColumnTypeName.equals("DATE")) {
if (inputValueMeta.isDate() == false) {
@@ -387,7 +388,7 @@
"Column type " + targetColumnTypeName + " not supported."); // $NON-NLS-1$
}
- private void initializeWorker(){
+ private void initializeWorker() {
final String dml = buildCopyStatementSqlString();
data.workerThread =
@@ -410,7 +411,10 @@
rowsLoaded, getLinesOutput()));
}
data.db.disconnect();
- } catch (SQLException | IllegalStateException | ClassNotFoundException | HopException e) {
+ } catch (SQLException
+ | IllegalStateException
+ | ClassNotFoundException
+ | HopException e) {
if (e.getCause() instanceof InterruptedIOException) {
logBasic("SQL statement interrupted by halt of pipeline");
} else {
@@ -617,7 +621,6 @@
}
}
-
@Override
public void dispose() {
@@ -656,12 +659,14 @@
}
@VisibleForTesting
- VerticaCopyStream createVerticaCopyStream(String dml) throws SQLException, ClassNotFoundException, HopDatabaseException {
+ VerticaCopyStream createVerticaCopyStream(String dml)
+ throws SQLException, ClassNotFoundException, HopDatabaseException {
return new VerticaCopyStream(getVerticaConnection(), dml);
}
@VisibleForTesting
- VerticaConnection getVerticaConnection() throws SQLException, ClassNotFoundException, HopDatabaseException {
+ VerticaConnection getVerticaConnection()
+ throws SQLException, ClassNotFoundException, HopDatabaseException {
Connection conn = data.db.getConnection();
if (conn != null) {
@@ -682,8 +687,8 @@
VerticaConnection vc = conn.unwrap(VerticaConnection.class);
return vc;
}
- } catch (SQLException Ignored) {
- // Ignored - the connection doesn't support unwrap or the connection cannot be
+ } catch (SQLException ignored) {
+ // ignored - the connection doesn't support unwrap or the connection cannot be
// unwrapped into a VerticaConnection.
}
}
diff --git a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
index 006713f..e1239c2 100644
--- a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
+++ b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
@@ -17,6 +17,8 @@
package org.apache.hop.pipeline.transforms.vertica.bulkloader;
+import java.util.*;
+import java.util.List;
import org.apache.hop.core.*;
import org.apache.hop.core.database.Database;
import org.apache.hop.core.database.DatabaseMeta;
@@ -54,67 +56,38 @@
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.*;
-import java.util.List;
-import java.util.*;
-
public class VerticaBulkLoaderDialog extends BaseTransformDialog implements ITransformDialog {
- private static Class<?> PKG =
+ private static final Class<?> PKG =
VerticaBulkLoaderMeta.class; // for i18n purposes, needed by Translator2!!
- private CTabFolder wTabFolder;
- private FormData fdTabFolder;
-
- private CTabItem wMainTab, wFieldsTab;
- private FormData fdMainComp, fdFieldsComp;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
- private Label wlTruncate;
private Button wTruncate;
private Button wOnlyWhenHaveRows;
- private Label wlSchema;
+
private TextVar wSchema;
- private FormData fdlSchema, fdSchema;
- private Label wlTable;
- private Button wbTable;
private TextVar wTable;
- private FormData fdlTable, fdbTable, fdTable;
- private Label wlExceptionsLogFile;
private TextVar wExceptionsLogFile;
- private FormData fdlExceptionsLogFile, fdExceptionsLogFile;
- private Label wlRejectedDataLogFile;
private TextVar wRejectedDataLogFile;
- private FormData fdlRejectedDataLogFile, fdRejectedDataLogFile;
- private Label wlStreamName;
private TextVar wStreamName;
- private FormData fdlStreamName, fdStreamName;
- private Label wlAbortOnError;
private Button wAbortOnError;
- private FormData fdlAbortOnError, fdAbortOnError;
- private Label wlDirect;
private Button wDirect;
- private FormData fdlDirect, fdDirect;
- private Label wlSpecifyFields;
private Button wSpecifyFields;
- private FormData fdlSpecifyFields, fdSpecifyFields;
- private Label wlFields;
private TableView wFields;
private Button wGetFields;
- private FormData fdGetFields;
private Button wDoMapping;
- private FormData fdDoMapping;
private VerticaBulkLoaderMeta input;
@@ -123,33 +96,57 @@
private ColumnInfo[] ciFields;
/** List of ColumnInfo that should have the field names of the selected database table */
- private List<ColumnInfo> tableFieldColumns = new ArrayList<ColumnInfo>();
+ private List<ColumnInfo> tableFieldColumns = new ArrayList<>();
/** Constructor. */
public VerticaBulkLoaderDialog(
Shell parent, IVariables variables, Object in, PipelineMeta pipelineMeta, String sname) {
super(parent, variables, (BaseTransformMeta) in, pipelineMeta, sname);
input = (VerticaBulkLoaderMeta) in;
- inputFields = new HashMap<String, Integer>();
+ inputFields = new HashMap<>();
}
/** Open the dialog. */
public String open() {
+ FormData fdDoMapping;
+ FormData fdGetFields;
+ Label wlFields;
+ FormData fdSpecifyFields;
+ Label wlSpecifyFields;
+ FormData fdDirect;
+ FormData fdAbortOnError;
+ FormData fdlAbortOnError;
+ Label wlAbortOnError;
+ FormData fdStreamName;
+ Label wlStreamName;
+ FormData fdRejectedDataLogFile;
+ FormData fdlRejectedDataLogFile;
+ Label wlRejectedDataLogFile;
+ FormData fdExceptionsLogFile;
+ FormData fdlExceptionsLogFile;
+ Label wlExceptionsLogFile;
+ FormData fdbTable;
+ FormData fdlTable;
+ Button wbTable;
+ FormData fdSchema;
+ FormData fdlSchema;
+ Label wlSchema;
+ FormData fdMainComp;
+ CTabItem wFieldsTab;
+ CTabItem wMainTab;
+ FormData fdTabFolder;
+ CTabFolder wTabFolder;
+ Label wlTruncate;
Shell parent = getParent();
- Display display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
PropsUi.setLook(shell);
setShellImage(shell, input);
- ModifyListener lsMod =
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- input.setChanged();
- }
- };
+ ModifyListener lsMod = e -> input.setChanged();
FocusListener lsFocusLost =
new FocusAdapter() {
+ @Override
public void focusLost(FocusEvent arg0) {
setTableFieldCombo();
}
@@ -192,12 +189,7 @@
wConnection.select(0);
}
wConnection.addModifyListener(lsMod);
- wConnection.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- setFlags();
- }
- });
+ wConnection.addModifyListener(event -> setFlags());
// Schema line...
wlSchema = new Label(shell, SWT.RIGHT);
@@ -221,7 +213,7 @@
wSchema.setLayoutData(fdSchema);
// Table line...
- wlTable = new Label(shell, SWT.RIGHT);
+ Label wlTable = new Label(shell, SWT.RIGHT);
wlTable.setText(BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.TargetTable.Label"));
PropsUi.setLook(wlTable);
fdlTable = new FormData();
@@ -242,7 +234,7 @@
PropsUi.setLook(wTable);
wTable.addModifyListener(lsMod);
wTable.addFocusListener(lsFocusLost);
- fdTable = new FormData();
+ FormData fdTable = new FormData();
fdTable.top = new FormAttachment(wSchema, margin);
fdTable.left = new FormAttachment(middle, 0);
fdTable.right = new FormAttachment(wbTable, -margin);
@@ -250,6 +242,7 @@
SelectionAdapter lsSelMod =
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent arg0) {
input.setChanged();
}
@@ -272,25 +265,25 @@
fdTruncate.right = new FormAttachment(100, 0);
wTruncate.setLayoutData(fdTruncate);
SelectionAdapter lsTruncMod =
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent arg0) {
- input.setChanged();
- }
- };
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ input.setChanged();
+ }
+ };
wTruncate.addSelectionListener(lsTruncMod);
wTruncate.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setFlags();
- }
- });
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setFlags();
+ }
+ });
// Truncate only when have rows
Label wlOnlyWhenHaveRows = new Label(shell, SWT.RIGHT);
wlOnlyWhenHaveRows.setText(
- BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.OnlyWhenHaveRows.Label"));
+ BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.OnlyWhenHaveRows.Label"));
PropsUi.setLook(wlOnlyWhenHaveRows);
FormData fdlOnlyWhenHaveRows = new FormData();
fdlOnlyWhenHaveRows.left = new FormAttachment(0, 0);
@@ -299,7 +292,7 @@
wlOnlyWhenHaveRows.setLayoutData(fdlOnlyWhenHaveRows);
wOnlyWhenHaveRows = new Button(shell, SWT.CHECK);
wOnlyWhenHaveRows.setToolTipText(
- BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.OnlyWhenHaveRows.Tooltip"));
+ BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.OnlyWhenHaveRows.Tooltip"));
PropsUi.setLook(wOnlyWhenHaveRows);
FormData fdTruncateWhenHaveRows = new FormData();
fdTruncateWhenHaveRows.left = new FormAttachment(middle, 0);
@@ -308,13 +301,12 @@
wOnlyWhenHaveRows.setLayoutData(fdTruncateWhenHaveRows);
wOnlyWhenHaveRows.addSelectionListener(lsSelMod);
-
// Specify fields
wlSpecifyFields = new Label(shell, SWT.RIGHT);
wlSpecifyFields.setText(
BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.SpecifyFields.Label"));
PropsUi.setLook(wlSpecifyFields);
- fdlSpecifyFields = new FormData();
+ FormData fdlSpecifyFields = new FormData();
fdlSpecifyFields.left = new FormAttachment(0, 0);
fdlSpecifyFields.top = new FormAttachment(wOnlyWhenHaveRows, margin);
fdlSpecifyFields.right = new FormAttachment(middle, -margin);
@@ -331,6 +323,7 @@
// If the flag is off, gray out the fields tab e.g.
wSpecifyFields.addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent arg0) {
setFlags();
}
@@ -362,12 +355,12 @@
wMainComp.setLayoutData(fdMainComp);
// Insert directly to ROS
- wlDirect = new Label(wMainComp, SWT.RIGHT);
+ Label wlDirect = new Label(wMainComp, SWT.RIGHT);
wlDirect.setText(BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.InsertDirect.Label"));
wlDirect.setToolTipText(
BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.InsertDirect.Tooltip"));
PropsUi.setLook(wlDirect);
- fdlDirect = new FormData();
+ FormData fdlDirect = new FormData();
fdlDirect.left = new FormAttachment(0, 0);
fdlDirect.top = new FormAttachment(0, margin);
fdlDirect.right = new FormAttachment(middle, -margin);
@@ -471,7 +464,7 @@
wlStreamName.setToolTipText(
BaseMessages.getString(PKG, "VerticaBulkLoaderDialog.StreamName.Tooltip")); // $NON-NLS-1$
PropsUi.setLook(wlStreamName);
- fdlStreamName = new FormData();
+ FormData fdlStreamName = new FormData();
fdlStreamName.left = new FormAttachment(0, 0);
fdlStreamName.right = new FormAttachment(middle, -margin);
fdlStreamName.top = new FormAttachment(wlRejectedDataLogFile, margin * 2);
@@ -519,8 +512,10 @@
wlFields.setLayoutData(fdlUpIns);
int tableCols = 2;
- int UpInsRows = (input.getFields() != null && !input.getFields().equals(Collections.emptyList())
- ? input.getFields().size() : 1 );
+ int upInsRows =
+ (input.getFields() != null && !input.getFields().equals(Collections.emptyList())
+ ? input.getFields().size()
+ : 1);
ciFields = new ColumnInfo[tableCols];
ciFields[0] =
@@ -542,7 +537,7 @@
wFieldsComp,
SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL,
ciFields,
- UpInsRows,
+ upInsRows,
lsMod,
props);
@@ -577,7 +572,7 @@
fdFields.bottom = new FormAttachment(100, -2 * margin);
wFields.setLayoutData(fdFields);
- fdFieldsComp = new FormData();
+ FormData fdFieldsComp = new FormData();
fdFieldsComp.left = new FormAttachment(0, 0);
fdFieldsComp.top = new FormAttachment(0, 0);
fdFieldsComp.right = new FormAttachment(100, 0);
@@ -698,7 +693,7 @@
// Create the existing mapping list...
//
- List<SourceToTargetMapping> mappings = new ArrayList<SourceToTargetMapping>();
+ List<SourceToTargetMapping> mappings = new ArrayList<>();
StringBuffer missingSourceFields = new StringBuffer();
StringBuffer missingTargetFields = new StringBuffer();
@@ -790,42 +785,40 @@
private void setTableFieldCombo() {
Runnable fieldLoader =
- new Runnable() {
- public void run() {
- // clear
- for (int i = 0; i < tableFieldColumns.size(); i++) {
- ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
- colInfo.setComboValues(new String[] {});
- }
- if (!StringUtil.isEmpty(wTable.getText())) {
- DatabaseMeta databaseMeta = pipelineMeta.findDatabase(wConnection.getText(), variables);
- if (databaseMeta != null) {
- try (Database db = new Database(loggingObject, variables, databaseMeta)) {
- db.connect();
+ () -> {
+ // clear
+ for (int i = 0; i < tableFieldColumns.size(); i++) {
+ ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
+ colInfo.setComboValues(new String[] {});
+ }
+ if (!StringUtil.isEmpty(wTable.getText())) {
+ DatabaseMeta databaseMeta = pipelineMeta.findDatabase(wConnection.getText(), variables);
+ if (databaseMeta != null) {
+ try (Database db = new Database(loggingObject, variables, databaseMeta)) {
+ db.connect();
- String schemaTable =
- databaseMeta.getQuotedSchemaTableCombination(
- variables,
- variables.resolve(wSchema.getText()),
- variables.resolve(wTable.getText()));
- IRowMeta r = db.getTableFields(schemaTable);
- if (null != r) {
- String[] fieldNames = r.getFieldNames();
- if (null != fieldNames) {
- for (int i = 0; i < tableFieldColumns.size(); i++) {
- ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
- colInfo.setComboValues(fieldNames);
- }
+ String schemaTable =
+ databaseMeta.getQuotedSchemaTableCombination(
+ variables,
+ variables.resolve(wSchema.getText()),
+ variables.resolve(wTable.getText()));
+ IRowMeta r = db.getTableFields(schemaTable);
+ if (null != r) {
+ String[] fieldNames = r.getFieldNames();
+ if (null != fieldNames) {
+ for (int i = 0; i < tableFieldColumns.size(); i++) {
+ ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
+ colInfo.setComboValues(fieldNames);
}
}
- } catch (Exception e) {
- for (int i = 0; i < tableFieldColumns.size(); i++) {
- ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
- colInfo.setComboValues(new String[] {});
- }
- // ignore any errors here. drop downs will not be
- // filled, but no problem for the user
}
+ } catch (Exception e) {
+ for (int i = 0; i < tableFieldColumns.size(); i++) {
+ ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
+ colInfo.setComboValues(new String[] {});
+ }
+ // ignore any errors here. drop downs will not be
+ // filled, but no problem for the user
}
}
}
@@ -836,17 +829,17 @@
protected void setComboBoxes() {
// Something was changed in the row.
//
- final Map<String, Integer> fields = new HashMap<String, Integer>();
+ final Map<String, Integer> fields = new HashMap<>();
// Add the currentMeta fields...
fields.putAll(inputFields);
Set<String> keySet = fields.keySet();
- List<String> entries = new ArrayList<String>(keySet);
+ List<String> entries = new ArrayList<>(keySet);
String[] fieldNames = (String[]) entries.toArray(new String[entries.size()]);
- if ( PropsUi.getInstance().isSortFieldByName() ) {
+ if (PropsUi.getInstance().isSortFieldByName()) {
Const.sortStrings(fieldNames);
}
ciFields[1].setComboValues(fieldNames);
@@ -857,7 +850,6 @@
wFields.setEnabled(specifyFields);
wGetFields.setEnabled(specifyFields);
wDoMapping.setEnabled(specifyFields);
-
}
/** Copy information from the meta-data input to the dialog fields. */
@@ -934,10 +926,9 @@
for (int i = 0; i < nrRows; i++) {
TableItem item = wFields.getNonEmpty(i);
- VerticaBulkLoaderField vbf = new VerticaBulkLoaderField(
- Const.NVL(item.getText(1), ""),
- Const.NVL(item.getText(2), "")
- );
+ VerticaBulkLoaderField vbf =
+ new VerticaBulkLoaderField(
+ Const.NVL(item.getText(1), ""), Const.NVL(item.getText(2), ""));
info.getFields().add(vbf);
}
}
@@ -1051,12 +1042,7 @@
if (sql.hasSql()) {
SqlEditor sqledit =
new SqlEditor(
- shell,
- SWT.NONE,
- variables,
- databaseMeta,
- DbCache.getInstance(),
- sql.getSql());
+ shell, SWT.NONE, variables, databaseMeta, DbCache.getInstance(), sql.getSql());
sqledit.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
@@ -1079,6 +1065,7 @@
}
}
+ @Override
public String toString() {
return this.getClass().getName();
}
diff --git a/ui/src/main/java/org/apache/hop/ui/core/widget/StyledTextComp.java b/ui/src/main/java/org/apache/hop/ui/core/widget/StyledTextComp.java
index ba44706..7e630ed 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/widget/StyledTextComp.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/widget/StyledTextComp.java
@@ -130,6 +130,7 @@
textWidget.insert(strInsert);
}
+ @Override
public void addListener(int eventType, Listener listener) {
textWidget.addListener(eventType, listener);
}
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
index 8ab9992..e4a3918 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/DragViewZoomBase.java
@@ -45,6 +45,7 @@
super(parent, style);
}
+ @Override
public abstract void redraw();
public Point screen2real(int x, int y) {
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
index 7f8dd35..7b05d99 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/PipelineExecutionViewer.java
@@ -671,10 +671,12 @@
toolTip = "i18n::ExecutionViewer.GuiAction.ZoomFitToScreen.Tooltip",
type = GuiToolbarElementType.BUTTON,
image = "ui/images/zoom-fit.svg")
+ @Override
public void zoomFitToScreen() {
super.zoomFitToScreen();
}
+ @Override
protected Point getArea() {
org.eclipse.swt.graphics.Rectangle rect = canvas.getClientArea();
Point area = new Point(rect.width, rect.height);
@@ -1252,6 +1254,7 @@
*
* @return value of execution
*/
+ @Override
public Execution getExecution() {
return execution;
}
@@ -1279,6 +1282,7 @@
*
* @return value of locationName
*/
+ @Override
public String getLocationName() {
return locationName;
}
@@ -1324,6 +1328,7 @@
*
* @return value of perspective
*/
+ @Override
public ExecutionPerspective getPerspective() {
return perspective;
}
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
index 886f9f4..e4d4966 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/execution/WorkflowExecutionViewer.java
@@ -576,10 +576,12 @@
toolTip = "i18n::ExecutionViewer.GuiAction.ZoomFitToScreen.Tooltip",
type = GuiToolbarElementType.BUTTON,
image = "ui/images/zoom-fit.svg")
+ @Override
public void zoomFitToScreen() {
super.zoomFitToScreen();
}
+ @Override
protected Point getArea() {
org.eclipse.swt.graphics.Rectangle rect = canvas.getClientArea();
Point area = new Point(rect.width, rect.height);
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java b/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java
index 4a30bdd..a9d0fc2 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/shared/BaseExecutionViewer.java
@@ -119,6 +119,7 @@
canvas.setFocus();
}
+ @Override
protected float calculateCorrectedMagnification() {
return (float) (magnification * PropsUi.getInstance().getZoomFactor());
}