Refine search
public static NavigationCase findNavigationCase(FacesContext context, String outcome) { ConfigurableNavigationHandler navHandler = (ConfigurableNavigationHandler) context.getApplication().getNavigationHandler(); String outcomeValue = (outcome == null) ? context.getViewRoot().getViewId() : outcome; return navHandler.getNavigationCase(context, null, outcomeValue); }
@Override public Map<String, Set<NavigationCase>> getNavigationCases() { return base.getNavigationCases(); } }
@Override public void handleNavigation(FacesContext context, String fromAction, String outcome) { Map<Object, Object> attrs = context.getAttributes(); String dialogOutcome = (String) attrs.get(Constants.DIALOG_FRAMEWORK.OUTCOME); Map<String, String> requestParams = context.getExternalContext().getRequestParameterMap(); NavigationCase navCase = getNavigationCase(context, fromAction, dialogOutcome); String toViewId = navCase.getToViewId(context); Map<String, Object> options = (Map<String, Object>) attrs.get(Constants.DIALOG_FRAMEWORK.OPTIONS); Map<String, List<String>> params = (Map<String, List<String>>) attrs.get(Constants.DIALOG_FRAMEWORK.PARAMS); String url = context.getApplication().getViewHandler().getBookmarkableURL(context, toViewId, params, includeViewParams); url = EscapeUtils.forJavaScript(url); base.handleNavigation(context, fromAction, outcome);
outcome = (outcome == null) ? facesContext.getViewRoot().getViewId() : outcome; outcome = ((outcome == null) ? HtmlRendererUtils.STR_EMPTY : outcome.trim()); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); if (!(nh instanceof ConfigurableNavigationHandler)) if (toFlowDocumentId == null) navigationCase = navigationHandler.getNavigationCase( facesContext, null, outcome); navigationCase = navigationHandler.getNavigationCase( facesContext, null, outcome, toFlowDocumentId); if (navigationCase.getToFlowDocumentId() != null) list.add(navigationCase.getToFlowDocumentId()); parameters.put(FlowHandler.TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME, list); list2.add(navigationCase.getFromOutcome()); parameters.put(FlowHandler.FLOW_ID_REQUEST_PARAM_NAME, list2); ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow(); String href; try
setInNavigation((HttpServletRequest) context.getExternalContext().getRequest(), true); if(context.getViewRoot() != null) originalViewId = context.getViewRoot().getViewId(); parent.handleNavigation(context, fromAction, outcome); if (context.getViewRoot() != null) newViewId = context.getViewRoot().getViewId();
ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication() .getNavigationHandler(); NavigationCase navCase = cnh.getNavigationCase(context, null, outcome); if (FacesContext.getCurrentInstance().getApplication().getProjectStage().equals(ProjectStage.Development)) { return "alert('WARNING! " + C.W_NONAVCASE_BUTTON + "');"; } else { String vId = navCase.getToViewId(context); url = context.getApplication().getViewHandler().getBookmarkableURL(context, vId, params, button.isIncludeViewParams() || navCase.isIncludeViewParams()); return url;
public void clientWindowTransition(FacesContext context) String flowDocumentIdRequestParam = (String) context.getExternalContext(). getRequestParameterMap().get(FlowHandler.TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME); String flowIdRequestParam = (String) context.getExternalContext(). getRequestParameterMap().get(FlowHandler.FLOW_ID_REQUEST_PARAM_NAME); i++; NavigationCase navCase = nh.getNavigationCase(context, null, ((ReturnNode) node).getFromOutcome(context), FlowHandler.NULL_FLOW); if (FlowHandler.NULL_FLOW.equals(navCase.getToFlowDocumentId())) fromOutcome = navCase.getFromOutcome(); baseReturnFlow, targetFlow, outboundCallNode, context.getViewRoot().getViewId()); while (startNodeId != null && !failed) NavigationCase navCase = nh.getNavigationCase(context, null, startNodeId, targetFlow.getDefiningDocumentId()); if (navCase != null && navCase.getToFlowDocumentId() != null)
public static String getOutcomeTargetHref( FacesContext facesContext, UIOutcomeTarget component) throws IOException { String outcome = component.getOutcome(); outcome = (outcome == null) ? facesContext.getViewRoot().getViewId() : outcome; outcome = ((outcome == null) ? STR_EMPTY : outcome.trim()); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); if (!(nh instanceof ConfigurableNavigationHandler)) { throw new FacesException("Navigation handler must be an instance of " + NavigationCase navigationCase = navigationHandler.getNavigationCase(facesContext, null, outcome); Map<String, List<String>> navigationCaseParams = navigationCase.getParameters(); if (navigationCaseParams != null) { if (parameters == null) ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); String href = viewHandler.getBookmarkableURL(facesContext, navigationCase.getToViewId(facesContext), parameters, navigationCase.isIncludeViewParams() || component.isIncludeViewParams());
/** * <p class="changed_added_2_0">A convenience method to signal the * JavaServer Faces implementation to perform navigation * with the provided outcome. When the NavigationHandler is invoked, * the current viewId is treated as the "from viewId" and the "from action" * is null.</p> * * @throws IllegalStateException if this method is called after * this instance has been released */ public void performNavigation(String outcome) { this.handleNavigation(FacesContext.getCurrentInstance(), null, outcome); }
NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); if (!(nh instanceof ConfigurableNavigationHandler)) { throw new FacesException("Navigation handler must be an instance of " + NavigationCase navigationCase = navigationHandler.getNavigationCase(facesContext, null, outcome); Map<String, List<String>> navigationCaseParams = navigationCase.getParameters(); if (navigationCaseParams != null) { parameters.putAll(navigationCaseParams); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); String href = viewHandler.getBookmarkableURL(facesContext, navigationCase.getToViewId(facesContext), parameters, navigationCase.isIncludeViewParams() || component.isIncludeViewParams());
NavigationHandler navigationHandler = context.getApplication().getNavigationHandler(); if (navigationHandler instanceof ConfigurableNavigationHandler) { ((ConfigurableNavigationHandler)navigationHandler).inspectFlow(context, toAdd);
@Override public NavigationCase getNavigationCase(final FacesContext context, final String fromAction, final String outcome) { // TODO integrate rewrite with navigation (See PrettyNavigationHandler) if (REWRITE_PREFIX.equals(outcome)) { String viewId = context.getViewRoot().getViewId(); NavigationCase navigationCase = parent.getNavigationCase(context, fromAction, viewId); return navigationCase; } else if (outcome != null && outcome.startsWith(REDIRECT_PREFIX)) { String url = outcome.substring(REDIRECT_PREFIX.length()); String viewId = AddressBuilder.create(url).getPath(); return parent.getNavigationCase(context, fromAction, viewId); } else { NavigationCase navigationCase = parent.getNavigationCase(context, fromAction, outcome); return navigationCase; } }
@Override public void handleNavigation(final FacesContext context, final String fromAction, final String outcome) { BeanManager manager = new BeanManagerLocator().getBeanManager(); NavigationHandler navigationHandler = context.getApplication().getNavigationHandler(); NavigationCase navigationCase; if (navigationHandler instanceof ConfigurableNavigationHandler) { navigationCase = ((ConfigurableNavigationHandler) navigationHandler) .getNavigationCase(context, fromAction, outcome); } else { navigationCase = getNavigationCase(context, fromAction, outcome); } manager.fireEvent(new PreNavigateEvent(context, fromAction, outcome, navigationCase)); parent.handleNavigation(context, fromAction, outcome); }
@Override public NavigationCase getNavigationCase(FacesContext context, String fromAction, String outcome) { return base.getNavigationCase(context, fromAction, outcome); }
@Override public Set<NavigationCase> put(String key, Set<NavigationCase> value) { if (value == null) { return null; } Set<NavigationCase> result = new HashSet<NavigationCase>(); //filter entries created by createViewConfigBasedNavigationCases for (NavigationCase navigationCase : value) { if (!(navigationCase.getFromOutcome() == null && navigationCase.getFromAction() == null)) { result.add(navigationCase); } } //delegate to the wrapped instance -> the innermost handler needs to receive it //(because mojarra uses ConfigurableNavigationHandler#getNavigationCases // to add cases for std. nav.rules from the outside) return this.wrapped.getNavigationCases().put(key, result); }
navigationCase = new NavigationCase("*", null, null, return ((ConfigurableNavigationHandler) this.wrapped).getNavigationCase(context, action, outcome);
@Override public void performNavigation(final String outcome) { parent.performNavigation(outcome); } }
@Override public void handleNavigation(FacesContext context, String fromAction, String outcome) { getWrapped().handleNavigation(context, fromAction, outcome); }
@Override public void inspectFlow(FacesContext context, Flow flow) { getWrapped().inspectFlow(context, flow); }
outcome = (outcome == null) ? facesContext.getViewRoot().getViewId() : outcome; outcome = ((outcome == null) ? HtmlRendererUtils.STR_EMPTY : outcome.trim()); NavigationHandler nh = facesContext.getApplication().getNavigationHandler(); if (!(nh instanceof ConfigurableNavigationHandler)) if (toFlowDocumentId == null) navigationCase = navigationHandler.getNavigationCase( facesContext, null, outcome); navigationCase = navigationHandler.getNavigationCase( facesContext, null, outcome, toFlowDocumentId); if (navigationCase.getToFlowDocumentId() != null) list.add(navigationCase.getToFlowDocumentId()); parameters.put(FlowHandler.TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME, list); list2.add(navigationCase.getFromOutcome()); parameters.put(FlowHandler.FLOW_ID_REQUEST_PARAM_NAME, list2); ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow(); String href; try