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

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


         //This is the PLUTO-251 fix submitted by Charles Severence. Thank you!!!
         // Sometimes pages come with a prefix of a slash - if the page is not
         // found, and the first character of the pageId is a slash we attempt
         // to look up the page without the slash.
        
         PageConfig retval = (PageConfig) pages.get(pageId);
        
         if ( retval == null && pageId.startsWith("/") && pageId.length() > 2 ) {
           retval = (PageConfig) pages.get(pageId.substring(1));
         }
View Full Code Here


                    + "an AdminConfiguration must be specified "
                    + "to run the TCK.");
            }
           
            pageName = (new DecimalFormat("TCK00000")).format(pageCounter++);
            PageConfig pageConfig = new PageConfig();
            pageConfig.setName(pageName);
            pageConfig.setUri(DEFAULT_PAGE_URI);
            for (int i = 0; i < portletNames.length; i++) {
              debugWithName("Processing portlet name: " + portletNames[i]);
                int index = portletNames[i].indexOf("/");
                String contextPath = "/" + portletNames[i].substring(0, index);
                String portletName = portletNames[i].substring(index + 1);
                pageConfig.addPortlet(contextPath, portletName);
                adminConfig.getPortletRegistryAdminService()
                    .addPortletApplication(contextPath);
            }

            adminConfig.getRenderConfigAdminService().addPage(pageConfig);
View Full Code Here

    @Override
    /**
     * Get a "fake" page that contains ALL portlets (portlet instances)
     */
    public PageConfig getDefaultPage() {
        PageConfig pageConfig = pageConfigThreadLocal.get();
        if ((pageConfig == null) || (pageConfig.getPortletIds().isEmpty())) {
            try {
                pageConfig = JCRTemplate.getInstance().doExecuteWithSystemSessionInSameWorkspaceAndLocale(new JCRCallback<PageConfig>() {
                    public PageConfig doInJCR(JCRSessionWrapper session) throws RepositoryException {
                        PageConfig pageConfig = new PageConfig();
                        pageConfig.setUri(PortalDriverServlet.DEFAULT_PAGE_URI);
                        pageConfig.setName(DEFAULT_PAGE_NAME);
                        Query q = createAllPortletsQuery(session);
                        if (q != null) {
                            QueryResult qr = q.execute();
                            NodeIterator ni = qr.getNodes();
                            List<String> portletIds = new ArrayList<String>();
                            while (ni.hasNext()) {
                                JCRPortletNode nodeWrapper = new JCRPortletNode((JCRNodeWrapper) ni.nextNode());
                                portletIds.add(PortletWindowConfig.fromId(nodeWrapper));
                            }
                            pageConfig.setPortletIds(portletIds);

                        }
                        return pageConfig;
                    }
                });
            } catch (Exception e) {
                logger.error(e.getMessage(), e);
            }
            if (pageConfig.getPortletIds().isEmpty()) {
                pageConfigThreadLocal.set(null);
            } else {
                pageConfigThreadLocal.set(pageConfig);
            }
            return pageConfig;
View Full Code Here

        String applicationId = request.getParameter("applications");
        String portletId = request.getParameter("availablePortlets");

        LOG.info("Request: Add [applicationId=" + applicationId + ":portletId=" + portletId + "] to page '" + page + "'");

        PageConfig config = getPageConfig(page);
        config.addPortlet(applicationId, portletId);

    }
View Full Code Here

        if (uri == null) {
          uri = PortalDriverServlet.DEFAULT_PAGE_URI;
        }
        DriverConfiguration driverConfig = (DriverConfiguration) getPortletContext()
        .getAttribute(AttributeKeys.DRIVER_CONFIG);
        PageConfig pageConfig = new PageConfig();
        pageConfig.setName(page);
        pageConfig.setUri(uri);

        RenderConfigService renderConfig = driverConfig.getRenderConfigService();
        renderConfig.addPage(pageConfig);
    }
View Full Code Here

    if (page.equalsIgnoreCase("Pluto Admin")) {
      LOG.warn("Trying to delete the Pluto Admin page. Page deletion will be ignored.");
      return;
    }

    PageConfig pageConfig = getPageConfig(page);
        RenderConfigService renderConfig = driverConfig.getRenderConfigService();
        renderConfig.removePage(pageConfig);
    }
View Full Code Here

        String page = request.getParameter("page");
        String portletId = request.getParameter("placedPortlets");

        LOG.info("Request: Remove [portletId=" + portletId + "] from page '" + page + "'");

        PageConfig config = getPageConfig(page);
        config.removePortlet(portletId);
    }
View Full Code Here

    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

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.