use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.
the class AppendMeta method readRep.
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
try {
List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
StreamInterface headStream = infoStreams.get(0);
StreamInterface tailStream = infoStreams.get(1);
headStream.setSubject(rep.getStepAttributeString(id_step, "head_name"));
tailStream.setSubject(rep.getStepAttributeString(id_step, "tail_name"));
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG, "AppendMeta.Exception.UnexpectedErrorReadingStepInfo"), e);
}
}
use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.
the class AppendMeta method check.
public void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository, IMetaStore metaStore) {
CheckResult cr;
List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
StreamInterface headStream = infoStreams.get(0);
StreamInterface tailStream = infoStreams.get(1);
if (headStream.getStepname() != null && tailStream.getStepname() != null) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "AppendMeta.CheckResult.SourceStepsOK"), stepMeta);
remarks.add(cr);
} else if (headStream.getStepname() == null && tailStream.getStepname() == null) {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "AppendMeta.CheckResult.SourceStepsMissing"), stepMeta);
remarks.add(cr);
} else {
cr = new CheckResult(CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString(PKG, "AppendMeta.CheckResult.OneSourceStepMissing"), stepMeta);
remarks.add(cr);
}
}
use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.
the class AppendMeta method saveRep.
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException {
try {
List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
StreamInterface headStream = infoStreams.get(0);
StreamInterface tailStream = infoStreams.get(1);
rep.saveStepAttribute(id_transformation, id_step, "head_name", headStream.getStepname());
rep.saveStepAttribute(id_transformation, id_step, "tail_name", tailStream.getStepname());
} catch (Exception e) {
throw new KettleException(BaseMessages.getString(PKG, "AppendMeta.Exception.UnableToSaveStepInfo") + id_step, e);
}
}
use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.
the class FuzzyMatchDialog method getData.
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
if (isDebug()) {
logDebug(BaseMessages.getString(PKG, "FuzzyMatchDialog.Log.GettingKeyInfo"));
}
wAlgorithm.setText(FuzzyMatchMeta.getAlgorithmTypeDesc(input.getAlgorithmType()));
if (input.getMainStreamField() != null) {
wMainStreamField.setText(input.getMainStreamField());
}
if (input.getLookupField() != null) {
wLookupField.setText(input.getLookupField());
}
wcaseSensitive.setSelection(input.isCaseSensitive());
wgetCloserValue.setSelection(input.isGetCloserValue());
if (input.getMinimalValue() != null) {
wminValue.setText(input.getMinimalValue());
}
if (input.getMaximalValue() != null) {
wmaxValue.setText(input.getMaximalValue());
}
if (input.getOutputMatchField() != null) {
wmatchField.setText(input.getOutputMatchField());
}
if (input.getOutputValueField() != null) {
wvalueField.setText(input.getOutputValueField());
}
if (input.getSeparator() != null) {
wseparator.setText(input.getSeparator());
}
if (input.getValue() != null) {
for (int i = 0; i < input.getValue().length; i++) {
TableItem item = wReturn.table.getItem(i);
if (input.getValue()[i] != null) {
item.setText(1, input.getValue()[i]);
}
if (input.getValueName()[i] != null && !input.getValueName()[i].equals(input.getValue()[i])) {
item.setText(2, input.getValueName()[i]);
}
}
}
StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get(0);
wStep.setText(Const.NVL(infoStream.getStepname(), ""));
wReturn.setRowNums();
wReturn.optWidth(true);
wStepname.selectAll();
wStepname.setFocus();
}
use of org.pentaho.di.trans.step.errorhandling.StreamInterface in project pentaho-kettle by pentaho.
the class MergeJoinDialog method getData.
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
List<StreamInterface> infoStreams = input.getStepIOMeta().getInfoStreams();
wStep1.setText(Const.NVL(infoStreams.get(0).getStepname(), ""));
wStep2.setText(Const.NVL(infoStreams.get(1).getStepname(), ""));
String joinType = input.getJoinType();
if (joinType != null && joinType.length() > 0) {
wType.setText(joinType);
} else {
wType.setText(MergeJoinMeta.join_types[0]);
}
for (int i = 0; i < input.getKeyFields1().length; i++) {
TableItem item = wKeys1.table.getItem(i);
if (input.getKeyFields1()[i] != null) {
item.setText(1, input.getKeyFields1()[i]);
}
}
for (int i = 0; i < input.getKeyFields2().length; i++) {
TableItem item = wKeys2.table.getItem(i);
if (input.getKeyFields2()[i] != null) {
item.setText(1, input.getKeyFields2()[i]);
}
}
wStepname.selectAll();
wStepname.setFocus();
}
Aggregations