Search in sources :

Example 6 with WSTransformerProcessStepE

use of org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE in project tmdm-studio-se by Talend.

the class ProcessStepFactory method createRedirectStep.

public static WSTransformerProcessStepE createRedirectStep(Object param, String outputPipleVariable) {
    if (param == null || !(param instanceof String)) {
        throw new IllegalArgumentException();
    }
    String prefixParam = // $NON-NLS-1$
    "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:mdm=\"java:com.amalto.core.plugin.base.xslt.MdmExtension\" version=\"1.0\">\n" + // $NON-NLS-1$
    "<xsl:output method=\"xml\" indent=\"yes\" omit-xml-declaration=\"yes\"/>\n" + "<xsl:template match=\"/\" priority=\"1\">\n" + // $NON-NLS-1$//$NON-NLS-2$
    "<results>\n<item>\n<attr>";
    // $NON-NLS-1$
    String suffixParam = "</attr>\n</item>\n</results>\n</xsl:template>\n</xsl:stylesheet>";
    List<WSTransformerVariablesMappingE> inItems;
    List<WSTransformerVariablesMappingE> outItems;
    WSTransformerProcessStepE step = MdmserverobjectFactory.eINSTANCE.createWSTransformerProcessStepE();
    inItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE inputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    inputLine.setPipelineVariable(VAR_DEFAULT);
    inputLine.setPluginVariable(VAR_XML);
    inItems.add(inputLine);
    outItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE outputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    outputLine.setPipelineVariable(outputPipleVariable);
    outputLine.setPluginVariable(VAR_TEXT);
    outItems.add(outputLine);
    step.setPluginJNDI(XSLT_PLUGIN);
    // $NON-NLS-1$
    step.setDescription("Redirect");
    step.setParameters(prefixParam + param + suffixParam);
    step.getInputMappings().addAll(inItems);
    step.getOutputMappings().addAll(outItems);
    step.setDisabled(false);
    return step;
}
Also used : WSTransformerVariablesMappingE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerVariablesMappingE) WSTransformerProcessStepE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE)

Example 7 with WSTransformerProcessStepE

use of org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE in project tmdm-studio-se by Talend.

the class ProcessStepFactory method createEscapeStep.

private static WSTransformerProcessStepE createEscapeStep(Object param) {
    // Generate the XSLT step to retrieve the item from an update report
    // step
    WSTransformerProcessStepE step = MdmserverobjectFactory.eINSTANCE.createWSTransformerProcessStepE();
    List<WSTransformerVariablesMappingE> inItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE inputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    inputLine.setPipelineVariable(VAR_ITEM_XML);
    inputLine.setPluginVariable(VAR_LAW_TEXT);
    inItems.add(inputLine);
    List<WSTransformerVariablesMappingE> outItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE outputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    outputLine.setPipelineVariable(VAR_DECODE_XML);
    outputLine.setPluginVariable(VAR_CODEC_TEXT);
    outItems.add(outputLine);
    step.setPluginJNDI(CODEC_PLUGIN);
    // $NON-NLS-1$
    step.setDescription("Escape the item XML");
    String parameter = // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    "<parameters>\n" + "<method>DECODE</method>\n" + "<algorithm>XMLESCAPE</algorithm>\n" + // $NON-NLS-1$
    "</parameters>\n";
    step.setParameters(parameter);
    step.getInputMappings().addAll(inItems);
    step.getOutputMappings().addAll(outItems);
    step.setDisabled(false);
    return step;
}
Also used : WSTransformerVariablesMappingE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerVariablesMappingE) ArrayList(java.util.ArrayList) WSTransformerProcessStepE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE)

Example 8 with WSTransformerProcessStepE

use of org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE in project tmdm-studio-se by Talend.

the class ProcessStepFactory method createUpdateReportStep.

