Examples of BridgeRequestScope


Examples of com.liferay.faces.bridge.scope.BridgeRequestScope

    FacesRequestParameterMap facesRequestParameterMap = null;
    PortletRequest portletRequest = bridgeContext.getPortletRequest();
    PortletResponse portletResponse = bridgeContext.getPortletResponse();
    String namespace = portletResponse.getNamespace();
    PortletContainer portletContainer = bridgeContext.getPortletContainer();
    BridgeRequestScope bridgeRequestScope = bridgeContext.getBridgeRequestScope();
    String defaultRenderKitId = bridgeContext.getDefaultRenderKitId();
    Map<String, String> facesViewParameterMap = getFacesViewParameterMap(bridgeContext);

    if (portletRequest instanceof ClientDataRequest) {
View Full Code Here

Examples of com.liferay.faces.bridge.scope.BridgeRequestScope

    // Determines whether or not methods annotated with the @PreDestroy annotation are preferably invoked
    // over the @BridgePreDestroy annotation.
    this.preferPreDestroy = PortletConfigParam.PreferPreDestroy.getBooleanValue(portletConfig);

    BridgeRequestScope bridgeRequestScope = bridgeContext.getBridgeRequestScope();

    if (bridgeRequestScope != null) {
      this.removedAttributeNames = bridgeRequestScope.getRemovedAttributeNames();
    }
    else {
      this.removedAttributeNames = new HashSet<String>();
    }
  }
View Full Code Here

Examples of com.liferay.faces.bridge.scope.BridgeRequestScope

      // If the URL contains the "javax.portlet.faces.PortletMode" parameter, then set the
      // PortletMode on the ActionResponse.
      if (Bridge.PORTLET_MODE_PARAMETER.equals(urlParameterName)) {
        PortletMode portletMode = new PortletMode(parameterValue);
        BridgeRequestScope bridgeRequestScope = bridgeContext.getBridgeRequestScope();

        if (bridgeRequestScope != null) {
          PortletRequest portletRequest = bridgeContext.getPortletRequest();

          if (!portletRequest.getPortletMode().equals(portletMode) &&
              portletRequest.isPortletModeAllowed(portletMode)) {
            stateAwareResponse.setPortletMode(portletMode);
            bridgeRequestScope.setPortletModeChanged(true);
          }
        }
      }

      // Otherwise, if the URL contains the "javax.portlet.faces.WindowState" parameter, then
View Full Code Here

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

Examples of org.jboss.portletbridge.BridgeRequestScope

  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

Examples of org.jboss.portletbridge.BridgeRequestScope

      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

Examples of org.jboss.portletbridge.BridgeRequestScope

              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

Examples of org.jboss.portletbridge.BridgeRequestScope

   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

Examples of org.jboss.portletbridge.BridgeRequestScope

     * @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

Examples of org.jboss.portletbridge.BridgeRequestScope

   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
TOP
Copyright © 2018 www.massapi.com. 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.