Package javax.portlet

Examples of javax.portlet.PortletConfig


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


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

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

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

  private ConfigurablePortletApplicationContext root;
 
  protected ConfigurableApplicationContext createContext() throws Exception {
    root = new XmlPortletApplicationContext();
    PortletContext portletContext = new MockPortletContext();
    PortletConfig portletConfig = new MockPortletConfig(portletContext);
    root.setPortletConfig(portletConfig);
    root.setConfigLocations(new String[] {"/org/springframework/web/context/WEB-INF/applicationContext.xml"});
    root.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
      public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        beanFactory.addBeanPostProcessor(new BeanPostProcessor() {
View Full Code Here

    throws PortletException {
        if ( this.portlet == null ) {
            throw new PortletException("Unable to instantiate portlet from class " + this.portletDefinition.getClassName());
        }
        PortletContext portletContext;
        PortletConfig portletConfig;
        portletContext = PortletObjectAccess.getPortletContext(this.servletConfig.getServletContext(),
                portletDefinition.getPortletApplicationDefinition());
        portletConfig = PortletObjectAccess.getPortletConfig(this.servletConfig,
                portletContext,
                portletDefinition);
View Full Code Here

            return super.handleRequest(request, response, ctx);           
        }
        // configure velocity context
        PortletRequest renderRequest = (PortletRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
        RenderResponse renderResponse = (RenderResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
        PortletConfig portletConfig = (PortletConfig) request.getAttribute(ContainerConstants.PORTLET_CONFIG);
        if (renderRequest != null)
        {
            renderRequest.setAttribute(VELOCITY_CONTEXT_ATTR, ctx);
        }
               
View Full Code Here

        }
    }

    public void init(PortletFilterConfig filterConfig) throws PortletException
    {
        PortletConfig portletConfig = filterConfig.getPortletConfig();
        PortletContext portletContext = portletConfig.getPortletContext();
        String configFile = portletConfig.getInitParameter(CONFIG_FILE);
        if (configFile == null)
        {
            configFile = portletContext.getRealPath(DEFAULT_CONFIG_FILE);
        }
        else if (configFile.startsWith(WEBAPP_ROOT_PREFIX))
View Full Code Here

          {
            case portletConfig:
              // only resolved in a Faces expression
              if (isFacesResolved)
              {
                PortletConfig config = bridgeContext.getPortletConfig();
                if (config != null)
                {
                  context.setPropertyResolved(true);
                  return config;
                } else
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);
         
          // Don't add if there isn't a view
          if (viewId == null || viewId.length() == 0) continue;
         
          // extract the mode
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.