private static WSTransformerProcessStepE createUpdateReportStep(Object param) {
    String itemstr = // $NON-NLS-1$
    "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"  xmlns:mdm=\"java:com.amalto.core.plugin.base.xslt.MdmExtension\" version=\"1.0\"> <xsl:output method=\"xml\" indent=\"yes\" omit-xml-declaration=\"yes\" /> <xsl:template match=\"/\" priority=\"1\">\n" + // $NON-NLS-1$
    "<exchange> <report>\n <xsl:copy-of select=\"Update\"/> </report>  <item><xsl:copy-of select='mdm:getItemProjection(Update/RevisionID,Update/DataCluster,Update/Concept,Update/Key)'/></item></exchange> " + // $NON-NLS-1$
    "</xsl:template> </xsl:stylesheet>\n";
    List<WSTransformerVariablesMappingE> inItems;
    List<WSTransformerVariablesMappingE> outItems;
    WSTransformerProcessStepE step = MdmserverobjectFactory.eINSTANCE.createWSTransformerProcessStepE();
    inItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE inputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    inputLine.setPipelineVariable(VAR_DEFAULT);
    inputLine.setPluginVariable(VAR_XML);
    inItems.add(inputLine);
    outItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE outputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    outputLine.setPipelineVariable(VAR_ITEM_XML);
    outputLine.setPluginVariable(VAR_TEXT);
    outItems.add(outputLine);
    step.setPluginJNDI(XSLT_PLUGIN);
    // $NON-NLS-1$
    step.setDescription("UpdateReport");
    step.setParameters(itemstr);
    step.getInputMappings().addAll(inItems);
    step.getOutputMappings().addAll(outItems);
    step.setDisabled(false);
    return step;
}
Also used : WSTransformerVariablesMappingE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerVariablesMappingE) WSTransformerProcessStepE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE)

Example 9 with WSTransformerProcessStepE

use of org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE in project tmdm-studio-se by Talend.

the class ProcessStepFactory method createCallJobStep.

public static WSTransformerProcessStepE createCallJobStep(String jobName, String outputPipelineVariable, String pipleName) {
    String parameters = // $NON-NLS-1$ //$NON-NLS-2$
    "<configuration><url>ltj://" + jobName + "/0.1</url>" + "<contextParam><name>xmlInput</name><value>{" + pipleName + // $NON-NLS-1$ //$NON-NLS-2$
    "}</value></contextParam></configuration>";
    List<WSTransformerVariablesMappingE> inItems;
    List<WSTransformerVariablesMappingE> outItems;
    WSTransformerProcessStepE step = MdmserverobjectFactory.eINSTANCE.createWSTransformerProcessStepE();
    inItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE inputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    inputLine.setPipelineVariable(pipleName);
    inputLine.setPluginVariable(VAR_TEXT);
    inItems.add(inputLine);
    outItems = new ArrayList<WSTransformerVariablesMappingE>();
    WSTransformerVariablesMappingE outputLine = MdmserverobjectFactory.eINSTANCE.createWSTransformerVariablesMappingE();
    outputLine.setPipelineVariable(outputPipelineVariable);
    outputLine.setPluginVariable(VAR_RESULT);
    outItems.add(outputLine);
    step.setPluginJNDI(CALLJOB_PLUGIN);
    // $NON-NLS-1$
    step.setDescription("Call Job");
    step.setParameters(parameters);
    step.getInputMappings().addAll(inItems);
    step.getOutputMappings().addAll(outItems);
    step.setDisabled(false);
    return step;
}
Also used : WSTransformerVariablesMappingE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerVariablesMappingE) WSTransformerProcessStepE(org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE)

Aggregations

WSTransformerProcessStepE (org.talend.mdm.repository.model.mdmserverobject.WSTransformerProcessStepE)9 WSTransformerVariablesMappingE (org.talend.mdm.repository.model.mdmserverobject.WSTransformerVariablesMappingE)8 ArrayList (java.util.ArrayList)3 WSTransformerV2E (org.talend.mdm.repository.model.mdmserverobject.WSTransformerV2E)2 WSTransformerVariablesMapping (com.amalto.workbench.webservices.WSTransformerVariablesMapping)1 Execution (org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog.Execution)1 Parameter (org.talend.mdm.repository.ui.dialogs.job.JobOptionsDialog.Parameter)1