Package org.apache.jetspeed.om.portlet.impl

Examples of org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl


    private void setupTestData()
    throws Exception
    {
               
        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName(TEST_APP);
        app.setApplicationIdentifier(TEST_APP);
               
        WebApplicationDefinitionImpl webApp = new WebApplicationDefinitionImpl();
        webApp.setContextRoot("/app1");
        webApp.addDescription(Locale.FRENCH, "Description: Le fromage est dans mon pantalon!");
        webApp.addDisplayName(Locale.FRENCH, "Display Name: Le fromage est dans mon pantalon!");
       
        PortletDefinitionComposite portlet = new PortletDefinitionImpl();
        portlet.setClassName("org.apache.Portlet");
        portlet.setName(TEST_PORTLET);
        portlet.addDescription(Locale.getDefault(),"Portlet description.");
        portlet.addDisplayName(Locale.getDefault(),"Portlet display Name.");
       
        portlet.addInitParameter("testparam", "test value", "This is a test portlet parameter", Locale.getDefault());
                       
        app.addPortletDefinition(portlet);     
   
        app.setWebApplicationDefinition(webApp);
       
        PreferenceSetComposite prefSet = (PreferenceSetComposite) portlet.getPreferenceSet();
        prefSet.add("pref1", Arrays.asList(new String[]{"1"}));
       
        registry.registerPortletApplication(app);          
View Full Code Here


    private void setupTestData() throws Exception
    {
        String lang = Locale.getDefault().toString();

        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName(TEST_APP);
        app.setContextPath("/app1");

        PortletDefinition portlet = app.addPortlet(TEST_PORTLET);
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");
       
        InitParam initParam = portlet.addInitParam("testparam");
View Full Code Here

            portletRegistry.removeApplication((PortletApplication) itr.next());
        }

        // Create an Application and a Web app

        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName("PA-001");
        app.setContextPath("/pa-001");

        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");
       
        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");
       
        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");

        PortletDefinition portlet = app.addPortlet("Portlet-1");
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");
       
        InitParam initParam = portlet.addInitParam("testparam");
View Full Code Here

    private void buildTestData() throws RegistryException, LockFailedException
    {
        String lang = Locale.getDefault().toString();
       
        // Create an Application and a Web app     
        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName("App_1");
        app.setContextPath("/app1");

        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");

        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");

        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");

        addDublinCore(app.getMetadata());

        PortletDefinition portlet = app.addPortlet("Portlet 1");
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");

        InitParam initParam = portlet.addInitParam("testparam");
View Full Code Here

    private void buildTestData() throws RegistryException, LockFailedException
    {
        String lang = Locale.getDefault().toString();
       
        // Create an Application and a Web app     
        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName("App_1");
        app.setContextPath("/app1");
       
        app.addDescription(Locale.FRENCH.toString()).setDescription("Description: Le fromage est dans mon pantalon!");
        app.addDisplayName(Locale.FRENCH.toString()).setDisplayName("Display Name: Le fromage est dans mon pantalon!");

        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");

        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");

//        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");

        addDublinCore(app.getMetadata());

        PortletDefinition portlet = app.addPortlet("Portlet 1");
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");

        InitParam initParam = portlet.addInitParam("testparam");
View Full Code Here

    {
        // Part1a: data
        verifyData(false);

        // Part1b: updates
        PortletApplicationDefinitionImpl app = (PortletApplicationDefinitionImpl) registry.getPortletApplication("App_1");
        assertNotNull("PA App_1 is NULL", app);

        app.addUserAttribute("user.pets.doggie").addDescription(Locale.getDefault().toString()).setDescription("Busby");
       
        registry.updatePortletApplication(app);       
                               
        System.out.println("PA update test complete");
View Full Code Here

   
    public void testUpdates() throws Exception
    {
        String lang = Locale.getDefault().toString();
       
        PortletApplicationDefinitionImpl app = (PortletApplicationDefinitionImpl) registry.getPortletApplication("App_1");
        assertNotNull("PA App_1 is NULL", app);

        UserAttribute ua = app.addUserAttribute("user.pets.doggie");
        ua.addDescription(lang).setDescription("Busby");
       
        registry.updatePortletApplication(app);       
                               
        System.out.println("PA update test complete");
View Full Code Here

            portletRegistry.removeApplication((PortletApplication) itr.next());
        }

        // Create an Application and a Web app

        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName("App_1");
        app.setContextPath("/app1");

        app.addDescription(Locale.FRENCH.toString()).setDescription("Description: Le fromage est dans mon pantalon!");
        app.addDisplayName(Locale.FRENCH.toString()).setDisplayName("Display Name: Le fromage est dans mon pantalon!");
       
        UserAttributeRef uaRef = app.addUserAttributeRef("user-name-family");
        uaRef.setNameLink("user.name.family");

        UserAttribute ua = app.addUserAttribute("user.name.family");
        ua.addDescription(lang).setDescription("User Last Name");

        app.addJetspeedServiceReference("PortletEntityAccessComponent");
        app.addJetspeedServiceReference("PortletRegistryComponent");
       
        addDublinCore(app.getMetadata());

        PortletDefinition portlet = app.addPortlet("Portlet 1");
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");
       
        InitParam initParam = portlet.addInitParam("testparam");
View Full Code Here

        }
    }
   
    protected PortletApplication upgrade(PortletApplicationDefinition pa)
    {
        PortletApplication jpa = new PortletApplicationDefinitionImpl();       
        jpa.setDefaultNamespace(pa.getDefaultNamespace());
        jpa.setResourceBundle(pa.getResourceBundle());
        jpa.setVersion(pa.getVersion());
        for (org.apache.pluto.container.om.portlet.PortletDefinition pd : pa.getPortlets())
        {
            PortletDefinition jpd = jpa.addPortlet(pd.getPortletName());
            upgradePortlet(jpd, pd);
        }
        for (org.apache.pluto.container.om.portlet.ContainerRuntimeOption cro : pa.getContainerRuntimeOptions())
        {
            ContainerRuntimeOption jcro = jpa.addContainerRuntimeOption(cro.getName());
            for (String value : cro.getValues())
            {
                jcro.addValue(value);
            }
        }
        for (org.apache.pluto.container.om.portlet.CustomPortletMode cpm : pa.getCustomPortletModes())
        {
            CustomPortletMode jcpm = jpa.addCustomPortletMode(cpm.getPortletMode());
            jcpm.setPortalManaged(cpm.isPortalManaged());
            for (org.apache.pluto.container.om.portlet.Description desc : cpm.getDescriptions())
            {
                Description jdesc = jcpm.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }           
        }
        for (org.apache.pluto.container.om.portlet.CustomWindowState cws : pa.getCustomWindowStates())
        {
            CustomWindowState jcws = jpa.addCustomWindowState(cws.getWindowState());
            for (org.apache.pluto.container.om.portlet.Description desc : cws.getDescriptions())
            {
                Description jdesc = jcws.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }           
        }       
        for (org.apache.pluto.container.om.portlet.EventDefinition ed : pa.getEventDefinitions())
        {
            EventDefinition jed = null;
            if (ed.getQName() != null)
            {
                jed = jpa.addEventDefinition(ed.getQName());
            }
            else
            {
                jed =jpa.addEventDefinition(ed.getName());
            }
            jed.setValueType(ed.getValueType());
            for (QName alias : ed.getAliases())
            {
                jed.addAlias(alias);
            }
            for (org.apache.pluto.container.om.portlet.Description desc : ed.getDescriptions())
            {
                Description jdesc = jed.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }                       
        }
        for (org.apache.pluto.container.om.portlet.FilterMapping fm : pa.getFilterMappings())
        {
            FilterMapping jfm = jpa.addFilterMapping(fm.getFilterName());
            for (String portletName : fm.getPortletNames())
            {
                jfm.addPortletName(portletName);
            }
        }
        for (org.apache.pluto.container.om.portlet.Filter f : pa.getFilters())
        {
            Filter jf = jpa.addFilter(f.getFilterName());
            jf.setFilterClass(f.getFilterClass());
            for (org.apache.pluto.container.om.portlet.Description desc : f.getDescriptions())
            {
                Description jdesc = jf.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }                                  
            for (org.apache.pluto.container.om.portlet.DisplayName dn : f.getDisplayNames())
            {
                DisplayName jdn = jf.addDisplayName(dn.getLang());
                jdn.setDisplayName(dn.getDisplayName());
            }
            for (org.apache.pluto.container.om.portlet.InitParam ip : f.getInitParams())
            {
                InitParam jip = jf.addInitParam(ip.getParamName());
                jip.setParamValue(ip.getParamValue());
                for (org.apache.pluto.container.om.portlet.Description desc : ip.getDescriptions())
                {
                    Description jdesc = jip.addDescription(desc.getLang());
                    jdesc.setDescription(desc.getDescription());
                }                                       
            }
            for (String lc : f.getLifecycles())
            {
                jf.addLifecycle(lc);
            }           
        }
        for (org.apache.pluto.container.om.portlet.Listener l : pa.getListeners())
        {
            Listener jl = jpa.addListener(l.getListenerClass());
            for (org.apache.pluto.container.om.portlet.Description desc : l.getDescriptions())
            {
                Description jdesc = jl.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }                                       
            for (org.apache.pluto.container.om.portlet.DisplayName dn : l.getDisplayNames())
            {
                DisplayName jdn = jl.addDisplayName(dn.getLang());
                jdn.setDisplayName(dn.getDisplayName());
            }
        }
        for (org.apache.pluto.container.om.portlet.PublicRenderParameter prd : pa.getPublicRenderParameters())
        {           
            PublicRenderParameter jprp = null;
            if (prd.getQName() != null)
            {
                jprp = jpa.addPublicRenderParameter(prd.getQName(), prd.getIdentifier());
            }
            else
            {
                jprp = jpa.addPublicRenderParameter(prd.getName(), prd.getIdentifier());
            }
            for (QName alias : prd.getAliases())
            {
                jprp.addAlias(alias);
            }
            for (org.apache.pluto.container.om.portlet.Description desc : prd.getDescriptions())
            {
                Description jdesc = jprp.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }
        }
        for (org.apache.pluto.container.om.portlet.SecurityConstraint sc :  pa.getSecurityConstraints())
        {
            SecurityConstraint jsc = jpa.addSecurityConstraint(sc.getUserDataConstraint().getTransportGuarantee());
            for (org.apache.pluto.container.om.portlet.DisplayName dn : sc.getDisplayNames())
            {
                DisplayName jdn = jsc.addDisplayName(dn.getLang());
                jdn.setDisplayName(dn.getDisplayName());
            }
            for (String portletName : sc.getPortletNames())
            {
                jsc.addPortletName(portletName);
            }           
        }
        for (org.apache.pluto.container.om.portlet.UserAttribute ua : pa.getUserAttributes())
        {
            UserAttribute jua = jpa.addUserAttribute(ua.getName());
            for (org.apache.pluto.container.om.portlet.Description desc : ua.getDescriptions())
            {
                Description jdesc = jua.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }                                                   
View Full Code Here

        clearDBs();

        assertNotNull("statistics service is null", statistics);

        RequestContext request = initRequestContext();
        PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl();
        app.setName("MyApp");
        PortletDefinition portlet = app.addPortlet("TestPortlet");
        long elapsedTime = 123;
        statistics.logPortletAccess(request, portlet.getUniqueName(), "401",
                elapsedTime);
        statistics.logPageAccess(request, "401", elapsedTime);
        statistics.logUserLogin(request, elapsedTime);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl

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.