private static final PageFlowConfig parsePfConfig()

in ti/phase2/jars/core/src/java/org/apache/ti/util/config/parser/NetUIConfigParser.java [335:415]


    private static final PageFlowConfig parsePfConfig(Document document) {
        Element elem = DomUtils.getChildElementByName(document.getDocumentElement(), "pageflow-config");

        if (elem == null) {
            return new PageFlowConfig();
        }

        PageFlowConfig pfConfig = null;

        Boolean enableSelfNesting = null;
        Boolean ensureSecureForwards = null;
        Boolean throwSessionExpiredException = null;
        Integer maxForwardsPerRequest = null;
        Integer maxNestingStackDepth = null;
        MultipartHandler mpHandler = null;
        PreventCache preventCache = null;
        ModuleConfigLocatorConfig[] moduleConfigLocators = null;

        String tmp = null;

        tmp = DomUtils.getChildElementText(elem, "enable-self-nesting");

        if (tmp != null) {
            enableSelfNesting = new Boolean(tmp);
        }

        tmp = DomUtils.getChildElementText(elem, "ensure-secure-forwards");

        if (tmp != null) {
            ensureSecureForwards = new Boolean(tmp);
        }

        tmp = DomUtils.getChildElementText(elem, "throw-session-expired-exception");

        if (tmp != null) {
            throwSessionExpiredException = new Boolean(tmp);
        }

        tmp = DomUtils.getChildElementText(elem, "max-forwards-per-request");

        if (tmp != null) {
            maxForwardsPerRequest = new Integer(Integer.parseInt(tmp));
        }

        tmp = DomUtils.getChildElementText(elem, "max-nesting-stack-depth");

        if (tmp != null) {
            maxNestingStackDepth = new Integer(Integer.parseInt(tmp));
        }

        tmp = DomUtils.getChildElementText(elem, "multipart-handler");

        if (tmp != null) {
            if (tmp.equals("disabled")) {
                mpHandler = MultipartHandler.DISABLED;
            } else if (tmp.equals("disk")) {
                mpHandler = MultipartHandler.DISK;
            } else if (tmp.equals("memory")) {
                mpHandler = MultipartHandler.MEMORY;
            }
        }

        tmp = DomUtils.getChildElementText(elem, "prevent-cache");

        if (tmp != null) {
            if (tmp.equals("always")) {
                preventCache = PreventCache.ALWAYS;
            } else if (tmp.equals("default")) {
                preventCache = PreventCache.DEFAULT;
            } else if (tmp.equals("inDevMode")) {
                preventCache = PreventCache.IN_DEV_MODE;
            }
        }

        moduleConfigLocators = parseModuleConfigLocators(DomUtils.getChildElementByName(elem, "module-config-locators"));

        pfConfig = new PageFlowConfig(enableSelfNesting, ensureSecureForwards, throwSessionExpiredException,
                                      maxForwardsPerRequest, maxNestingStackDepth, mpHandler, preventCache, moduleConfigLocators);

        return pfConfig;
    }