Package org.apache.pluto.driver.services.portal

Examples of org.apache.pluto.driver.services.portal.PageConfig


    private PageConfig getPageConfig(String page) {
        DriverConfiguration driverConfig = (DriverConfiguration) getPortletContext()
            .getAttribute(AttributeKeys.DRIVER_CONFIG);

        PageConfig config = driverConfig.getPageConfig(page);
        return config;
    }
View Full Code Here


            (DriverConfiguration) getPortletContext().getAttribute(AttributeKeys.DRIVER_CONFIG);

        ArrayList list = new ArrayList();
        Iterator it = configuration.getPages().iterator();
        while (it.hasNext()) {
            PageConfig config = (PageConfig) it.next();
            ArrayList portlets = new ArrayList();
            Iterator pids = config.getPortletIds().iterator();
            while (pids.hasNext()) {
                String pid = pids.next().toString();
                String name = PortletWindowConfig.parsePortletName(pid);
                portlets.add(new Placement(pid, name));
            }
            list.add(new Page(config.getName(), config.getName(), portlets));
        }

        return list;
    }
View Full Code Here

      renderConfig.append(NL);
      Collection pages = getAvailablePages();
      //iterate through pages
      for (Iterator iter = pages.iterator(); iter.hasNext();) {
      Page page = (Page) iter.next();
          PageConfig config = driverConfig.getPageConfig(page.getName());
          renderConfig.append("    <page name=\"");
          String pageName = config.getName();
          renderConfig.append(pageName);
          renderConfig.append("\" uri=\"");
          String uri = config.getUri();
          renderConfig.append(uri);
        renderConfig.append("\">");
        renderConfig.append(NL);
         
          //iterate through portlets in current page
          Collection portletIds = config.getPortletIds();
          for (Iterator iterator = portletIds.iterator(); iterator.hasNext();) {
            renderConfig.append("      <portlet context=\"");
        String pid = (String) iterator.next();
        String pletContext = PortletWindowConfig.parseContextPath(pid);
        renderConfig.append(pletContext);
View Full Code Here

    Collection<PortletWindowConfig> portlets = new ArrayList<PortletWindowConfig>();
        Collection pages = driverConfig.getPages();
        if (pages != null){
            Iterator iPages = pages.iterator();
            while(iPages.hasNext()){
                PageConfig pageConfig = (PageConfig) iPages.next();
                Collection portletIDs = pageConfig.getPortletIds();
                if (portletIDs != null){
                    Iterator iPortletIDs = portletIDs.iterator();
                    while(iPortletIDs.hasNext()){
                        portlets.add(PortletWindowConfig.fromId(iPortletIDs.next().toString()));
                    }
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.pluto.driver.services.portal.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.