Package org.apache.pluto.driver.services.portal

Examples of org.apache.pluto.driver.services.portal.PortletApplicationConfig


            return null;
        }
        String context = getContextFromPortletId(id);
        String portlet = getPortletNameFromPortletId(id);

        PortletApplicationConfig app = getPortletApp(context);
        if (app == null) {
            if (LOG.isErrorEnabled()) {
                LOG.error("Portlet Application '" + context + "' not found.");
            }
            return null;
        }
        return app.getPortlet(portlet);
    }
View Full Code Here


    {
        LOG.debug("Loading Portlet Applications...");
        Iterator apps = portletRegistry.getPortletApplications().iterator();
        while (apps.hasNext())
        {
            PortletApplicationConfig app = (PortletApplicationConfig)apps.next();
            LOG.debug("Loading [" + app.getContextPath() + "]");
            portletApps.put(app.getContextPath(), app);
        }
        LOG.debug("Loaded [" + portletApps.size() + "] Portlet Applications.");
    }
View Full Code Here

        // the supportedPortletModesByPortlet map.
        LOG.debug("Loading modes supported by each Portlet...");
        Iterator apps = portletApps.values().iterator();
        while (apps.hasNext())
        {
            PortletApplicationConfig app = (PortletApplicationConfig)apps.next();           
            PortletAppDD portletAppDD;
            try {
                portletAppDD = container
                    .getPortletApplicationDescriptor(app.getContextPath());
            } catch (PortletContainerException e) {
                LOG.warn(e);
                continue;
            }
                       
            // for each portletAppDD, retrieve the portletDD and the supported modes
            Iterator portlets = portletAppDD.getPortlets().iterator();
            while (portlets.hasNext()) {               
                PortletDD portlet = (PortletDD)portlets.next();
                LOG.debug("Loading modes supported by portlet [" + app.getContextPath() + "]." +
                        "[" + portlet.getPortletName() + "]");
                Iterator supports = portlet.getSupports().iterator();
                Set pModes = new HashSet();
                while (supports.hasNext())
                {
                    SupportsDD supportsDD = (SupportsDD)supports.next();
                    Iterator portletModes = supportsDD.getPortletModes().iterator();
                   
                    while (portletModes.hasNext())
                    {
                        PortletMode pMode = new PortletMode((String)portletModes.next());
                        LOG.debug("Adding mode [" + pMode + "]");
                        pModes.add(pMode);                               
                    }                   
                }
               
                supportedPortletModesByPortlet.put(
                        PortletWindowConfig.createPortletId(app.getContextPath(), portlet.getPortletName()),
                        pModes);                    
            }
        }
    }
View Full Code Here

     * @param contextPath the context
     * @return the PortletApplicationConfig, or null if it wasn't found.
     */
    private PortletApplicationConfig getPortletApplication(String contextPath)
    {
        PortletApplicationConfig app = null;
        // attempt to retrieve the PortletApplicationConfig from the map
        app = (PortletApplicationConfig)portletApps.get(contextPath);
       
        // if it wasn't in the map, perhaps it has been added since
        // the container was started
View Full Code Here

        if (contextPath == null) {
            throw new IllegalArgumentException(
                "Portlet application context path cannot be null.");
        }
        try {
            PortletApplicationConfig portletAppConfig =
                new PortletApplicationConfig();
            portletAppConfig.setContextPath(contextPath);

            ServletContext portletAppServletContext = servletContext.getContext(contextPath);
            if (portletAppServletContext == null) {
                final String msg = "Unable to locate servlet context: " + contextPath                   
                    + ": ensure that crossContext support is enabled "
                    + "and the portlet application has been deployed.";
                LOG.error(msg);
                throw new DriverAdministrationException(msg);
            }
           
            PortletContainer container = (PortletContainer)servletContext
                .getAttribute(AttributeKeys.PORTLET_CONTAINER);
            PortletAppDD portletAppDD = container.getPortletApplicationDescriptor(contextPath);
           
            if (portletAppDD == null) {
                final String msg = "Unable to retrieve portlet application descriptor from "
                    + contextPath + ": ensure that the portlet application "
                    + "has been deployed.";
                LOG.error(msg);
              throw new DriverAdministrationException(msg);
            }
            for (Iterator it = portletAppDD.getPortlets().iterator();
                it.hasNext(); ) {
                PortletDD portletDD = (PortletDD) it.next();
                PortletWindowConfig portletWindowConfig = new PortletWindowConfig();
                portletWindowConfig.setContextPath(contextPath);
                portletWindowConfig.setPortletName(portletDD.getPortletName());
                portletAppConfig.addPortlet(portletWindowConfig);
            }
            config.addPortletApp(portletAppConfig);
           
        } catch (PortletContainerException ex) {
            final String msg = "Unable to add portlet application from " + contextPath;
View Full Code Here

TOP

Related Classes of org.apache.pluto.driver.services.portal.PortletApplicationConfig

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.