Package org.apache.pluto.container.impl

Examples of org.apache.pluto.container.impl.PortletAppDescriptorServiceImpl


        portletInvokerService = new DefaultPortletInvokerService(portletContextService);
        portletEnvironmentService = new PortletEnvironmentServiceImpl();
        portalAdministrationService = new DefaultPortalAdministrationService();
        userInfoService = new DefaultUserInfoService();
        namespaceMapper = new DefaultNamespaceMapper();
        descriptorService = new PortletAppDescriptorServiceImpl();                       
        ccppProfileService = new DummyCCPPProfileServiceImpl();
    }
View Full Code Here


            namespaceMapper = root.getNamespaceMapper();
        }
       
        if (descriptorService == null)
        {
            descriptorService = new PortletAppDescriptorServiceImpl();
        }
       
        if (root.getCCPPProfileService() != null)
        {
            ccppProfileService = root.getCCPPProfileService();
View Full Code Here

                getClass().getResourceAsStream( portletXmlResource ) );
        assembledWebXml.delete();
    }
   
    protected void verifyAssembly( InputStream webXml, InputStream portletXml ) throws Exception {
        PortletAppDescriptorService portletSvc = new PortletAppDescriptorServiceImpl();
        PlutoWebXmlRewriter webXmlRewriter = new PlutoWebXmlRewriter( webXml );
        PortletApplicationDefinition portletApp = portletSvc.read( "test", "/test", portletXml );
       
        assertNotNull( "Web Application Descripter was null.", webXmlRewriter );
        assertNotNull( "Portlet Application Descriptor was null.", portletApp );
        assertTrue( "Portlet Application Descriptor doesn't define any portlets.", portletApp.getPortlets().size() > 0 );
        assertTrue( "Web Application Descriptor doesn't define any servlets.", webXmlRewriter.hasServlets() );
View Full Code Here

        assertEquals( "Dispatcher servlet incorrect for test portlet [" + testPortletName + "]",  Assembler.DISPATCH_SERVLET_CLASS, servletClassName );       
    }

    protected void verifyAssembly( File warFile ) throws Exception {
        PlutoWebXmlRewriter webXmlRewriter = null;
        PortletAppDescriptorService portletSvc = new PortletAppDescriptorServiceImpl();
        int entryCount = 0;
        ByteArrayOutputStream portletXmlBytes = new ByteArrayOutputStream();
        ByteArrayOutputStream webXmlBytes = new ByteArrayOutputStream();
        PortletApplicationDefinition portletApp = null;       
               
        JarInputStream assembledWarIn = new JarInputStream( new FileInputStream( warFile ) );
        JarEntry tempEntry;
       
        while ( ( tempEntry = assembledWarIn.getNextJarEntry() ) != null  ) {
            entryCount++;
           
            if ( Assembler.PORTLET_XML.equals( tempEntry.getName() ) ) {
                IOUtils.copy( assembledWarIn, portletXmlBytes );
                portletApp = portletSvc.read( "test", "/test", new ByteArrayInputStream( portletXmlBytes.toByteArray() ) );
            }
            if ( Assembler.SERVLET_XML.equals( tempEntry.getName() ) ) {
                IOUtils.copy( assembledWarIn, webXmlBytes );
                webXmlRewriter = new PlutoWebXmlRewriter( new ByteArrayInputStream( webXmlBytes.toByteArray() ) );
            }
View Full Code Here

   
    protected void validateEarAssembly( File earFile ) throws Exception {
        assertTrue( "EAR archive [" + earFile.getAbsolutePath() + "] cannot be found or cannot be read",
                earFile.exists() && earFile.canRead() );
       
        PortletAppDescriptorService portletSvc = new PortletAppDescriptorServiceImpl();
        PortletApplicationDefinition portletApp = null;

        PlutoWebXmlRewriter webXmlRewriter = null;
       
        int earEntryCount = 0;
        int warEntryCount = 0;
       
        JarInputStream earIn = new JarInputStream( new FileInputStream( earFile ) );
       
        JarEntry earEntry;
        JarEntry warEntry;
       
        while ( ( earEntry = earIn.getNextJarEntry() ) != null ) {
            earEntryCount++;
            if ( earEntry.getName().endsWith( ".war" ) ) {
                warEntryCount++;
                JarInputStream warIn = new JarInputStream( earIn );
                while ( ( warEntry = warIn.getNextJarEntry() ) != null ) {
                    if ( Assembler.PORTLET_XML.equals( warEntry.getName() ) ) {
                      portletApp = portletSvc.read( "test", "/test",
                                new ByteArrayInputStream( IOUtils.toByteArray( warIn ) ) );
                    }
                    if ( Assembler.SERVLET_XML.equals( warEntry.getName() ) ) {
                        webXmlRewriter = new PlutoWebXmlRewriter( new ByteArrayInputStream( IOUtils.toByteArray( warIn ) ) );
                    }
View Full Code Here

   
    protected void validateEarAssembly( File earFile ) throws Exception {
        assertTrue( "EAR archive [" + earFile.getAbsolutePath() + "] cannot be found or cannot be read",
                earFile.exists() && earFile.canRead() );
       
        PortletAppDescriptorService portletSvc = new PortletAppDescriptorServiceImpl();
        PortletApplicationDefinition portletApp = null;
       
        PlutoWebXmlRewriter webXmlRewriter = null;
       
        List<String> portletWarEntries = Arrays.asList( testWarEntryNames );
        List<String> unassembledWarEntries = Arrays.asList( unassembledWarEntryName );
        List<String> testPortlets = Arrays.asList( testPortletNames );
       
        int earEntryCount = 0;
        int totalWarEntryCount = 0;
        int portletWarEntryCount = 0;
       
        JarInputStream earIn = new JarInputStream( new FileInputStream( earFile ) );
       
        JarEntry earEntry;
        JarEntry warEntry;
       
       
        while ( ( earEntry = earIn.getNextJarEntry() ) != null ) {           
            earEntryCount++;
           
            if ( earEntry.getName().endsWith( ".war" ) ) {
                totalWarEntryCount++;
                JarInputStream warIn = new JarInputStream( earIn );
               
                while ( ( warEntry = warIn.getNextJarEntry() ) != null ) {
                    if ( Assembler.PORTLET_XML.equals( warEntry.getName() ) ) {
                        portletApp = portletSvc.read( "test", "/test",
                                new ByteArrayInputStream( IOUtils.toByteArray( warIn ) ) );
                    }
                    if ( Assembler.SERVLET_XML.equals( warEntry.getName() ) ) {
                        webXmlRewriter = new PlutoWebXmlRewriter( new ByteArrayInputStream( IOUtils.toByteArray( warIn ) ) );
                    }
View Full Code Here

            {
                throw (IOException) e;
            }
            throw new IOException(e.getMessage());
        }
        PortletApplicationDefinition portletAppDD = new PortletAppDescriptorServiceImpl().read("test", "/test", portletXmlIn);
        portletXmlIn.close();
        for (PortletDefinition portlet : portletAppDD.getPortlets())
        {
            webXmlRewriter.injectPortletServlet(dispatchServletClass, portlet.getPortletName());
        }
View Full Code Here

     * implementation.
     */
    public DefaultOptionalContainerServices() {
        rdService = new RequestDispatcherServiceImpl();
        portletPreferencesService = new DefaultPortletPreferencesService();
        portletRegistryService = new PortletContextManager(rdService, new PortletAppDescriptorServiceImpl());
        portletContextService = (PortletContextManager)portletRegistryService;
        portletInvokerService = new DefaultPortletInvokerService(portletContextService);
        portletEnvironmentService = new PortletEnvironmentServiceImpl();
        portalAdministrationService = new DefaultPortalAdministrationService();
        userInfoService = new DefaultUserInfoService();
        namespaceMapper = new DefaultNamespaceMapper();
        descriptorService = new PortletAppDescriptorServiceImpl();                       
        ccppProfileService = new DummyCCPPProfileServiceImpl();
    }
View Full Code Here

            namespaceMapper = root.getNamespaceMapper();
        }
       
        if (descriptorService == null)
        {
            descriptorService = new PortletAppDescriptorServiceImpl();
        }
       
        if (root.getCCPPProfileService() != null)
        {
            ccppProfileService = root.getCCPPProfileService();
View Full Code Here

    }

    protected void createDefaultServicesIfNeeded()
    {
        rdService = rdService == null ? new RequestDispatcherServiceImpl() : rdService;
        portletRegistryService = portletRegistryService == null ? new PortletContextManager(rdService, new PortletAppDescriptorServiceImpl()) : portletRegistryService;
        portletContextService = portletContextService == null ? (PortletContextManager)portletRegistryService : portletContextService;
        portalAdministrationService = portalAdministrationService == null ? new DefaultPortalAdministrationService() : portalAdministrationService;
        ccppProfileService = ccppProfileService == null ? new DummyCCPPProfileServiceImpl() : ccppProfileService;
        portletPreferencesService = portletPreferencesService == null ? new DefaultPortletPreferencesService() : portletPreferencesService;
        portletInvokerService = portletInvokerService == null ? new DefaultPortletInvokerService(portletContextService) : portletInvokerService;
View Full Code Here

TOP

Related Classes of org.apache.pluto.container.impl.PortletAppDescriptorServiceImpl

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.