protected Conversation getConversation() { return Conversation.instance(); }
protected void flushConversationMetadata() { if ( isLongRunningConversation() ) { //important: only do this stuff when a long-running // conversation exists, otherwise we would // force creation of a conversation entry Conversation.instance().flush(); } }
/** * 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; } }
private String saveNewRole() { boolean success = identityManager.createRole(role); if (success) { for (String r : groups) { identityManager.addRoleToGroup(role, r); } Conversation.instance().end(); } return "success"; }
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"; }
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(); }
conversationBegun = Conversation.instance().begin(true, false); setDirty();
@Override public void handle(Exception e) throws Exception { String viewId = getViewId(e); if (viewId==null) { //we want to perform a redirect straight back to the current page //there is no ViewRoot available, so lets do it the hard way String servletPath = ( (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest() ).getServletPath(); viewId = servletPath.substring(0, servletPath.lastIndexOf('.')) + Pages.getSuffix(); } addFacesMessage( "#0", getMessageSeverity(e), null, getDisplayMessage(e, getMessage(e))); if ( Contexts.isConversationContextActive() && isEnd(e) ) { Conversation.instance().end(); } try { redirect(viewId, null); } catch (RedirectException re) { //do nothing log.debug("could not redirect", re); } }
private String saveNewUser() { if (password == null || !password.equals(confirm)) { StatusMessages.instance().addToControl("password", "Passwords do not match"); return "failure"; } boolean success = identityManager.createUser(username, password, firstname, lastname); if (success) { for (String role : roles) { identityManager.grantRole(username, role); } if (!enabled) { identityManager.disableUser(username); } Conversation.instance().end(); return "success"; } return "failure"; }
Conversation.instance().end(); return "success";
@Override public void handle(Exception e) throws Exception { if ( Contexts.isConversationContextActive() && isEnd(e) ) { Conversation.instance().end(); } String msg = getDisplayMessage( e, getMessage(e) ); error( getCode(e), msg ); }
/** * 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); } }
@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(); } }
@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(); } }
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();
Conversation conversation = Conversation.instance();