Search in sources :

Example 11 with PaloHelper

use of org.pentaho.di.palo.core.PaloHelper in project pentaho-kettle by pentaho.

the class PaloCellInputMeta method getFields.

@Override
public void getFields(final RowMetaInterface row, final String origin, final RowMetaInterface[] info, final StepMeta nextStep, final VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (databaseMeta == null) {
        throw new KettleStepException("There is no Palo database server connection defined");
    }
    final PaloHelper helper = new PaloHelper(databaseMeta, DefaultLogLevel.getLogLevel());
    try {
        helper.connect();
        try {
            final RowMetaInterface rowMeta = helper.getCellRowMeta(this.cube, this.fields, this.cubeMeasure);
            row.addRowMeta(rowMeta);
        } finally {
            helper.disconnect();
        }
    } catch (Exception e) {
        throw new KettleStepException(e);
    }
}
Also used : PaloHelper(org.pentaho.di.palo.core.PaloHelper) KettleStepException(org.pentaho.di.core.exception.KettleStepException) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException)

Example 12 with PaloHelper

use of org.pentaho.di.palo.core.PaloHelper in project pentaho-kettle by pentaho.

the class PaloDimInput method init.

public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
    meta = (PaloDimInputMeta) smi;
    data = (PaloDimInputData) sdi;
    if (super.init(smi, sdi)) {
        try {
            this.logDebug("Meta Levels: " + meta.getLevels().size());
            data.helper = new PaloHelper(meta.getDatabaseMeta(), getLogLevel());
            data.helper.connect();
            return true;
        } catch (Exception e) {
            logError("An error occurred, processing will be stopped: " + e.getMessage());
            setErrors(1);
            stopAll();
        }
    }
    return false;
}
Also used : PaloHelper(org.pentaho.di.palo.core.PaloHelper) KettleException(org.pentaho.di.core.exception.KettleException)

Example 13 with PaloHelper

use of org.pentaho.di.palo.core.PaloHelper in project pentaho-kettle by pentaho.

the class PaloDimInputMeta method getFields.

public void getFields(final RowMetaInterface row, final String origin, final RowMetaInterface[] info, final StepMeta nextStep, final VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    if (databaseMeta == null) {
        throw new KettleStepException("There is no Palo database server connection defined");
    }
    final PaloHelper helper = new PaloHelper(databaseMeta, DefaultLogLevel.getLogLevel());
    try {
        helper.connect();
        try {
            final RowMetaInterface rowMeta = helper.getDimensionRowMeta(this.getDimension(), this.getLevels(), this.getBaseElementsOnly());
            row.addRowMeta(rowMeta);
        } finally {
            helper.disconnect();
        }
    } catch (Exception e) {
        throw new KettleStepException(e);
    }
}
Also used : PaloHelper(org.pentaho.di.palo.core.PaloHelper) KettleStepException(org.pentaho.di.core.exception.KettleStepException) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) KettleException(org.pentaho.di.core.exception.KettleException) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleStepException(org.pentaho.di.core.exception.KettleStepException)

Example 14 with PaloHelper

use of org.pentaho.di.palo.core.PaloHelper 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();
            }
        }
    }
}
Also used : PaloHelper(org.pentaho.di.palo.core.PaloHelper) PaloNameComparator(org.pentaho.di.palo.core.PaloNameComparator) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta)

Aggregations

PaloHelper (org.pentaho.di.palo.core.PaloHelper)14 KettleException (org.pentaho.di.core.exception.KettleException)12 CheckResult (org.pentaho.di.core.CheckResult)4 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)4 Result (org.pentaho.di.core.Result)2 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)2 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)2 KettleStepException (org.pentaho.di.core.exception.KettleStepException)2 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)2 DimensionField (org.pentaho.di.palo.core.DimensionField)2 PaloDimensionLevel (org.pentaho.di.palo.core.PaloDimensionLevel)2 PaloNameComparator (org.pentaho.di.palo.core.PaloNameComparator)2 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)2 ConsolidationCollection (org.pentaho.di.palo.core.ConsolidationCollection)1 ColumnInfo (org.pentaho.di.ui.core.widget.ColumnInfo)1