Examples of DriverConfiguration


Examples of org.apache.pluto.driver.config.DriverConfiguration

      // Evaluate portlet ID attribute.
      evaluatePortletId();
       
      // Retrieve the portlet window config for the evaluated portlet ID.
        ServletContext servletContext = pageContext.getServletContext();
        DriverConfiguration driverConfig = (DriverConfiguration)
              servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
        PortletWindowConfig windowConfig = driverConfig
            .getPortletWindowConfig(evaluatedPortletId);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Rendering Portlet Window: " + windowConfig);
        }
       
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

    public void processEvents(PortletContainer container, PortletWindow portletWindow, HttpServletRequest request,
                              HttpServletResponse response, List<Event> events)
    {
        ServletContext containerServletContext = PortalRequestContext.getContext(request).getServletContext();
    DriverConfiguration driverConfig = (DriverConfiguration) containerServletContext
        .getAttribute(AttributeKeys.DRIVER_CONFIG);

    PortalURL portalURL = PortalURLParserImpl.getParser().parse(request);

//      Map<String, PortletWindowThread> portletWindowThreads = new HashMap<String, PortletWindowThread>();
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

        // Evaluate portlet ID attribute.
        evaluatePortletId();
       
        // Retrieve the portlet window config for the evaluated portlet ID.
        ServletContext servletContext = pageContext.getServletContext();
        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
       
        // Retrieve the portal environment.
        PortalRequestContext portalEnv = PortalRequestContext.getContext(
                (HttpServletRequest) pageContext.getRequest());       
       
        //find the current mode for use in 'selected' attrib of select option
    PortalURL requestedPortalUrl = portalEnv.getRequestedPortalURL();
        PortletWindowConfig windowConfig =
            PortletWindowConfig.fromId(evaluatedPortletId);
        // Retrieve the portlet container from servlet context.
        PortletContainer container = (PortletContainer)
                servletContext.getAttribute(AttributeKeys.PORTLET_CONTAINER);
       
        // Create the portlet window to render.
        PortletWindow window = new PortletWindowImpl(container, windowConfig, requestedPortalUrl);
   
    PortletMode currentMode = requestedPortalUrl.getPortletMode(window.getId().getStringId());

        //start the markup
        StringBuffer tag = new StringBuffer();
//        String strCurrentMode = currentMode.toString();       
//        tag.append("Current mode: " + currentMode.toString());
        tag.append("<form action=\"\" name=\"modeSelectionForm\" style=\"display:inline\"><select onchange=\"self.location=this.options[this.selectedIndex].value\">");
        Set<PortletMode> modeSet = null;
    try {
      modeSet = driverConfig.getSupportedPortletModes(evaluatedPortletId);
    } catch (PortletContainerException e) {
            throw new JspException(e);
    }
   
    if (modeSet != null) {
          Iterator<PortletMode> i = modeSet.iterator();
          while (i.hasNext()) {
            PortletMode mode = i.next();
 
              PortalURL portalUrl =  portalEnv.createPortalURL();
              portalUrl.setPortletMode(evaluatedPortletId, mode);
 
              // Build a string buffer containing the anchor tag
              tag.append("<option value=\"" + portalUrl.toString() + "\"");
              //Add 'selected' attribute for current mode.
              if (mode.equals(currentMode)) {
                tag.append(" selected=\"true\"");
              }
              tag.append(">");
              if (driverConfig.isPortletManagedMode(evaluatedPortletId, mode.toString())) {
                tag.append(getCustomModeDecorationName(driverConfig, mode));               
              } else {
                tag.append(mode.toString().toUpperCase());
              }
//              tag.append(mode.toString().toUpperCase());
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

        WebApplicationContext springContext = (WebApplicationContext)
                servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

        LOG.debug(" [1a] Loading DriverConfiguration. . . ");
        DriverConfiguration driverConfiguration = (DriverConfiguration)
                springContext.getBean("DriverConfiguration");

        driverConfiguration.init(servletContext);

        LOG.debug(" [1b] Registering DriverConfiguration. . .");
        servletContext.setAttribute(DRIVER_CONFIG_KEY, driverConfiguration);

View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

        WebApplicationContext springContext = (WebApplicationContext)
                servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

        // Retrieve the driver configuration from servlet context.
        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(DRIVER_CONFIG_KEY);

        try {
            LOG.info("Initializing Portlet Container. . .");

            LOG.debug(" [1] Loading RequiredContainerServices. . .");
            RequiredContainerServices required =
                    (RequiredContainerServices) springContext.getBean("RequiredContainerServices");

            LOG.debug(" [2] Loading OptionalContainerServices. . .");
            OptionalContainerServices optional =
                    (OptionalContainerServices) springContext.getBean("OptionalContainerServices");


            // Create portlet container.
            LOG.debug(" [3] Creating portlet container...");
            PortletContainerFactory factory =
                    PortletContainerFactory.getInstance();
            PortletContainer container = factory.createContainer(
                driverConfig.getContainerName(), required, optional
            );

            // Initialize portlet container.
            LOG.debug(" [4] Initializing portlet container...");
            container.init(servletContext);
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

     * Destroyes the portal driver config and removes it from servlet context.
     *
     * @param servletContext the servlet context.
     */
    private void destroyDriverConfiguration(ServletContext servletContext) {
        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(DRIVER_CONFIG_KEY);
        if (driverConfig != null) {
            try {
                driverConfig.destroy();
                if (LOG.isInfoEnabled()) {
                    LOG.info("Pluto Portal Driver Config destroyed.");
                }
            } catch (DriverConfigurationException ex) {
                LOG.error("Unable to destroy portal driver config: "
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

        PageConfig config = getPageConfig(page);
        config.removePortlet(portletId);
    }

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

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

Examples of org.apache.pluto.driver.config.DriverConfiguration

      }
        return incPage;
    }

    public Collection getAvailablePages() {
        DriverConfiguration configuration =
            (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()) {
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

     * Returns the requested portal URL.
     * @return the requested portal URL.
     */
    public PortalURL getRequestedPortalURL() {
        if(requestedPortalURL == null) {
            DriverConfiguration config = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
            PortalURLParser parser = config.getPortalUrlParser();
            requestedPortalURL = parser.parse(request);
        }
        return requestedPortalURL;
    }
View Full Code Here

Examples of org.apache.pluto.driver.config.DriverConfiguration

        // Evaluate portlet ID attribute.
        evaluatePortletId();
       
        // Retrieve the portlet window config for the evaluated portlet ID.
        ServletContext servletContext = pageContext.getServletContext();
        DriverConfiguration driverConfig = (DriverConfiguration)
                servletContext.getAttribute(AttributeKeys.DRIVER_CONFIG);
      
        if (isPortletModeAllowed(driverConfig, portletMode)) {
            // Retrieve the portal environment.
            PortalRequestContext portalEnv = PortalRequestContext.getContext(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.