use of org.pentaho.di.trans.steps.palo.celloutput.PaloCellOutputData in project pentaho-kettle by pentaho.
the class PaloCellOutputDialog method doGetFields.
private void doGetFields() {
try {
List<String> cubeDimensions = null;
if (comboCube.getText() != null && comboCube.getText() != "") {
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
if (dbMeta != null) {
PaloCellOutputData data = new PaloCellOutputData(dbMeta);
data.helper.connect();
cubeDimensions = data.helper.getCubeDimensions(comboCube.getText());
data.helper.disconnect();
}
}
tableViewFields.table.removeAll();
for (int i = 0; i < cubeDimensions.size(); i++) {
final TableItem item = new TableItem(tableViewFields.table, SWT.NONE);
item.setText(1, cubeDimensions.get(i));
// item.setText(3, "String");
}
final TableItem item = new TableItem(tableViewFields.table, SWT.NONE);
item.setText(1, "Cube Measure");
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));
tableViewFields.removeEmptyRows();
tableViewFields.setRowNums();
tableViewFields.optWidth(true);
tableViewFields.setReadonly(true);
} else {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), new Exception(BaseMessages.getString(PKG, "PaloCellOutputDialog.SelectCubeFirstError")));
}
this.fillPreviousFieldTableViewColumn();
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke);
}
}
use of org.pentaho.di.trans.steps.palo.celloutput.PaloCellOutputData in project pentaho-kettle by pentaho.
the class PaloCellOutputDialog method doSelectConnection.
private void doSelectConnection(boolean clearCurrentData) {
try {
if (clearCurrentData) {
tableViewFields.table.removeAll();
comboCube.removeAll();
}
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
if (dbMeta != null) {
PaloCellOutputData data = new PaloCellOutputData(dbMeta);
data.helper.connect();
List<String> cubes = data.helper.getCubesNames();
Collections.sort(cubes, new PaloNameComparator());
for (String cubeName : cubes) {
if (comboCube.indexOf(cubeName) == -1) {
comboCube.add(cubeName);
}
}
data.helper.disconnect();
}
}
} catch (Exception ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "PaloCellOutputDialog.RetreiveCubesErrorTitle"), BaseMessages.getString(PKG, "PaloCellOutputDialog.RetreiveCubesError"), ex);
}
}
Aggregations