Package org.jboss.portletbridge

Examples of org.jboss.portletbridge.BridgeRequestScope


    // Note: we can't call Manager.instance().beforeRedirect() here,
    // since a redirect is not the only reason for a responseComplete
    PortletBridgeContext bridgeContext = PortletBridgeContext
            .getCurrentInstance(facesContext);
    if (null != bridgeContext) {
      BridgeRequestScope windowState = bridgeContext.getRequestScope();
      if (Contexts.isEventContextActive()) {
        Manager manager = Manager.instance();
        if (manager.isLongRunningConversation()) {
          windowState.setConversationIdParameter(manager
                  .getConversationIdParameter());
          windowState.setConversationId(manager
                  .getCurrentConversationId());
        } else {
          windowState.setConversationIdParameter(null);
          windowState.setConversationId(null);
        }
      }
    }
    ExternalContext externalContext = facesContext.getExternalContext();
    if (Contexts.isEventContextActive()) {
View Full Code Here


  protected void saveFacesMessages(FacesContext facesContext) {
    if (Contexts.isConversationContextActive()) {
      PortletBridgeContext bridgeContext = PortletBridgeContext
              .getCurrentInstance(facesContext);
      if (null != bridgeContext) {
        BridgeRequestScope windowState = bridgeContext
                .getRequestScope();
        // Exceptions.instance().handle(e);
        org.jboss.portletbridge.seam.FacesMessages.afterPhase();
        org.jboss.portletbridge.seam.FacesMessages messages = org.jboss.portletbridge.seam.FacesMessages
                .instance();
        List<FacesMessage> messageList = new ArrayList<FacesMessage>(messages.getStatusMessages());
        Map<String, List<FacesMessage>> messagesMap = windowState.getMessages();
        messagesMap.put("", messageList);
      }
    }
  }
View Full Code Here

      String viewPath = (String) getRequest().getAttribute(
          Bridge.VIEW_PATH);
      if (null != viewPath) {
        viewId = getViewIdFromPath(viewPath);
      } else {
        BridgeRequestScope windowState = portletBridgeContext
            .getRequestScope();
            String resetModeViewId = portletBridgeContext.getBridgeConfig().getPortletConfig()
               .getInitParameter(Bridge.RESET_MODE_VIEWID);
            if(resetModeViewId != null && Boolean.parseBoolean(resetModeViewId)){
               //reset the default viewId for the given mode if
               //param is true
               viewId = calculateDefaultViewId(portletModeName);
            } else if (null != windowState) {
               //continue as normal
          viewId = windowState.getViewId();
        }
        if (null == viewId) {
          // Try to get viewId from stored session attribute
          PortletSession portletSession = getRequest()
              .getPortletSession(false);
View Full Code Here

              Bridge.PORTLET_LIFECYCLE_PHASE);
      if (null == portletPhase && phaseId.equals(PhaseId.RENDER_RESPONSE)) {
         // For a servlet phase, put all portletbridge-related parameters
         // back to ajaxContext.

         BridgeRequestScope windowState = null;
         PortletBridgeContext bridgeContext = (PortletBridgeContext) context
                 .getExternalContext().getRequestMap().get(
                 PortletBridgeContext.REQUEST_PARAMETER_NAME);
         if (null != bridgeContext) {
            windowState = bridgeContext.getRequestScope();
         }

         if (null != ajaxContext && null != windowState) {
        Map<String,Object> commonAjaxParameters = ajaxContext.getCurrentInstance(
            context).getCommonAjaxParameters();

        commonAjaxParameters.put(RequestScopeManager.STATE_ID_PARAMETER,
            bridgeContext.getStateId().toString());
        commonAjaxParameters.put(
            AjaxPortletBridge.AJAX_NAMESPACE_PARAMETER, windowState
                .getNamespace());

      }
      }
   }
View Full Code Here

   setupActionRequest();
   setupTree();
   String clientId = input.getClientId(facesContext);
   FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,"msg","detail");
   facesContext.addMessage(clientId, facesMessage);
   BridgeRequestScope state = new BridgeRequestScope(){

    
   };
   state.saveMessages(facesContext);
   Map messages = state.getMessages();
   assertEquals(1, messages.size());
   List list = (List)messages.get(clientId);
   assertEquals(1, list.size());
   assertSame(facesMessage, list.get(0));
    }
View Full Code Here

     * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
     */
    public void setUp() throws Exception {
   super.setUp();
   RequestScopeManager portletStateHolder = RequestScopeManager.getInstance(facesContext);
   BridgeRequestScope portletState = new BridgeRequestScope(){
    
   };
   portletStateHolder.saveRequestScope(STATE_ID, portletState);
   portalFacesContext = new FacesContextImpl(servletContextImpl,lifecycle);

View Full Code Here

   FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
   MockPortletContext portletContext = new MockPortletContext(servletContext);
   MockActionRequest portletRequest = new MockActionRequest(portletContext);
   MockActionResponse portletResponse = new MockActionResponse();
   RequestScopeManager portletStateHolder = RequestScopeManager.getInstance(facesContext);
   BridgeRequestScope portletState = new BridgeRequestScope();
   portletStateHolder.saveRequestScope(STATE_ID, portletState);
   PortletBridgeContext bridgeContext = new PortletBridgeContext(getBridgeConfig());
   portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
   portletRequest.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, Bridge.PortletPhase.ACTION_PHASE);
   FacesContext context = factory.getFacesContext(portletContext,
View Full Code Here

   super.setUp();
   portletContext=new MockPortletContext(servletContext);
   portletRequest = new MockActionRequest(portletContext);
   portletResponse = new MockActionResponse();
   RequestScopeManager portletStateHolder = RequestScopeManager.getInstance(facesContext);
   BridgeRequestScope portletState = new BridgeRequestScope(){
    
   };
   portletStateHolder.saveRequestScope(STATE_ID, portletState);
   PortletBridgeContext bridgeContext = new PortletBridgeContext(getBridgeConfig());
   portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
View Full Code Here

TOP

Related Classes of org.jboss.portletbridge.BridgeRequestScope

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.