Package org.apache.beehive.netui.util.config.bean

Examples of org.apache.beehive.netui.util.config.bean.PageFlowConfig


            Document document = db.parse(is);

            PageFlowActionInterceptorsConfig pfActionInterceptorsConfig = parsePfActionInterceptorsConfig(document);
            PageFlowHandlersConfig pfHandlersConfig = parsePfHandlersConfig(document);
            PageFlowConfig pfConfig = parsePfConfig(document);
            PageFlowFactoriesConfig pfFactoriesConfig = parsePfFactoriesConfig(document);
            SharedFlowRefConfig[] sharedFlowRefConfigs = parseSharedFlowRefConfigs(document);
            RequestInterceptorsConfig requestInterceptorsConfig = parseRequestInterceptorsConfig(document);

            JspTagConfig jspTagConfig = parseJspTagConfig(document);
View Full Code Here


    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(Boolean.parseBoolean(tmp));

        tmp = DomUtils.getChildElementText(elem, "ensure-secure-forwards");
        if(tmp != null)
            ensureSecureForwards = new Boolean(Boolean.parseBoolean(tmp));

        tmp = DomUtils.getChildElementText(elem, "throw-session-expired-exception");
        if(tmp != null)
            throwSessionExpiredException = new Boolean(Boolean.parseBoolean(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,
View Full Code Here

        //
        boolean noCache = moduleConfig.getControllerConfig().getNocache();

        if ( ! noCache )
        {
            PageFlowConfig pfConfig = ConfigUtil.getConfig().getPageFlowConfig();
           
            if ( pfConfig != null )
            {
                PreventCache preventCache = pfConfig.getPreventCache();
               
                if ( preventCache != null )
                {
                    switch ( preventCache.getValue() )
                    {
View Full Code Here

        boolean isNestable = InternalUtils.isNestable( mc );
        PageFlowStack pfStack = PageFlowStack.get( request, getServletContext(), false );

        if ( isNestable && pfStack != null )
        {
            PageFlowConfig options = ConfigUtil.getConfig().getPageFlowConfig();

            if ( options == null || ! options.isEnableSelfNesting() )
            {
                int lastIndexOfJpfClass = pfStack.lastIndexOf( request, pageFlowClass );

                if ( lastIndexOfJpfClass != -1 )
                {
View Full Code Here

        }
       
        //
        // Look for ModuleConfigLocators in netui-config.xml.
        //
        PageFlowConfig pfConfig = ConfigUtil.getConfig().getPageFlowConfig();
       
        if ( pfConfig != null )
        {
            ModuleConfigLocatorConfig[] mcLocators = pfConfig.getModuleConfigLocators();
           
            if ( mcLocators != null )
            {
                for ( int i = 0; i < mcLocators.length; i++ )
                {
View Full Code Here

        return moduleConfig.getControllerConfig().getMultipartClass() != null;
    }

    public static MultipartHandler getMultipartHandlerType()
    {
        PageFlowConfig pfConfig = ConfigUtil.getConfig().getPageFlowConfig();
        return pfConfig != null ? pfConfig.getMultipartHandler() : null;
    }
View Full Code Here

    public static void throwPageFlowException( PageFlowException effect, ServletRequest request )
            throws PageFlowException
    {
        if ( request != null && effect.causeMayBeSessionExpiration() && sessionExpired( request ) )
        {
            PageFlowConfig pfc = ConfigUtil.getConfig().getPageFlowConfig();
            if ( pfc == null || pfc.isThrowSessionExpiredException() )
            {
                throw new SessionExpiredException( effect );
            }
        }
       
View Full Code Here

        return cache;
    }

    private void loadLegacySettings( ServletContext servletContext )
    {
        PageFlowConfig pageflowConfig = ConfigUtil.getConfig().getPageFlowConfig();
        assert pageflowConfig != null : "Received an invalid PageFlowConfig object";

        Integer forwardOverflowCount =
                loadLegacyParam( FORWARD_OVERFLOW_COUNT_PARAM, servletContext, "max-forwards-per-request" );
        if ( forwardOverflowCount != null )
        {
            _forwardOverflowCount = forwardOverflowCount.intValue();
        }
        else
        {
            // Why can't we read the default value from the XmlObjext?
            _forwardOverflowCount = pageflowConfig.getMaxForwardsPerRequest();
        }

        Integer nestingOverflowCount =
                loadLegacyParam( NESTING_OVERFLOW_COUNT_PARAM, servletContext, "max-nesting-stack-depth" );
        if ( nestingOverflowCount != null )
        {
            _nestingOverflowCount = nestingOverflowCount.intValue();
        }
        else
        {
            // Why can't we read the default value from the XmlObjext?
            _nestingOverflowCount = pageflowConfig.getMaxNestingStackDepth();
        }

        String doSecureForwards = servletContext.getInitParameter( SECURE_FORWARDS_PARAM );

        if ( doSecureForwards != null )
        {
            _log.warn( "Servlet context-param " + SECURE_FORWARDS_PARAM +
                       " is deprecated; use the ensure-secure-forwards element within pageflow-config in "
                       + InternalConstants.NETUI_CONFIG_PATH );
            _secureForwards = Boolean.valueOf( doSecureForwards ).booleanValue();
        }
        else
        {
            _secureForwards = pageflowConfig.isEnsureSecureForwards();
        }
       
       
    }
View Full Code Here

            Document document = db.parse(is);

            PageFlowActionInterceptorsConfig pfActionInterceptorsConfig = parsePfActionInterceptorsConfig(document);
            PageFlowHandlersConfig pfHandlersConfig = parsePfHandlersConfig(document);
            PageFlowConfig pfConfig = parsePfConfig(document);
            PageFlowFactoriesConfig pfFactoriesConfig = parsePfFactoriesConfig(document);
            SharedFlowRefConfig[] sharedFlowRefConfigs = parseSharedFlowRefConfigs(document);
            RequestInterceptorsConfig requestInterceptorsConfig = parseRequestInterceptorsConfig(document);

            JspTagConfig jspTagConfig = parseJspTagConfig(document);
View Full Code Here

    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(Boolean.parseBoolean(tmp));

        tmp = DomUtils.getChildElementText(elem, "ensure-secure-forwards");
        if(tmp != null)
            ensureSecureForwards = new Boolean(Boolean.parseBoolean(tmp));

        tmp = DomUtils.getChildElementText(elem, "throw-session-expired-exception");
        if(tmp != null)
            throwSessionExpiredException = new Boolean(Boolean.parseBoolean(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,
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.util.config.bean.PageFlowConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.