Package org.apache.beehive.netui.pageflow

Examples of org.apache.beehive.netui.pageflow.FlowController$PerRequestState


     * and checked (and removed) when processing an action with the <code>preventDoubleSubmit</code> attribute
     * set to <code>true</code>.
     */
    public static String getToken(HttpServletRequest request, String action)
    {
        FlowController flowController = PageFlowUtils.getCurrentPageFlow(request);

        if (flowController != null) {
            MappingAndController mac = getActionMapping(request, flowController, action);
            if (mac != null) return getToken(request, mac.mapping);
        }
View Full Code Here


    }

    public static MappingAndController getActionMapping(HttpServletRequest request, FlowController flowController, String action)
    {
        ActionConfig mapping = null;
        FlowController fc = null;

        if (flowController != null) {
            //
            // If there's a '.' delimiter, it's a shared flow action.
            //
            int dot = action.indexOf('.');

            if (dot == -1) {
                //
                // It's an action in the current page flow, or in the (deprecated) Global.app.
                //
                if (action.charAt(0) != '/') action = '/' + action;
                mapping = flowController.theModuleConfig().findActionConfig(action);
                fc = flowController;
               
                //
                // If we don't find it in the current page flow, look in Global.app.
                //
                if (mapping == null) {
                    FlowController globalApp =
                            PageFlowUtils.getSharedFlow(InternalConstants.GLOBALAPP_CLASSNAME, request);
                    if (globalApp != null) {
                        mapping = globalApp.theModuleConfig().findActionConfig(action);
                        fc = globalApp;
                    }
                }
            }
            else if (dot < action.length() - 1) {
                //
                // It's an action in a shared flow.
                //
                String sharedFlowName = action.substring(0, dot);
                if (sharedFlowName.length() > 0 && sharedFlowName.charAt(0) == '/') {
                    sharedFlowName = sharedFlowName.substring(1);
                }

                FlowController sharedFlow = (FlowController) PageFlowUtils.getSharedFlows(request).get(sharedFlowName);

                if (sharedFlow != null) {
                    String actionPath = '/' + action.substring(dot + 1);
                    mapping = sharedFlow.theModuleConfig().findActionConfig(actionPath);
                    fc = sharedFlow;
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.FlowController$PerRequestState

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.