Package org.jboss.portletbridge

Examples of org.jboss.portletbridge.StateId


        UIPortletAjaxViewRoot.class.getName());
  }

  public void beforeRenderRequest(FacesContext facesContext) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
    StateId stateId = PortletBridgeContext.getCurrentInstance(facesContext)
        .getStateId();
    ajaxContext.getCommonAjaxParameters().put(
        RequestScopeManager.STATE_ID_PARAMETER, stateId.toString());
  }
View Full Code Here


  }

  @Override
  public void beforeResourceRequest(FacesContext facesContext) {
    AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
    StateId stateId = PortletBridgeContext.getCurrentInstance(facesContext)
        .getStateId();
    ajaxContext.getCommonAjaxParameters().put(
        RequestScopeManager.STATE_ID_PARAMETER, stateId.toString());

    if (ajaxContext.isAjaxRequest(facesContext)) {
      // Set XML response.
      Object response = facesContext.getExternalContext().getResponse();
      Object request = facesContext.getExternalContext().getRequest();
View Full Code Here

  }

  public StateId getStateId(String portletName, ActionRequest actionRequest) {
    UUID uuid = UUID.randomUUID();
    PortletMode portletMode = actionRequest.getPortletMode();
    StateId stateId = new StateId(getScopeId(portletName, actionRequest),portletMode ,uuid.toString());
    return stateId;
  }
View Full Code Here

  }

  public StateId getStateId(String portletName, RenderRequest renderRequest, String namespace) {
    PortletMode portletMode = renderRequest.getPortletMode();
    String scopeId = getScopeId(portletName, renderRequest);
    StateId stateId = null ;
    PortletSession session = renderRequest.getPortletSession(false);
    String stateIdParameter = renderRequest.getParameter(STATE_ID_PARAMETER);
    if (null == stateIdParameter) {
      stateId = getStateIdFromViewHistory(portletMode,
          session);
    } else {
      stateId = new StateId(stateIdParameter);
      // Check portlet mode for a changes:
      if (!portletMode.equals(stateId.getMode())) {
        StateId historyStateId = getStateIdFromViewHistory(portletMode,
            session);
        if(null != historyStateId){
          stateId = historyStateId;
        } else {
          stateId.setMode(portletMode);
        }
      }
    }
    if (null == stateId) {
      stateId = new StateId(scopeId,portletMode,namespace);
    }
    return stateId;
  }
View Full Code Here

    return stateId;
  }

  private StateId getStateIdFromViewHistory(PortletMode portletModeName,
       PortletSession session) {
    StateId stateId = null;
    if(null != session){
      String modeViewId = (String) session.getAttribute(Bridge.VIEWID_HISTORY+"."+portletModeName);
      if(null != modeViewId){
        try {
          PortalActionURL viewUrl = new PortalActionURL(modeViewId);
          String stateIdParameter = viewUrl.getParameter(STATE_ID_PARAMETER);
          if(null != stateIdParameter){
            stateId = new StateId(stateIdParameter);
          }
        } catch (MalformedURLException e) {
          // Ignore.
        }
       
View Full Code Here

    synchronized (states) {
      // Iterate over copy of the keys, so LinkedHashSet do not support
      // concurrent modifications.
      for (Iterator<StateId> keysIterator = states.keySet().iterator(); keysIterator
          .hasNext();) {
        StateId key = keysIterator.next();
        if (key.getScopeId().equals(scopeId)) {
          keysIterator.remove();
        }
      }
 
    }
View Full Code Here

    namespace = "";
    sessionPrefix = "";
    PortletStateHolder portletStateHolder = (PortletStateHolder) context
        .getAttribute(PortletStateHolder.STATE_HOLDER);
    if (null != portletStateHolder) {
      StateId stateId = new StateId(stateIdParameter);
      windowState = portletStateHolder.getWindowState(stateId);
      if (null != windowState) {
        namespace = windowState.getNamespace();
        String windowId = windowState.getWindowId();
        sessionPrefix = WindowIDRetriver.PORTLET_SCOPE_PREFIX
View Full Code Here

TOP

Related Classes of org.jboss.portletbridge.StateId

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.