/** * Redirect to the captured view, and end any conversation * that began in captureCurrentView(). * *@see Redirect#captureCurrentView() */ public boolean returnToCapturedView() { if (viewId!=null) { if (conversationBegun) { Conversation.instance().end(); } execute(); return true; } else { return false; } }
/** * End a child conversation and redirect to the last defined * view-id for the parent conversation. * * @param endBeforeRedirect should the conversation be destroyed before the redirect? * @return true if a redirect occurred */ public boolean endAndRedirect(boolean endBeforeRedirect) { end(endBeforeRedirect); Manager manager = Manager.instance(); return redirect( manager, manager.getParentConversationViewId() ); }
@Override public Object getValue() { Conversation conversation = Conversation.instance(); if ( !conversation.isNested() || conversation.isLongRunning() ) { if (getViewId()!=null) { Page page = Pages.instance().getPage(getViewId()); return page.getConversationIdParameter().getParameterValue(); } else { return conversation.getId(); } } else { return conversation.getParentId(); } }
@Override public String getName() { Conversation conversation = Conversation.instance(); if (getViewId()!=null && ( !conversation.isNested() || conversation.isLongRunning() ) ) { return Pages.instance().getPage(getViewId()) .getConversationIdParameter() .getParameterName(); } else { return Manager.instance().getConversationIdParameter(); } }
Conversation conversation = Conversation.instance(); if ( pageEntry.isSwitchEnabled() ) conversation.setViewId(viewId); conversation.setDescription( pageEntry.renderDescription() ); conversation.setDescription( pages.renderDescription(viewId) ); conversation.setTimeout( pages.getTimeout(viewId) ); conversation.setConcurrentRequestTimeout( pages.getConcurrentRequestTimeout(viewId) ); conversation.setViewId( Pageflow.instance().getPageViewId() ); conversation.setDescription( page.getDescription() ); conversation.setTimeout( page.getTimeout() );
public void doRenderView(String view_name) throws Exception { String base = BaseURL.getBaseURL(getHttpServletRequest()); String url = base + view_name + "?conversationId=" + Conversation.instance().getId(); /** * hack needed for jboss 4 */ HttpServletResponse response = getHttpServletResponse(); response.resetBuffer(); response.sendRedirect(url); response.flushBuffer(); getHttpServletRequest().setAttribute( NXAuthConstants.DISABLE_REDIRECT_REQUEST_KEY, Boolean.TRUE); FacesContext.getCurrentInstance().responseComplete(); }
Conversation.instance().endBeforeRedirect(); Conversation.instance().end();
boolean begun = Conversation.instance().begin(join, nested); if (begun) Conversation.instance().changeFlushMode(flushMode);
protected Conversation getConversation() { return Conversation.instance(); }
/** * Begin or join a conversation, or begin a new nested conversation. * * @param join if a conversation is active, should we join it? * @param nested if a conversation is active, should we start a new nested conversation? * @return true if a new long-running conversation was begun */ public boolean begin(boolean join, boolean nested) { boolean longRunningConversation = Manager.instance().isLongRunningOrNestedConversation(); if ( !join && !nested && longRunningConversation ) { throw new IllegalStateException("begin() called from long-running conversation, try join=true"); } else if ( !longRunningConversation ) { reallyBegin(); return true; } else if (nested) { beginNested(); return true; } else { return false; } }
/** * "Pop" the conversation stack, switching to the parent conversation */ public void pop() { String parentId = getParentId(); if (parentId!=null) { Manager.instance().switchConversation(parentId); } }
/** * End a long-runnning conversation. */ public void end() { end(false); }
public String getActionURL(FacesContext facesContext, String viewId) { String actionUrl = super.getActionURL(facesContext, viewId); Conversation conversation = Conversation.instance(); Manager manager = Manager.instance(); String conversationIdParameter = manager.getConversationIdParameter(); if ( conversation.isLongRunning() ) .appendConversationIdIfNecessary(conversationIdParameter, conversation.getId()) .getUrl(); else if (conversation.isNested()) .appendConversationIdIfNecessary(conversationIdParameter, conversation.getParentId()) .getUrl();
/** * Promote a temporary conversation and make it long-running */ public void beginConversation() { if ( !isLongRunningConversation() ) { log.debug("Beginning long-running conversation"); setLongRunningConversation(true); createConversationEntry(); Conversation.instance(); //force instantiation of the Conversation in the outer (non-nested) conversation storeConversationToViewRootIfNecessary(); if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN); } }
/** * End a long-runnning conversation and destroy * it before a redirect. */ public void endBeforeRedirect() { end(true); }
private String saveExistingRole() { List<String> grantedRoles = identityManager.getRoleGroups(role); if (grantedRoles != null) { for (String r : grantedRoles) { if (!groups.contains(r)) identityManager.removeRoleFromGroup(role, r); } } for (String r : groups) { if (grantedRoles == null || !grantedRoles.contains(r)) identityManager.addRoleToGroup(role, r); } Conversation.instance().end(); return "success"; }