Package org.apache.geronimo.pluto.impl

Examples of org.apache.geronimo.pluto.impl.PageConfig


        super.setUp();
       
        navigationJsonGenerator=new NavigationJsonGenerator(null);
       
        pageList = new ArrayList<PageConfig>();
        PageConfig pc = new PageConfig();

        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("2-2/cat2/item2-2");
        pc.setUri("/server/serverlog");

        pageList.add(pc);

        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("1-1-1-1/cat1/cat1-1/cat1-1-1/item1-1-1-1");
        pc.setUri("/server/serverlog");
        pageList.add(pc);

       
        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("2-2-1/cat2/cat2-1/item2-2-1");
        pc.setUri("/server/serverlog");

        pageList.add(pc);

        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("1-2/cat1/item1-2");
        pc.setUri("/server/serverlog");
        pageList.add(pc);
   

       
    }
View Full Code Here


       
    }

    public void testLeafTreeNode() {
       
        PageConfig pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("1-2/applications/deploy");
        TreeNode leafNode=null;
        try {
           leafNode=new TreeNode(pc);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        Assert.assertNotNull(leafNode);
        Assert.assertEquals("1-2", leafNode.getId());
        Assert.assertEquals("applications/deploy", leafNode.getPath());
        Assert.assertEquals("deploy", leafNode.getLabel());
        Assert.assertEquals("/images/ico_deploy_16x16.gif", leafNode.getIcon());
        Assert.assertTrue(leafNode.isLeafNode());
        Assert.assertFalse(leafNode.isTopNode());
        Assert.assertNull(leafNode.getChildren());
       
        //test illegal pageConfig name
        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("applications/deploy");
        leafNode=null;
        try {
           leafNode=new TreeNode(pc);
        } catch (Exception e) {
            return;
View Full Code Here

   
  
    public void testPopulateTree() {
       
        List<PageConfig> pageConfigList = new ArrayList<PageConfig>();
        PageConfig pc = new PageConfig();

        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("2-2/cat2/item2-2");
        pageConfigList.add(pc);

        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("1-1-1-1/cat1/cat1-1/cat1-1-1/item1-1-1-1");
        pageConfigList.add(pc);

        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("2-2-1/cat2/cat2-1/item2-2-1");
        pc.setUri("/server/serverlog");

        pageConfigList.add(pc);
        pc = new PageConfig();
        pc.setIcon("/images/ico_deploy_16x16.gif");
        pc.setName("1-2/cat1/item1-2");
        pageConfigList.add(pc);
       
       
        Map<String, TreeNode> navigationTree = new TreeMap<String, TreeNode>();
       
View Full Code Here

    * This will add the portlets to the PageConfig in Pluto.
    * @see org.apache.geronimo.pluto.PlutoAccessInterface#addPortlets(java.lang.String, java.lang.String, java.util.ArrayList)
    */
    private void addPortlets() {
        if (pageExists()) {
            PageConfig pageConfig = getPageConfigFromPluto();
            int portletCount = portletList.size();
            for (int i = 0; i < portletCount; i++) {
                pageConfig.addPortlet(portletContext, portletList.get(i));
            }
        } else {
            log.warn("Cannot add portlets to non-existent page " + pageTitle);
        }
    }
View Full Code Here

     * Removes a PageConfig object in Pluto with the pageTitle
     * @see org.apache.geronimo.pluto.PlutoAccessInterface#removePage(java.lang.String)
     */
    private void removePage() {
        //all we really need is a PageConfig with the page name
        PageConfig pageConfig = createPageConfig();

        RenderConfigAdminService renderConfig = portletContainerServices.getAdminConfiguration().getRenderConfigAdminService();

        //This removePage method was added into Pluto as a patch (PLUTO-387). addPage functionality
        //was available, but removePage functionality was unavailable.
View Full Code Here

    * Removes the portletList from the PageConfig in Pluto
    * @see org.apache.geronimo.pluto.PlutoAccessInterface#removePortlets(java.lang.String, java.util.ArrayList)
    */
    private void removePortlets() {
        if (pageExists()) {
            PageConfig pageConfig = getPageConfigFromPluto();
            int portletCount = portletList.size();
            Collection<String> list = pageConfig.getPortletIds();

            //run through the list of portlets to remove
            for (int i = 0; i < portletCount; i++) {
                String portletName = portletList.get(i);

                //run through the list of portlets on this page and see if we can find a match
                for (String pid : list) {
                    String pletContext = PortletWindowConfig.parseContextPath(pid);
                    String pletName = PortletWindowConfig.parsePortletName(pid);
                    if (portletContext.equals(pletContext) && portletName.equals(pletName)) {
                        pageConfig.removePortlet(pid);
                        break;
                    }
                }
            }
        } else {
View Full Code Here

    /*
     * Creates a new PageConfig object with this GBean's pageTitle
     */
    private PageConfig createPageConfig() {
        //Create a new PageConfig
        PageConfig pageConfig = new PageConfig();
        pageConfig.setName(pageTitle);
        pageConfig.setUri("/WEB-INF/themes/default-theme.jsp");
        pageConfig.setIcon(icon);
        return pageConfig;
    }
View Full Code Here

    /*
    * returns true if Pluto contains a PageConfig with that name and it has 0 or if there isn't a page with that name
    */
    private boolean pageIsEmpty() {
        if (pageExists()) {
            PageConfig pageConfig = getPageConfigFromPluto();
            return pageConfig.getPortletIds().size() == 0;
        } else {
            log.debug("no pageConfig found for " + pageTitle);
            return true;
        }
    }
View Full Code Here

        }

        //add the page if it doesn't exist yet
        if (!pageExists()) {
            //create a PageConfig
            PageConfig newPageConfig = createPageConfig();
            addPage(newPageConfig);
        }

        //add portlets to this newly created page
        addPortlets();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.pluto.impl.PageConfig

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.