use of org.pentaho.di.palo.core.PaloDimensionLevel in project pentaho-kettle by pentaho.
the class PaloDimOutputDialog method doGetFields.
private void doGetFields() {
try {
if (comboDimension.getText() != null) {
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
if (dbMeta != null) {
PaloDimOutputData data = new PaloDimOutputData(dbMeta);
tableViewFields.table.removeAll();
data.helper.connect();
List<PaloDimensionLevel> levels = data.helper.getDimensionLevels(comboDimension.getText());
for (PaloDimensionLevel level : levels) {
tableViewFields.add(String.valueOf(level.getLevelNumber()), level.getLevelName(), level.getFieldName());
}
tableViewFields.removeEmptyRows();
tableViewFields.setRowNums();
tableViewFields.optWidth(true);
data.helper.disconnect();
}
}
} else {
new ErrorDialog(shell, BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"), new Exception(BaseMessages.getString(PKG, "PaloDimOutputDialog.SelectDimensionsFirstError")));
}
this.fillPreviousFieldTableViewColumn();
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"), ke);
tableViewFields.add();
}
}
use of org.pentaho.di.palo.core.PaloDimensionLevel in project pentaho-kettle by pentaho.
the class PaloDimInputMeta method readRep.
public void readRep(Repository rep, IMetaStore metaStore, ObjectId idStep, List<DatabaseMeta> databases) throws KettleException {
try {
this.databaseMeta = rep.loadDatabaseMetaFromStepAttribute(idStep, "connection", databases);
this.dimension = rep.getStepAttributeString(idStep, "dimension");
this.baseElementsOnly = rep.getStepAttributeBoolean(idStep, "baseElementsOnly");
int nrLevels = rep.countNrStepAttributes(idStep, "levelname");
for (int i = 0; i < nrLevels; i++) {
String levelName = rep.getStepAttributeString(idStep, i, "levelname");
int levelNumber = (int) rep.getStepAttributeInteger(idStep, i, "levelnumber");
String fieldName = rep.getStepAttributeString(idStep, i, "fieldname");
String fieldType = rep.getStepAttributeString(idStep, i, "fieldtype");
this.levels.add(new PaloDimensionLevel(levelName, levelNumber, fieldName, fieldType));
}
} catch (Exception e) {
throw new KettleException("Unexpected error reading step information from the repository", e);
}
}
use of org.pentaho.di.palo.core.PaloDimensionLevel in project pentaho-kettle by pentaho.
the class PaloDimOutputMeta method readRep.
public void readRep(Repository rep, IMetaStore metaStore, ObjectId idStep, List<DatabaseMeta> databases) throws KettleException {
try {
this.databaseMeta = rep.loadDatabaseMetaFromStepAttribute(idStep, "connection", databases);
this.dimension = rep.getStepAttributeString(idStep, "dimension");
this.elementType = rep.getStepAttributeString(idStep, "elementtype");
this.createNewDimension = rep.getStepAttributeBoolean(idStep, "createdimension");
this.clearDimension = rep.getStepAttributeBoolean(idStep, "cleardimension");
this.clearConsolidations = rep.getStepAttributeBoolean(idStep, "clearconsolidations");
this.recreateDimension = rep.getStepAttributeBoolean(idStep, "recreatedimension");
this.enableElementCache = rep.getStepAttributeBoolean(idStep, "enableElementCache");
this.preloadElementCache = rep.getStepAttributeBoolean(idStep, "preloadElementCache");
int nrLevels = rep.countNrStepAttributes(idStep, "levelname");
for (int i = 0; i < nrLevels; i++) {
String levelName = rep.getStepAttributeString(idStep, i, "levelname");
int levelNumber = (int) rep.getStepAttributeInteger(idStep, i, "levelnumber");
String fieldName = rep.getStepAttributeString(idStep, i, "fieldname");
String fieldType = rep.getStepAttributeString(idStep, i, "fieldtype");
String consolidationField = rep.getStepAttributeString(idStep, i, "consolidationfieldname");
this.levels.add(new PaloDimensionLevel(levelName, levelNumber, fieldName, fieldType, consolidationField));
}
} catch (Exception e) {
throw new KettleException("Unexpected error reading step information from the repository", e);
}
}
use of org.pentaho.di.palo.core.PaloDimensionLevel in project pentaho-kettle by pentaho.
the class PaloDimInputDialog method getInfo.
private void getInfo(PaloDimInputMeta myMeta) throws KettleException {
stepname = textStepName.getText();
List<PaloDimensionLevel> levels = new ArrayList<PaloDimensionLevel>();
for (int i = 0; i < tableViewFields.table.getItemCount(); i++) {
PaloDimensionLevel level = new PaloDimensionLevel(tableViewFields.table.getItem(i).getText(1), Integer.parseInt(tableViewFields.table.getItem(i).getText(2)), tableViewFields.table.getItem(i).getText(3), tableViewFields.table.getItem(i).getText(4));
levels.add(level);
}
myMeta.setDatabaseMeta(transMeta.findDatabase(addConnectionLine.getText()));
myMeta.setLevels(levels);
myMeta.setDimension(comboDimension.getText());
myMeta.setBaseElementsOnly(buttonBaseElementsOnly.getSelection());
myMeta.setChanged(true);
}
Aggregations