Search in sources :

Example 6 with PaloNameComparator

use of org.pentaho.di.palo.core.PaloNameComparator 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);
    }
}
Also used : PaloNameComparator(org.pentaho.di.palo.core.PaloNameComparator) PaloCellOutputData(org.pentaho.di.trans.steps.palo.celloutput.PaloCellOutputData) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) KettleException(org.pentaho.di.core.exception.KettleException)

Aggregations

DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)6 PaloNameComparator (org.pentaho.di.palo.core.PaloNameComparator)6 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)6 KettleException (org.pentaho.di.core.exception.KettleException)4 PaloHelper (org.pentaho.di.palo.core.PaloHelper)2 PaloCellInputData (org.pentaho.di.trans.steps.palo.cellinput.PaloCellInputData)1 PaloCellOutputData (org.pentaho.di.trans.steps.palo.celloutput.PaloCellOutputData)1 PaloDimInputData (org.pentaho.di.trans.steps.palo.diminput.PaloDimInputData)1 PaloDimOutputData (org.pentaho.di.trans.steps.palo.dimoutput.PaloDimOutputData)1 ColumnInfo (org.pentaho.di.ui.core.widget.ColumnInfo)1