Package javax.portlet

Examples of javax.portlet.PortletConfig


        Mock mockPrep = mock(PortletRequestDispatcher.class);
       
        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();
        ActionInvocation inv = (ActionInvocation)mockInvocation.proxy();
       
        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
View Full Code Here


        Mock mockPrep = mock(PortletRequestDispatcher.class);
       
        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();
       
        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
        mockPrep.expects(once()).method("include").with(params);
View Full Code Here

    return bean;
  }

  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof Portlet) {
      PortletConfig config = this.portletConfig;
      if (config == null || !this.useSharedPortletConfig) {
        config = new DelegatingPortletConfig(beanName, this.portletContext, this.portletConfig);
      }
      try {
        ((Portlet) bean).init(config);
View Full Code Here

        "] needs to implement interface [javax.portlet.Portlet]");
    }
    if (this.portletName == null) {
      this.portletName = this.beanName;
    }
    PortletConfig config = this.portletConfig;
    if (config == null || !this.useSharedPortletConfig) {
      config = new DelegatingPortletConfig();
    }
    this.portletInstance = (Portlet) this.portletClass.newInstance();
    this.portletInstance.init(config);
View Full Code Here

    return bean;
  }

  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
    if (bean instanceof Portlet) {
      PortletConfig config = this.portletConfig;
      if (config == null || !this.useSharedPortletConfig) {
        config = new DelegatingPortletConfig(beanName, this.portletContext, this.portletConfig);
      }
      try {
        ((Portlet) bean).init(config);
View Full Code Here

        "] needs to implement interface [javax.portlet.Portlet]");
    }
    if (this.portletName == null) {
      this.portletName = this.beanName;
    }
        PortletConfig config = this.portletConfig;
        if (config == null || !this.useSharedPortletConfig) {
            config = new DelegatingPortletConfig();
        }
    this.portletInstance = (Portlet) this.portletClass.newInstance();
    this.portletInstance.init(config);
View Full Code Here

   */
  public boolean setupFilter(FilterConfig config, FilterRequestContext filterRequestContext,
    String filterPath) throws IOException, ServletException
  {
    boolean inPortletContext = false;
    PortletConfig portletConfig = (PortletConfig)filterRequestContext.getRequest()
      .getAttribute("javax.portlet.config");
    if (portletConfig != null)
    {
      inPortletContext = true;
      WicketResponseState responseState = (WicketResponseState)filterRequestContext.getRequest()
View Full Code Here

    if (mDefaultViewIdMap == null)
    {
      mDefaultViewIdMap = new HashMap<String, String>();
      // loop through all portlet initialization parameters looking for those in the
      // correct form
      PortletConfig config = getPortletConfig();

      Enumeration<String> e = config.getInitParameterNames();
      int len = DEFAULT_VIEWID.length();
      while (e.hasMoreElements())
      {
        String s = e.nextElement();
        if (s.startsWith(DEFAULT_VIEWID) && s.length() > DEFAULT_VIEWID.length())
        {
          String viewId = config.getInitParameter(s);
          // extract the mode
          s = s.substring(len + 1);
          mDefaultViewIdMap.put(s, viewId);
        }
      }
View Full Code Here

    assertEquals(portletContext, bean.getPortletContext());
  }
 
  public void testPortletContextAwareWithPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletConfig);
    PortletContextAwareBean bean = new PortletContextAwareBean();
    assertNull(bean.getPortletContext());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletContext should have been set", bean.getPortletContext());
View Full Code Here

    assertEquals(portletContext, bean.getPortletContext());   
  }
 
  public void testPortletContextAwareWithPortletContextAndPortletConfig() {
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    PortletContextAwareProcessor processor = new PortletContextAwareProcessor(portletContext, portletConfig);
    PortletContextAwareBean bean = new PortletContextAwareBean();
    assertNull(bean.getPortletContext());
    processor.postProcessBeforeInitialization(bean, "testBean");
    assertNotNull("PortletContext should have been set", bean.getPortletContext());
View Full Code Here

TOP

Related Classes of javax.portlet.PortletConfig

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.