Examples of PortletAppDD


Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

            throw new PortletContainerException(msg);
        }
       
        // obtain the portlet application descriptor for the portlet
        // context.
        PortletAppDD portletAppDD = PortletDescriptorRegistry
                                        .getRegistry()
                                        .getPortletAppDD(portletCtx);
       
        // we can't return null
        if (portletAppDD == null) {
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

        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();
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

                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());
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

        Collection servletElements = new ArrayList();
        Collection mappingElements = new ArrayList();

        PortletAppDescriptorService portletAppDescriptorService =
              new PortletAppDescriptorServiceImpl();
        PortletAppDD portletAppDD = portletAppDescriptorService.read(portletXmlIn);
       
        for (Iterator it = portletAppDD.getPortlets().iterator();
            it.hasNext(); ) {
           
          // Read portlet definition.
          PortletDD portlet = (PortletDD) it.next();
            String name = portlet.getPortletName();
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

                    "Unable to locate servlet context: " + contextPath
                    + ": ensure that crossContext support is enabled "
                    + "and the portlet application has been deployed.");
            }

            PortletAppDD portletAppDD = getPortletDescriptor(
                portletAppServletContext);
            if (portletAppDD == null) {
              throw new DriverAdministrationException(
                  "Unable to retrieve portlet application descriptor from "
                  + contextPath + ": ensure that the portlet application "
                  + "has been deployed.");
            }
            for (Iterator it = portletAppDD.getPortlets().iterator();
                it.hasNext(); ) {
                PortletDD portletDD = (PortletDD) it.next();
                PortletWindowConfig portletWindowConfig = new PortletWindowConfig();
                portletWindowConfig.setContextPath(contextPath);
                portletWindowConfig.setPortletName(portletDD.getPortletName());
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

    }

    public void testParse() throws IOException {
        InputStream in = new ByteArrayInputStream(xml.toString().getBytes());

        PortletAppDD dd = service.read(in);
        assertEquals("1.0", dd.getVersion());
        assertEquals(1, dd.getPortlets().size());

        PortletDD pd = (PortletDD)dd.getPortlets().get(0);
        assertEquals(2, pd.getDisplayNames().size());
        assertEquals(1, pd.getDescriptions().size());
        assertEquals("About Portlet", ((DisplayNameDD)pd.getDisplayNames().get(0)).getDisplayName());
        assertEquals("en", ((DisplayNameDD)pd.getDisplayNames().get(0)).getLang());
        assertEquals("fr", ((DisplayNameDD)pd.getDisplayNames().get(1)).getLang());
        assertEquals(30, pd.getExpirationCache());
        assertEquals(1, pd.getSupportedLocales().size());
        assertEquals("en", pd.getSupportedLocales().get(0));
        assertEquals(1, pd.getInitParams().size());
        assertEquals(1, ((InitParamDD)pd.getInitParams().get(0)).getDescriptions().size());

        assertEquals(2, dd.getCustomPortletModes().size());
        assertEquals(2, dd.getCustomWindowStates().size());
        assertEquals(1, dd.getUserAttributes().size());
        assertEquals(1, dd.getSecurityConstraints().size());

        SecurityConstraintDD sc = (SecurityConstraintDD)dd.getSecurityConstraints().get(0);
        assertNotNull(sc.getPortletCollection());
        assertEquals(1, sc.getDisplayNames().size());
        assertEquals(3, sc.getPortletCollection().getPortletNames().size());
        assertEquals("a", sc.getPortletCollection().getPortletNames().get(0));
        assertEquals("b", sc.getPortletCollection().getPortletNames().get(1));
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

     *
     * @return WebAppDD instance representing the descriptor.
     * @throws java.io.IOException
     */
    public PortletAppDD read(InputStream in) throws IOException {
        PortletAppDD portlet =
            (PortletAppDD) readInternal(in);
        return portlet;
    }
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

    public InternalPortletContext register(ServletContext servletContext)
        throws PortletContainerException {
        String applicationId = getContextPath(servletContext);
        if (!portletContexts.containsKey(servletContext)) {

            PortletAppDD portletAppDD = PortletDescriptorRegistry.getRegistry()
                .getPortletAppDD(servletContext);

            PortletContextImpl portletContext = new PortletContextImpl(
                applicationId,  servletContext, portletAppDD);
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

            throw new ServletException(ex);
        }

        // Retrieve the portletDD and create portlet config.
        PortletDD portletDD = null;
        PortletAppDD portletAppDD =
            portletContext.getPortletApplicationDefinition();
        for (Iterator it = portletAppDD.getPortlets().iterator();
             it.hasNext();) {
            PortletDD currentDD = (PortletDD) it.next();
            if (currentDD.getPortletName().equals(portletName)) {
                portletDD = currentDD;
                break;
View Full Code Here

Examples of org.apache.pluto.descriptors.portlet.PortletAppDD

        try {           
            if (portletRegistry == null) {
                LOG.error("Optional Portlet Registry Service not found.");
                throw new PortletContainerException("Optional Portlet Registry Service not found.");
            }           
            PortletAppDD ctx = portletRegistry.getPortletApplicationDescriptor(applicationId);
            Iterator i = ctx.getPortlets().iterator();
            while(i.hasNext()) {
                PortletDD dd = (PortletDD)i.next();
                if(portletName.equals(dd.getPortletName())) {
                    Iterator i2 = dd.getSupports().iterator();
                    while(i2.hasNext()) {
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.