Package javax.faces.flow

Examples of javax.faces.flow.FlowHandler


            } else {
                UIViewRoot newRoot = viewHandler.createView(context,
                                                            caseStruct.viewId);
                updateRenderTargets(context, caseStruct.viewId);
                context.setViewRoot(newRoot);
                FlowHandler flowHandler = context.getApplication().getFlowHandler();
                if (null != flowHandler) {
                    flowHandler.transition(context,
                            caseStruct.currentFlow, caseStruct.newFlow,
                            caseStruct.facesFlowCallNode, caseStruct.viewId);
                }
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "Set new view in FacesContext for {0}", caseStruct.viewId);
View Full Code Here


        NavigationInfo info = null;
        if (null == navigationMaps) {
            createNavigationMaps();
            result = navigationMaps.get(ROOT_NAVIGATION_MAP_ID).ruleSet;
        } else {
            FlowHandler fh = context.getApplication().getFlowHandler();
            if (null != fh) {
                Flow currentFlow = fh.getCurrentFlow(context);
                if (null != currentFlow) {
                    info = navigationMaps.get(currentFlow.getDefiningDocumentId() + currentFlow.getId());
                    // We are in a flow, but there are no navigation rules for
                    // this flow.
                    if (null == info) {
View Full Code Here

    }
   
    private Set<String> getWildCardMatchList(FacesContext context) {
        Set<String> result = Collections.emptySet();
        NavigationInfo info = null;
        FlowHandler fh = context.getApplication().getFlowHandler();
        if (null != fh) {
            Flow currentFlow = fh.getCurrentFlow(context);
            if (null != currentFlow) {
                info = navigationMaps.get(currentFlow.getDefiningDocumentId() + currentFlow.getId());
            }
        }
        if (null == info) {
View Full Code Here

    private NavigationInfo getNavigationInfo(FacesContext context, String toFlowDocumentId, String flowId) {
        NavigationInfo result = null;
        assert(null != navigationMaps);
        result = navigationMaps.get(toFlowDocumentId + flowId);
        if (null == result) {
            FlowHandler fh = context.getApplication().getFlowHandler();
            if (null != fh) {
                Flow currentFlow = fh.getCurrentFlow(context);
                if (null != currentFlow) {
                    result = navigationMaps.get(currentFlow.getDefiningDocumentId() + currentFlow.getId());
                }
            }
        }
View Full Code Here

        // 3) elements specifying only from-action
        // 4) elements where both from-action and from-outcome are null
       
        CaseStruct result = determineViewFromActionOutcome(ctx, caseSet, fromAction, outcome, toFlowDocumentId);
        if (null != result) {
            FlowHandler flowHandler = ctx.getApplication().getFlowHandler();
            if (null != flowHandler) {
                result.currentFlow = flowHandler.getCurrentFlow(ctx);
                result.newFlow = result.currentFlow;
            }
        }

        return result;
View Full Code Here

            if (result != null) {
                break;
            }
        }
        if (null != result) {
            FlowHandler flowHandler = ctx.getApplication().getFlowHandler();
            if (null != flowHandler) {
                result.currentFlow = flowHandler.getCurrentFlow(ctx);
                result.newFlow = result.currentFlow;
            }
        }
       
        return result;
View Full Code Here

        // 4) elements where both from-action and from-outcome are null

        CaseStruct result = determineViewFromActionOutcome(ctx, caseSet, fromAction, outcome, toFlowDocumentId);
       
        if (null != result) {
            FlowHandler flowHandler = ctx.getApplication().getFlowHandler();
            if (null != flowHandler) {
                result.currentFlow = flowHandler.getCurrentFlow(ctx);
                result.newFlow = result.currentFlow;
            }
        }
       
        return result;
View Full Code Here

                viewIdToTest = "/" + viewIdToTest;
            }
        }

        ViewHandler viewHandler = Util.getViewHandler(context);
        FlowHandler flowHandler = context.getApplication().getFlowHandler();
        Flow currentFlow = null;
        Flow newFlow = null;

        if (null != flowHandler) {
           
            currentFlow = flowHandler.getCurrentFlow(context);
            newFlow = currentFlow;
            // If we are in a flow, use the implicit rules to ensure the view
            // is within that flow.  This means viewIdToTest must start with
            // the current flow id
            if (null != currentFlow && null != viewIdToTest &&
View Full Code Here

   
    private CaseStruct findSwitchMatch(FacesContext context, String fromAction,
                                       String outcome, String toFlowDocumentId) {
        CaseStruct result = null;
        NavigationInfo info = getNavigationInfo(context, toFlowDocumentId, fromAction);
        FlowHandler flowHandler = context.getApplication().getFlowHandler();
       
        if (null != flowHandler &&
            null != info && null != info.switches && !info.switches.isEmpty()) {
            SwitchNode switchNode = info.switches.get(outcome);
            if (null != switchNode) {
                List<SwitchCase> cases = switchNode.getCases();
                for (SwitchCase cur : cases) {
                    if (cur.getCondition(context)) {
                        outcome = cur.getFromOutcome();
                        Flow newFlow = flowHandler.getFlow(context, toFlowDocumentId,
                                fromAction);
                        // If this outcome corresponds to an existing flow...
                        if (null != newFlow) {
                            result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                        } else {
                            newFlow = flowHandler.getCurrentFlow(context);
                            if (null != newFlow) {
                                result = synthesizeCaseStruct(context, newFlow, fromAction, outcome);
                            }
                        }
                        if (null != result) {
                            break;
                        }
                    }
                }
                if (null == result) {
                    outcome = switchNode.getDefaultOutcome(context);
                    if (null != outcome) {
                        Flow currentFlow = flowHandler.getCurrentFlow(context);
                        if (null != currentFlow) {
                            result = synthesizeCaseStruct(context, currentFlow, fromAction, outcome);
                            if (null != result) {
                                result.currentFlow = currentFlow;
                                result.newFlow = currentFlow;
View Full Code Here

        Map<String, String> requestParamMap = context.getExternalContext().getRequestParameterMap();
        String toFlowDocumentId = requestParamMap.get(TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME);
        String flowId = requestParamMap.get(FLOW_ID_REQUEST_PARAM_NAME);
        if (null != toFlowDocumentId) {
            // don't use *this*, due to decoration
            FlowHandler fh = context.getApplication().getFlowHandler();
            Flow sourceFlow = fh.getCurrentFlow(context);
            Flow targetFlow = null;           
            FlowCallNode flowCallNode = null;
            // if this is not a return...
            if (null != flowId && !FlowHandler.NULL_FLOW.equals(toFlowDocumentId)) {
                targetFlow = fh.getFlow(context, toFlowDocumentId, flowId);
                if (null != targetFlow && null != sourceFlow) {
                    flowCallNode = sourceFlow.getFlowCall(targetFlow);
                }
            } else {
                String maxReturnDepthStr = requestParamMap.get(FLOW_RETURN_DEPTH_PARAM_NAME);
                int maxReturnDepth = Integer.valueOf(maxReturnDepthStr).intValue();
                FlowDeque<Flow> flowStack = getFlowStack(context);
                flowStack.setMaxReturnDepth(context, maxReturnDepth);
            }
           
            fh.transition(context, sourceFlow, targetFlow, flowCallNode, context.getViewRoot().getViewId());
           
        }
    }
View Full Code Here

TOP

Related Classes of javax.faces.flow.FlowHandler

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.