use of org.pentaho.di.trans.TransDependency in project pentaho-kettle by pentaho.
the class TransDialog method getData.
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
wTransname.setText(Const.NVL(transMeta.getName(), ""));
wTransFilename.setText(Const.NVL(transMeta.getFilename(), ""));
wTransdescription.setText(Const.NVL(transMeta.getDescription(), ""));
wExtendeddescription.setText(Const.NVL(transMeta.getExtendedDescription(), ""));
wTransversion.setText(Const.NVL(transMeta.getTransversion(), ""));
wTransstatus.select(transMeta.getTransstatus() - 1);
if (transMeta.getCreatedUser() != null) {
wCreateUser.setText(transMeta.getCreatedUser());
}
if (transMeta.getCreatedDate() != null) {
wCreateDate.setText(transMeta.getCreatedDate().toString());
}
if (transMeta.getModifiedUser() != null) {
wModUser.setText(transMeta.getModifiedUser());
}
if (transMeta.getModifiedDate() != null) {
wModDate.setText(transMeta.getModifiedDate().toString());
}
if (transMeta.getMaxDateConnection() != null) {
wMaxdateconnection.setText(transMeta.getMaxDateConnection().getName());
}
if (transMeta.getMaxDateTable() != null) {
wMaxdatetable.setText(transMeta.getMaxDateTable());
}
if (transMeta.getMaxDateField() != null) {
wMaxdatefield.setText(transMeta.getMaxDateField());
}
wMaxdateoffset.setText(Double.toString(transMeta.getMaxDateOffset()));
wMaxdatediff.setText(Double.toString(transMeta.getMaxDateDifference()));
// The dependencies
for (int i = 0; i < transMeta.nrDependencies(); i++) {
TableItem item = wFields.table.getItem(i);
TransDependency td = transMeta.getDependency(i);
DatabaseMeta conn = td.getDatabase();
String table = td.getTablename();
String field = td.getFieldname();
if (conn != null) {
item.setText(1, conn.getName());
}
if (table != null) {
item.setText(2, table);
}
if (field != null) {
item.setText(3, field);
}
}
// The named parameters
String[] parameters = transMeta.listParameters();
for (int idx = 0; idx < parameters.length; idx++) {
TableItem item = wParamFields.table.getItem(idx);
String defValue;
try {
defValue = transMeta.getParameterDefault(parameters[idx]);
} catch (UnknownParamException e) {
defValue = "";
}
String description;
try {
description = transMeta.getParameterDescription(parameters[idx]);
} catch (UnknownParamException e) {
description = "";
}
item.setText(1, parameters[idx]);
item.setText(2, Const.NVL(defValue, ""));
item.setText(3, Const.NVL(description, ""));
}
wSizeRowset.setText(Integer.toString(transMeta.getSizeRowset()));
wUniqueConnections.setSelection(transMeta.isUsingUniqueConnections());
wShowFeedback.setSelection(transMeta.isFeedbackShown());
wFeedbackSize.setText(Integer.toString(transMeta.getFeedbackSize()));
wSharedObjectsFile.setText(Const.NVL(transMeta.getSharedObjectsFile(), ""));
wManageThreads.setSelection(transMeta.isUsingThreadPriorityManagment());
wTransformationType.setText(transMeta.getTransformationType().getDescription());
wFields.setRowNums();
wFields.optWidth(true);
wParamFields.setRowNums();
wParamFields.optWidth(true);
// Directory:
if (transMeta.getRepositoryDirectory() != null && transMeta.getRepositoryDirectory().getPath() != null) {
wDirectory.setText(transMeta.getRepositoryDirectory().getPath());
}
// Performance monitoring tab:
//
wEnableStepPerfMonitor.setSelection(transMeta.isCapturingStepPerformanceSnapShots());
wStepPerfInterval.setText(Long.toString(transMeta.getStepPerformanceCapturingDelay()));
wStepPerfMaxSize.setText(Const.NVL(transMeta.getStepPerformanceCapturingSizeLimit(), ""));
if (rep == null) {
wTransname.selectAll();
wTransname.setFocus();
}
for (TransDialogPluginInterface extraTab : extraTabs) {
try {
extraTab.getData(transMeta);
} catch (Exception e) {
new ErrorDialog(shell, "Error", "Error adding extra plugin tab", e);
}
}
setFlags();
}
Aggregations