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);
}
}
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;
}
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);
}
}
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();
}
}
}
}
Aggregations