use of org.pentaho.di.trans.steps.mapping.MappingParameters in project pentaho-kettle by pentaho.
the class SimpleMappingMeta method readRep.
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
String method = rep.getStepAttributeString(id_step, "specification_method");
specificationMethod = ObjectLocationSpecificationMethod.getSpecificationMethodByCode(method);
String transId = rep.getStepAttributeString(id_step, "trans_object_id");
transObjectId = Utils.isEmpty(transId) ? null : new StringObjectId(transId);
transName = rep.getStepAttributeString(id_step, "trans_name");
fileName = rep.getStepAttributeString(id_step, "filename");
directoryPath = rep.getStepAttributeString(id_step, "directory_path");
// Backward compatibility check for object specification
//
checkObjectLocationSpecificationMethod();
inputMapping = new MappingIODefinition(rep, id_step, "input_", 0);
outputMapping = new MappingIODefinition(rep, id_step, "output_", 0);
mappingParameters = new MappingParameters(rep, id_step);
}
use of org.pentaho.di.trans.steps.mapping.MappingParameters in project pentaho-kettle by pentaho.
the class SimpleMappingMeta method loadXML.
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
try {
String method = XMLHandler.getTagValue(stepnode, "specification_method");
specificationMethod = ObjectLocationSpecificationMethod.getSpecificationMethodByCode(method);
String transId = XMLHandler.getTagValue(stepnode, "trans_object_id");
transObjectId = Utils.isEmpty(transId) ? null : new StringObjectId(transId);
transName = XMLHandler.getTagValue(stepnode, "trans_name");
fileName = XMLHandler.getTagValue(stepnode, "filename");
directoryPath = XMLHandler.getTagValue(stepnode, "directory_path");
// Backward compatibility check for object specification
//
checkObjectLocationSpecificationMethod();
Node mappingsNode = XMLHandler.getSubNode(stepnode, "mappings");
if (mappingsNode == null) {
throw new KettleXMLException("Unable to find <mappings> element in the step XML");
}
// Read all the input mapping definitions...
//
Node inputNode = XMLHandler.getSubNode(mappingsNode, "input");
Node mappingNode = XMLHandler.getSubNode(inputNode, MappingIODefinition.XML_TAG);
if (mappingNode != null) {
inputMapping = new MappingIODefinition(mappingNode);
} else {
// empty
inputMapping = new MappingIODefinition();
}
Node outputNode = XMLHandler.getSubNode(mappingsNode, "output");
mappingNode = XMLHandler.getSubNode(outputNode, MappingIODefinition.XML_TAG);
if (mappingNode != null) {
outputMapping = new MappingIODefinition(mappingNode);
} else {
// empty
outputMapping = new MappingIODefinition();
}
// Load the mapping parameters too..
//
Node mappingParametersNode = XMLHandler.getSubNode(mappingsNode, MappingParameters.XML_TAG);
mappingParameters = new MappingParameters(mappingParametersNode);
} catch (Exception e) {
throw new KettleXMLException(BaseMessages.getString(PKG, "SimpleMappingMeta.Exception.ErrorLoadingTransformationStepFromXML"), e);
}
}
use of org.pentaho.di.trans.steps.mapping.MappingParameters in project pentaho-kettle by pentaho.
the class MappingParametersLoadSaveValidator method getTestObject.
@Override
public MappingParameters getTestObject() {
MappingParameters rtn = new MappingParameters();
rtn.setVariable(new String[] { UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString() });
rtn.setInputField(new String[] { UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString() });
rtn.setInheritingAllVariables(rand.nextBoolean());
return rtn;
}
Aggregations