use of org.pentaho.di.palo.core.PaloNameComparator in project pentaho-kettle by pentaho.
the class PaloCubeDeleteDialog method doSelectConnection.
private void doSelectConnection(boolean clearCurrentData) {
try {
if (clearCurrentData) {
comboCubeName.removeAll();
}
if (comboCubeName.getItemCount() > 1) {
return;
}
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = DatabaseMeta.findDatabase(jobMeta.getDatabases(), addConnectionLine.getText());
if (dbMeta != null) {
PaloHelper helper = new PaloHelper(dbMeta, DefaultLogLevel.getLogLevel());
helper.connect();
List<String> cubes = helper.getCubesNames();
Collections.sort(cubes, new PaloNameComparator());
for (String cubename : cubes) {
if (comboCubeName.indexOf(cubename) == -1) {
comboCubeName.add(cubename);
}
}
helper.disconnect();
}
}
} catch (Exception ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "PaloDimInputFlatDialog.RetreiveDimensionsErrorTitle"), BaseMessages.getString(PKG, "PaloDimInputFlatDialog.RetreiveDimensionsError"), ex);
}
}
use of org.pentaho.di.palo.core.PaloNameComparator in project pentaho-kettle by pentaho.
the class PaloDimInputDialog 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) {
PaloDimInputData data = new PaloDimInputData(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, "PaloDimInputDialog.RetreiveDimensionsErrorTitle"), BaseMessages.getString(PKG, "PaloDimInputDialog.RetreiveDimensionsError"), ex);
}
}
use of org.pentaho.di.palo.core.PaloNameComparator 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.palo.core.PaloNameComparator in project pentaho-kettle by pentaho.
the class PaloCubeCreateDialog method doBuildDimensionList.
private void doBuildDimensionList() {
if (comboDropDown == null && addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = DatabaseMeta.findDatabase(jobMeta.getDatabases(), addConnectionLine.getText());
if (dbMeta != null) {
PaloHelper helper = new PaloHelper(dbMeta, DefaultLogLevel.getLogLevel());
try {
helper.connect();
List<String> dimensionNames = helper.getDimensionsNames();
List<String> dimensions = helper.getDimensionsNames();
Collections.sort(dimensions, new PaloNameComparator());
comboDropDown = new ColumnInfo("Field", ColumnInfo.COLUMN_TYPE_CCOMBO, dimensions.toArray(new String[dimensionNames.size()]), true);
tableViewFields.setColumnInfo(0, comboDropDown);
} catch (Exception ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "PaloCellOutputDialog.RetreiveCubesErrorTitle"), BaseMessages.getString(PKG, "PaloCellOutputDialog.RetreiveCubesError"), ex);
} finally {
helper.disconnect();
}
}
}
}
use of org.pentaho.di.palo.core.PaloNameComparator in project pentaho-kettle by pentaho.
the class PaloCellInputDialog 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) {
PaloCellInputData data = new PaloCellInputData(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, "PaloCellInputDialog.RetreiveCubesErrorTitle"), BaseMessages.getString(PKG, "PaloCellInputDialog.RetreiveCubesError"), ex);
}
}
Aggregations