Package org.apache.pluto.descriptors.servlet

Examples of org.apache.pluto.descriptors.servlet.ServletDD


            // Read portlet definition.
            PortletDD portlet = (PortletDD) it.next();
            String name = portlet.getPortletName();

            ServletDD servlet = new ServletDD();
            servlet.setServletName(name);

            servlet.setServletClass(dispatchServletClass);

            InitParamDD initParam = new InitParamDD();
            initParam.setParamName("portlet-name");
            initParam.setParamValue(name);
            servlet.getInitParams().add(initParam);

            LoadOnStartupDD onStartup = new LoadOnStartupDD();
            onStartup.setPriority(1);
            servlet.setLoadOnStartup(onStartup);

            ServletMappingDD servletMapping = new ServletMappingDD();
            servletMapping.setServletName(name);
            servletMapping.setUrlPattern("/PlutoInvoker/" + name);
View Full Code Here


        assertTrue( "WAR archive did not contain any portlets", portletAppDD.getPortlets().size() > 0 );
       
        PortletDD portlet = (PortletDD) portletAppDD.getPortlets().iterator().next();
        assertEquals( "Unexpected test portlet name.", testPortletName, portlet.getPortletName() );
       
        ServletDD servlet = webAppDD.getServlet( testPortletName );
        assertNotNull( "web.xml does not contain assembly for test portlet", servlet );
        assertEquals( "web.xml does not contain correct dispatch servet", Assembler.DISPATCH_SERVLET_CLASS,
                servlet.getServletClass() );
               
    }
View Full Code Here

                    for ( Iterator iter = portletAppDD.getPortlets().iterator(); iter.hasNext(); ) {
                        PortletDD portlet = (PortletDD) iter.next();
                        if (! testPortlets.contains( portlet.getPortletName() ) ) {
                            fail( "Unexpected test portlet name encountered: [" + portlet.getPortletName() + "]" );
                        }
                        ServletDD servlet = webAppDD.getServlet( portlet.getPortletName() );
                        assertNotNull( "web.xml does not contain assembly for test portlet", servlet );
                        assertEquals( "web.xml does not contain correct dispatch servet", Assembler.DISPATCH_SERVLET_CLASS,
                                servlet.getServletClass() );
                    }
                   
                }
               
                webAppDD = null;
View Full Code Here

        assertTrue( "Web Application Descriptor doesn't define any servlet mappings.", webApp.getServletMappings().size() > 0 );
       
        PortletDD portlet = (PortletDD) portletApp.getPortlets().iterator().next();
        assertTrue( "Unable to retrieve test portlet named [" + testPortletName + "]", portlet.getPortletName().equals( testPortletName ) );
       
        ServletDD servlet = webApp.getServlet( testPortletName );
        assertNotNull( "Unable to retrieve portlet dispatch for portlet named [" + testPortletName + "]", servlet );       
        assertEquals( "Dispatcher servlet incorrect for test portlet [" + testPortletName + "]",  Assembler.DISPATCH_SERVLET_CLASS, servlet.getServletClass() );       
    }
View Full Code Here

        assertTrue( "Web Application Descriptor doesn't define any servlet mappings.", webApp.getServletMappings().size() > 0 );

        PortletDD portlet = (PortletDD) portletApp.getPortlets().iterator().next();
        assertTrue( "Unable to retrieve test portlet named [" + testPortletName + "]", portlet.getPortletName().equals( testPortletName ) );

        ServletDD servlet = webApp.getServlet( testPortletName );
        assertNotNull( "Unable to retrieve portlet dispatch for portlet named [" + testPortletName + "]", servlet );       
        assertEquals( "Dispatcher servlet incorrect for test portlet [" + testPortletName + "]",  Assembler.DISPATCH_SERVLET_CLASS, servlet.getServletClass() );
    }
View Full Code Here

        if(debug) {
            System.out.println("<VERBOSE> Creating Servlet Wrapper for Portlet: '"+portlet.getPortletName()+"'");
        }
        String pnm = portlet.getPortletName();
        // check if already exists
        ServletDD servlet = webApp.getServlet(pnm);
        if (servlet != null) {
            String cl = servlet.getServletClass();
            if (!INVOKER_SERVLET.equals(cl)) {
                System.out.println(
                    "Note: Replaced already existing the servlet with the name '"
                    + pnm
                    + "' with the wrapper servlet."
                );
                servlet.setServletClass(INVOKER_SERVLET);
            }
        } else {
            servlet = new ServletDD();
            servlet.setServletName(pnm);
            servlet.setServletClass(INVOKER_SERVLET);
            webApp.getServlets().add(servlet);
        }

        servlet.setDisplayName(pnm + "Wrapper (Pluto Invoker)");
        servlet.setDescription("Auto Generated Portlet Invoker Servlet");

        InitParamDD param = new InitParamDD();
        param.setParamName("portlet-class");
        param.setParamValue(portlet.getPortletClass());
        servlet.getInitParams().add(param);

        param = new InitParamDD();
        param.setParamName("portlet-guid");
        param.setParamValue(portletAppDescriptorService.getContextPath()+"."+portlet.getPortletName());
        servlet.getInitParams().add(param);

        createSecurityRoleRefs(webApp, servlet, portlet);
    }
View Full Code Here

           
            // Read portlet definition.
            PortletDD portlet = (PortletDD) it.next();
            String name = portlet.getPortletName();

            ServletDD servlet = new ServletDD();
            servlet.setServletName(name);
    
            servlet.setServletClass(dispatchServletClass);

            InitParamDD initParam = new InitParamDD();
            initParam.setParamName("portlet-name");
            initParam.setParamValue(name);
            servlet.getInitParams().add(initParam);
           
            LoadOnStartupDD onStartup = new LoadOnStartupDD();
            onStartup.setPriority(1);
            servlet.setLoadOnStartup(onStartup);

            ServletMappingDD servletMapping = new ServletMappingDD();
            servletMapping.setServletName(name);
            servletMapping.setUrlPattern("/PlutoInvoker/" + name);
View Full Code Here

            // Read portlet definition.
            PortletDD portlet = (PortletDD) it.next();
            String name = portlet.getPortletName();

            ServletDD servlet = new ServletDD();
            servlet.setServletName(name);

            servlet.setServletClass(dispatchServletClass);

            InitParamDD initParam = new InitParamDD();
            initParam.setParamName("portlet-name");
            initParam.setParamValue(name);
            servlet.getInitParams().add(initParam);

            LoadOnStartupDD onStartup = new LoadOnStartupDD();
            onStartup.setPriority(1);
            servlet.setLoadOnStartup(onStartup);

            ServletMappingDD servletMapping = new ServletMappingDD();
            servletMapping.setServletName(name);
            servletMapping.setUrlPattern("/PlutoInvoker/" + name);
View Full Code Here

TOP

Related Classes of org.apache.pluto.descriptors.servlet.ServletDD

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.