Package javax.faces.flow

Examples of javax.faces.flow.Flow


                if (null != url && matches.hasMoreElements()) {
                    boolean keepGoing = true;
                    FacesContext context = FacesContext.getCurrentInstance();
                    Application application = context.getApplication();
                    FlowHandler fh = application.getFlowHandler();
                    Flow currentFlow = fh.getCurrentFlow(context);
                    do {
                        if (null != currentFlow && 0 < currentFlow.getDefiningDocumentId().length()) {
                            String definingDocumentId = currentFlow.getDefiningDocumentId();
                            ExternalContext extContext = context.getExternalContext();
                            ApplicationAssociate associate = ApplicationAssociate.getInstance(extContext);
                            if (associate.urlIsRelatedToDefiningDocumentInJar(url, definingDocumentId)) {
                                keepGoing = false;
                                doNotCache = true;
View Full Code Here


        Map<Contextual<?>, Object> result;
        FacesContext context = FacesContext.getCurrentInstance();
        ExternalContext extContext = context.getExternalContext();
        Map<String, Object> sessionMap = extContext.getSessionMap();
        Flow currentFlow = getCurrentFlow(context);
       
        if (null == currentFlow) {
            return null;
        }
       
        ClientWindow curWindow = context.getExternalContext().getClientWindow();
        if (null == curWindow) {
            throw new IllegalStateException("Unable to obtain current ClientWindow.  Is the ClientWindow feature enabled?");
        }

        String flowBeansForClientWindow = currentFlow.getClientWindowFlowId(curWindow) + "_beans";
        result = (Map<Contextual<?>, Object>) sessionMap.get(flowBeansForClientWindow);
        if (null == result) {
            result = new ConcurrentHashMap<Contextual<?>, Object>();
            sessionMap.put(flowBeansForClientWindow, result);
            ensureBeanMapCleanupOnSessionDestroyed(sessionMap, flowBeansForClientWindow);
View Full Code Here

    private static Map<Contextual<?>, CreationalContext<?>> getFlowScopedCreationalMapForCurrentFlow() {
        Map<Contextual<?>, CreationalContext<?>> result;
        FacesContext context = FacesContext.getCurrentInstance();
        ExternalContext extContext = context.getExternalContext();
        Map<String, Object> sessionMap = extContext.getSessionMap();
        Flow currentFlow = getCurrentFlow(context);

        ClientWindow curWindow = context.getExternalContext().getClientWindow();
        if (null == curWindow) {
            throw new IllegalStateException("Unable to obtain current ClientWindow.  Is the ClientWindow feature enabled?");
        }

        String creationalForClientWindow = currentFlow.getClientWindowFlowId(curWindow) + "_creational";
        result = (Map<Contextual<?>, CreationalContext<?>>) sessionMap.get(creationalForClientWindow);
        if (null == result) {
            result = new ConcurrentHashMap<Contextual<?>, CreationalContext<?>>();
            sessionMap.put(creationalForClientWindow, result);
            ensureCreationalCleanupOnSessionDestroyed(sessionMap, creationalForClientWindow);
View Full Code Here

            throw new IllegalStateException();
        }
    }
   
    private Flow getCurrentFlow() {
        Flow result = null;
       
        FacesContext context = FacesContext.getCurrentInstance();
        result = getCurrentFlow(context);
       
        return result;
View Full Code Here

        FlowHandler flowHandler = context.getApplication().getFlowHandler();
        if (null == flowHandler) {
            return null;
        }
       
        Flow result = flowHandler.getCurrentFlow(context);
       
        return result;
       
    }
View Full Code Here

            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Flow other = (Flow) obj;
        if ((this.id == null) ? (other.getId() != null) : !this.id.equals(other.getId())) {
            return false;
        }
        if ((this.startNodeId == null) ? (other.getStartNodeId() != null) : !this.startNodeId.equals(other.getStartNodeId())) {
            return false;
        }
        if (this._views != other.getViews() && (this._views == null || !this._views.equals(other.getViews()))) {
            return false;
        }
        FacesContext context = FacesContext.getCurrentInstance();
        if (null != context) {
            if (this._returns != other.getReturns() && (this._returns == null || !this._returns.equals(other.getReturns()))) {
                return false;
            }
            if (this.initializer != other.getInitializer() && (this.initializer == null || !this.initializer.equals(other.getInitializer()))) {
                return false;
            }
            if (this.finalizer != other.getFinalizer() && (this.finalizer == null || !this.finalizer.equals(other.getFinalizer()))) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

    @Override
    public Flow getFlow(FacesContext context, String definingDocumentId, String id) {
        Util.notNull("context", context);
        Util.notNull("definingDocumentId", definingDocumentId);
        Util.notNull("id", id);
        Flow result = null;
        Map<String, Flow> mapsForDefiningDocument = flows.get(definingDocumentId);
       
        if (null != mapsForDefiningDocument) {
            result = mapsForDefiningDocument.get(id);
        }
View Full Code Here

        if (null == mapsForDefiningDocument) {
            mapsForDefiningDocument = new ConcurrentHashMap<String, Flow>();
            flows.put(toAdd.getDefiningDocumentId(), mapsForDefiningDocument);
        }
       
        Flow oldFlow = mapsForDefiningDocument.put(id, toAdd);
        if (null != oldFlow) {
            String message = MessageFormat.format("Flow with id \"{0}\" and definingDocumentId \"{1}\" already exists.",
                    id, definingDocumentId);
            throw new IllegalStateException(message);
        }
View Full Code Here

        Util.notNull("context", context);
       
        if (!flowFeatureIsEnabled) {
            return null;
        }
        Flow result = null;
        FlowDeque<Flow> flowStack = getFlowStack(context);
        int returnDepth = flowStack.getReturnDepth();
        if (0 < returnDepth) {
            Iterator<Flow> stackIter = flowStack.iterator();
            int i = 0;
View Full Code Here

        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) {
View Full Code Here

TOP

Related Classes of javax.faces.flow.Flow

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.