if (producer instanceof KettleTransFromFileProducer == false)
{
throw new BundleWriterException
("Invalid object type registered for handler of " + KettleTransFromFileProducer.class.getSimpleName());
}
KettleTransFromFileProducer fileProducer = (KettleTransFromFileProducer) producer;
final AttributeList coreAttrs = new AttributeList();
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "name", queryName);
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "repository", fileProducer.getRepositoryName());
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "filename", fileProducer.getTransformationFile());
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "step", fileProducer.getStepName());
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "username", fileProducer.getUsername());
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "password",
PasswordEncryptionService.getInstance().encrypt(fileProducer.getPassword()));
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "stop-on-error",
String.valueOf(fileProducer.isStopOnError()));
final String[] definedArgumentNames = fileProducer.getDefinedArgumentNames();
final ParameterMapping[] parameterMappings = fileProducer.getDefinedVariableNames();
if (definedArgumentNames.length == 0 && parameterMappings.length == 0)
{
xmlWriter.writeTag(KettleDataFactoryModule.NAMESPACE, "query-file", coreAttrs, XmlWriter.CLOSE);
return;
}