use of org.apache.hop.core.exception.HopXmlException in project hop by apache.
the class TransformMeta method fromXml.
public static TransformMeta fromXml(String metaXml) {
Document doc;
try {
doc = XmlHandler.loadXmlString(metaXml);
Node transformNode = XmlHandler.getSubNode(doc, "transform");
return new TransformMeta(transformNode, null);
} catch (HopXmlException | HopPluginLoaderException e) {
throw new RuntimeException(e);
}
}
use of org.apache.hop.core.exception.HopXmlException in project hop by apache.
the class ActionFileExists method loadXml.
@Override
public void loadXml(Node entrynode, IHopMetadataProvider metadataProvider, IVariables variables) throws HopXmlException {
try {
super.loadXml(entrynode);
filename = XmlHandler.getTagValue(entrynode, "filename");
} catch (HopXmlException xe) {
throw new HopXmlException(BaseMessages.getString(PKG, "ActionFileExists.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node"), xe);
}
}
use of org.apache.hop.core.exception.HopXmlException in project hop by apache.
the class ActionFtp method loadXml.
@Override
public void loadXml(Node entryNode, IHopMetadataProvider metadataProvider, IVariables variables) throws HopXmlException {
try {
super.loadXml(entryNode);
serverPort = XmlHandler.getTagValue(entryNode, "port");
serverName = XmlHandler.getTagValue(entryNode, "servername");
userName = XmlHandler.getTagValue(entryNode, "username");
password = Encr.decryptPasswordOptionallyEncrypted(XmlHandler.getTagValue(entryNode, "password"));
remoteDirectory = XmlHandler.getTagValue(entryNode, "ftpdirectory");
targetDirectory = XmlHandler.getTagValue(entryNode, "targetdirectory");
wildcard = XmlHandler.getTagValue(entryNode, "wildcard");
binaryMode = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "binary"));
timeout = Const.toInt(XmlHandler.getTagValue(entryNode, "timeout"), 10000);
remove = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "remove"));
onlyGettingNewFiles = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "only_new"));
activeConnection = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "active"));
controlEncoding = XmlHandler.getTagValue(entryNode, "control_encoding");
if (controlEncoding == null) {
// if we couldn't retrieve an encoding, assume it's an old instance and
// put in the the encoding used before v 2.4.0
controlEncoding = LEGACY_CONTROL_ENCODING;
}
moveFiles = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "movefiles"));
moveToDirectory = XmlHandler.getTagValue(entryNode, "movetodirectory");
addDate = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "adddate"));
addTime = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "addtime"));
specifyFormat = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "SpecifyFormat"));
dateTimeFormat = XmlHandler.getTagValue(entryNode, "date_time_format");
addDateBeforeExtension = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "AddDateBeforeExtension"));
String addresult = XmlHandler.getTagValue(entryNode, "isaddresult");
if (Utils.isEmpty(addresult)) {
isAddResult = true;
} else {
isAddResult = "Y".equalsIgnoreCase(addresult);
}
createMoveFolder = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entryNode, "createmovefolder"));
proxyHost = XmlHandler.getTagValue(entryNode, "proxy_host");
proxyPort = XmlHandler.getTagValue(entryNode, "proxy_port");
proxyUsername = XmlHandler.getTagValue(entryNode, "proxy_username");
proxyPassword = Encr.decryptPasswordOptionallyEncrypted(XmlHandler.getTagValue(entryNode, "proxy_password"));
socksProxyHost = XmlHandler.getTagValue(entryNode, "socksproxy_host");
socksProxyPort = XmlHandler.getTagValue(entryNode, "socksproxy_port");
socksProxyUsername = XmlHandler.getTagValue(entryNode, "socksproxy_username");
socksProxyPassword = Encr.decryptPasswordOptionallyEncrypted(XmlHandler.getTagValue(entryNode, "socksproxy_password"));
stringIfFileExists = XmlHandler.getTagValue(entryNode, "ifFileExists");
if (Utils.isEmpty(stringIfFileExists)) {
ifFileExists = ifFileExistsSkip;
} else {
if (stringIfFileExists.equals(STRING_IF_FILE_EXISTS_CREATE_UNIQ)) {
ifFileExists = ifFileExistsCreateUniq;
} else if (stringIfFileExists.equals(STRING_IF_FILE_EXISTS_FAIL)) {
ifFileExists = ifFileExistsFail;
} else {
ifFileExists = ifFileExistsSkip;
}
}
nrLimit = XmlHandler.getTagValue(entryNode, "nr_limit");
successCondition = Const.NVL(XmlHandler.getTagValue(entryNode, "success_condition"), SUCCESS_IF_NO_ERRORS);
} catch (HopXmlException xe) {
throw new HopXmlException("Unable to load action of type 'ftp' from XML node", xe);
}
}
use of org.apache.hop.core.exception.HopXmlException in project hop by apache.
the class ActionFoldersCompare method loadXml.
@Override
public void loadXml(Node entrynode, IHopMetadataProvider metadataProvider, IVariables variables) throws HopXmlException {
try {
super.loadXml(entrynode);
includesubfolders = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entrynode, "include_subfolders"));
comparefilecontent = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entrynode, "compare_filecontent"));
comparefilesize = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entrynode, "compare_filesize"));
compareonly = XmlHandler.getTagValue(entrynode, "compareonly");
wildcard = XmlHandler.getTagValue(entrynode, "wildcard");
filename1 = XmlHandler.getTagValue(entrynode, "filename1");
filename2 = XmlHandler.getTagValue(entrynode, "filename2");
} catch (HopXmlException xe) {
throw new HopXmlException(BaseMessages.getString(PKG, "ActionFoldersCompare.Meta.UnableLoadXML", xe.getMessage()));
}
}
use of org.apache.hop.core.exception.HopXmlException in project hop by apache.
the class ActionFolderIsEmpty method loadXml.
@Override
public void loadXml(Node entrynode, IHopMetadataProvider metadataProvider, IVariables variables) throws HopXmlException {
try {
super.loadXml(entrynode);
folderName = XmlHandler.getTagValue(entrynode, "foldername");
includeSubfolders = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entrynode, "include_subfolders"));
specifyWildcard = "Y".equalsIgnoreCase(XmlHandler.getTagValue(entrynode, "specify_wildcard"));
wildcard = XmlHandler.getTagValue(entrynode, "wildcard");
} catch (HopXmlException xe) {
throw new HopXmlException("Unable to load action of type 'create folder' from XML node", xe);
}
}
Aggregations