use of org.pentaho.di.trans.steps.palo.dimoutput.PaloDimOutputData in project pentaho-kettle by pentaho.
the class PaloDimOutputDialog method doSelectConnection.
private void doSelectConnection(boolean clearCurrentData) {
try {
if (clearCurrentData) {
tableViewFields.table.removeAll();
comboDimension.removeAll();
}
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
if (dbMeta != null) {
PaloDimOutputData data = new PaloDimOutputData(dbMeta);
data.helper.connect();
List<String> dimensions = data.helper.getDimensionsNames();
Collections.sort(dimensions, new PaloNameComparator());
for (String dimensionName : dimensions) {
if (comboDimension.indexOf(dimensionName) == -1) {
comboDimension.add(dimensionName);
}
}
data.helper.disconnect();
}
}
} catch (Exception ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "PaloDimOutputDialog.RetreiveDimensionsErrorTitle"), BaseMessages.getString(PKG, "PaloDimOutputDialog.RetreiveDimensionsError"), ex);
}
}
use of org.pentaho.di.trans.steps.palo.dimoutput.PaloDimOutputData in project pentaho-kettle by pentaho.
the class PaloDimOutputDialog method doGetFields.
private void doGetFields() {
try {
if (comboDimension.getText() != null) {
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
if (dbMeta != null) {
PaloDimOutputData data = new PaloDimOutputData(dbMeta);
tableViewFields.table.removeAll();
data.helper.connect();
List<PaloDimensionLevel> levels = data.helper.getDimensionLevels(comboDimension.getText());
for (PaloDimensionLevel level : levels) {
tableViewFields.add(String.valueOf(level.getLevelNumber()), level.getLevelName(), level.getFieldName());
}
tableViewFields.removeEmptyRows();
tableViewFields.setRowNums();
tableViewFields.optWidth(true);
data.helper.disconnect();
}
}
} else {
new ErrorDialog(shell, BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"), new Exception(BaseMessages.getString(PKG, "PaloDimOutputDialog.SelectDimensionsFirstError")));
}
this.fillPreviousFieldTableViewColumn();
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"), ke);
tableViewFields.add();
}
}
Aggregations