Search in sources :

Example 1 with ReadFileStep

use of com.twinsoft.convertigo.beans.steps.ReadFileStep in project convertigo by convertigo.

the class DatabaseObjectsManager method replaceXpath.

private void replaceXpath(String version, Sequence sequence, List<String> definition) {
    if (definition.size() > 0) {
        String xpath = definition.get(1);
        if (xpath.startsWith("./")) {
            Long key = Long.valueOf(definition.get(0));
            Step sourceStep = sequence.loadedSteps.get(key);
            if (sourceStep != null) {
                if (VersionUtils.compare(version, "4.6.0") < 0) {
                    if (sourceStep instanceof RequestableStep) {
                        String replace = (sourceStep instanceof TransactionStep) ? "transaction" : "sequence";
                        xpath = xpath.replaceFirst("./", "./" + replace + "/document/");
                        definition.set(1, xpath);
                    }
                } else if (VersionUtils.compare(version, "6.2.0") < 0) {
                    if (sourceStep instanceof ReadFileStep) {
                        xpath = ((ReadFileStep) sourceStep).migrateSourceXpathFor620(xpath);
                        definition.set(1, xpath);
                    }
                }
            }
        }
    }
}
Also used : TransactionStep(com.twinsoft.convertigo.beans.steps.TransactionStep) RequestableStep(com.twinsoft.convertigo.beans.core.RequestableStep) Step(com.twinsoft.convertigo.beans.core.Step) RequestableStep(com.twinsoft.convertigo.beans.core.RequestableStep) ReadFileStep(com.twinsoft.convertigo.beans.steps.ReadFileStep) XMLActionStep(com.twinsoft.convertigo.beans.steps.XMLActionStep) XMLGenerateDatesStep(com.twinsoft.convertigo.beans.steps.XMLGenerateDatesStep) TransactionStep(com.twinsoft.convertigo.beans.steps.TransactionStep) ReadFileStep(com.twinsoft.convertigo.beans.steps.ReadFileStep)

Aggregations

RequestableStep (com.twinsoft.convertigo.beans.core.RequestableStep)1 Step (com.twinsoft.convertigo.beans.core.Step)1 ReadFileStep (com.twinsoft.convertigo.beans.steps.ReadFileStep)1 TransactionStep (com.twinsoft.convertigo.beans.steps.TransactionStep)1 XMLActionStep (com.twinsoft.convertigo.beans.steps.XMLActionStep)1 XMLGenerateDatesStep (com.twinsoft.convertigo.beans.steps.XMLGenerateDatesStep)1