Package org.jboss.portletbridge.application

Examples of org.jboss.portletbridge.application.PortletStateHolder$LRUMap


   protected ExternalContext setupRequest() {
      setupActionRequest();
      request.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, Bridge.PortletPhase.ActionPhase);
      request.setAttribute(AbstractExternalContext.PORTLET_CONFIG_ATTRIBUTE,
            portletConfig);
      PortletStateHolder portletStateHolder = PortletStateHolder.init(new MockPortletContext(servletContext));
      PortletWindowState portletState = new PortletWindowState(){

     @Override
     public BridgeConfig getBridgeConfig() {
       return new BridgeConfig(){

         public Map<String, String> getDefaultViewIdMap() {
        HashMap<String, String> viewIdMap = new HashMap<String,String>();
        viewIdMap.put("view", "/foo.xhtml");
        return viewIdMap;
         }

         public Set<ExcludedRequestAttribute> getExcludedAttributes() {
           // TODO Auto-generated method stub
           return null;
         }

         public List<String> getFacesServletMappings() {
           // TODO Auto-generated method stub
           return null;
         }

         public String getInitParameter(String name) {
           // TODO Auto-generated method stub
           return null;
         }

         public PortletConfig getPortletConfig() {
           // TODO Auto-generated method stub
           return null;
         }

         public String getPortletName() {
           // TODO Auto-generated method stub
           return null;
         }

         public boolean isPreserveActionParams() {
           // TODO Auto-generated method stub
           return false;
         }

      public Map<Class<? extends Throwable>, String> getErrorPages() {
        // TODO Auto-generated method stub
        return null;
      }

            public Lifecycle getFacesLifecycle() {
               return null;
            }

         };
     }
       
      };
      portletStateHolder.addWindowState(STATE_ID, portletState);
      PortletBridgeContext bridgeContext = portletState.createBridgeContext();
      actionRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);

      return new PortletExternalContextImpl(portletContext,actionRequest,actionResponse);
   }
View Full Code Here


    public void setUp() throws Exception {
   super.setUp();
   portletContext=new MockPortletContext(servletContext);
   portletRequest = new MockActionRequest(portletContext);
   portletResponse = new MockActionResponse();
   PortletStateHolder portletStateHolder = PortletStateHolder.init(new MockPortletContext(servletContext));
   PortletWindowState portletState = new PortletWindowState(){

  @Override
  public BridgeConfig getBridgeConfig() {
    return new BridgeConfig(){

      public Map<String, String> getDefaultViewIdMap() {
        HashMap<String, String> viewIdMap = new HashMap<String,String>();
        viewIdMap.put("view", "/foo.xhtml");
        return viewIdMap;
      }

      public Set<ExcludedRequestAttribute> getExcludedAttributes() {
        // TODO Auto-generated method stub
        return null;
      }

      public List<String> getFacesServletMappings() {
        // TODO Auto-generated method stub
        return null;
      }

      public String getInitParameter(String name) {
        // TODO Auto-generated method stub
        return null;
      }

      public PortletConfig getPortletConfig() {
        // TODO Auto-generated method stub
        return null;
      }

      public String getPortletName() {
        // TODO Auto-generated method stub
        return null;
      }

      public boolean isPreserveActionParams() {
        // TODO Auto-generated method stub
        return false;
      }

      public Map<Class<? extends Throwable>, String> getErrorPages() {
        // TODO Auto-generated method stub
        return null;
      }

         public Lifecycle getFacesLifecycle() {
            return null;
         }

      };
  }
    
   };
   portletStateHolder.addWindowState(STATE_ID, portletState);
   PortletBridgeContext bridgeContext = portletState.createBridgeContext();
   portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
   portletContextImpl = new PortletExternalContextImpl(portletContext,portletRequest,portletResponse);
   portalFacesContext = new FacesContextImpl(portletContextImpl,lifecycle);
   portalFacesContext.setViewRoot(facesContext.getViewRoot());
View Full Code Here

    /* (non-Javadoc)
     * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
     */
    public void setUp() throws Exception {
   super.setUp();
   PortletStateHolder portletStateHolder = PortletStateHolder.init(new MockPortletContext(servletContext));
   PortletWindowState portletState = new PortletWindowState(){

  @Override
  public BridgeConfig getBridgeConfig() {
    return null;
  }
    
   };
   portletStateHolder.addWindowState(STATE_ID, portletState);
   servletContextImpl = new ServletExternalContextImpl(servletContext,request,response,STATE_ID.toString());
   portalFacesContext = new FacesContextImpl(servletContextImpl,lifecycle);

    }
View Full Code Here

    public void testGetFacesContextPortlet() {
   FacesContextFactoryImpl factory = new FacesContextFactoryImpl(facesContextFactory);
   MockPortletContext portletContext = new MockPortletContext(servletContext);
   MockActionRequest portletRequest = new MockActionRequest(portletContext);
   MockActionResponse portletResponse = new MockActionResponse();
   PortletStateHolder portletStateHolder = PortletStateHolder.init(new MockPortletContext(servletContext));
   PortletWindowState portletState = new PortletWindowState(){

  @Override
  public BridgeConfig getBridgeConfig() {
    return new BridgeConfig(){

      public Map<String, String> getDefaultViewIdMap() {
        HashMap<String, String> viewIdMap = new HashMap<String,String>();
        viewIdMap.put("view", "/foo.xhtml");
        return viewIdMap;
      }

      public Set<ExcludedRequestAttribute> getExcludedAttributes() {
        // TODO Auto-generated method stub
        return null;
      }

      public List<String> getFacesServletMappings() {
        // TODO Auto-generated method stub
        return null;
      }

      public String getInitParameter(String name) {
        // TODO Auto-generated method stub
        return null;
      }

      public PortletConfig getPortletConfig() {
        // TODO Auto-generated method stub
        return null;
      }

      public String getPortletName() {
        // TODO Auto-generated method stub
        return null;
      }

      public boolean isPreserveActionParams() {
        // TODO Auto-generated method stub
        return false;
      }

      public Map<Class<? extends Throwable>, String> getErrorPages() {
        // TODO Auto-generated method stub
        return null;
      }

         public Lifecycle getFacesLifecycle() {
            return null;
         }

      };
  }
    
   };
   portletStateHolder.addWindowState(STATE_ID, portletState);
   PortletBridgeContext bridgeContext = portletState.createBridgeContext();
   portletRequest.setAttribute(PortletBridgeContext.REQUEST_PARAMETER_NAME, bridgeContext);
   FacesContext context = factory.getFacesContext(portletContext,
      portletRequest, portletResponse, lifecycle);
   assertTrue((context instanceof FacesContextImpl));
View Full Code Here

      HttpServletRequest request, HttpServletResponse response,
      String stateIdParameter) {
    super(context, request, response);
    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
            + windowId + '?';
View Full Code Here

TOP

Related Classes of org.jboss.portletbridge.application.PortletStateHolder$LRUMap

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.