Examples of DriverConfiguration


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

        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

        BundleContext bundleContext = (BundleContext) servletContext.getAttribute("osgi-bundlecontext");

        LOG.debug(" [1a] Loading DriverConfiguration. . . ");
        ServiceReference serviceReference = bundleContext.getServiceReference(DriverConfiguration.class.getName());
        DriverConfiguration driverConfiguration = (DriverConfiguration) bundleContext.getService(serviceReference);

//        driverConfiguration.init(new ResourceSource() {
//            public InputStream getResourceAsStream(String resourceName) {
//                return servletContext.getResourceAsStream(resourceName);
//            }
//        });


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


        LOG.debug(" [2a] Loading Optional AdminConfiguration. . .");
        serviceReference = bundleContext.getServiceReference(AdminConfiguration.class.getName());
        AdminConfiguration adminConfiguration = (AdminConfiguration) bundleContext.getService(serviceReference);

        if (adminConfiguration != null) {
            LOG.debug(" [2b] Registering Optional AdminConfiguration");
            servletContext.setAttribute(ADMIN_CONFIG_KEY, adminConfiguration);
        } else {
            LOG.info("Optional AdminConfiguration not found. Ignoring.");
        }


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

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

        // Create portlet container.
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()) {
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 (isWindowStateAllowed(driverConfig, state)) {
            // Retrieve the portal environment.
            PortalRequestContext portalEnv = PortalRequestContext.getContext(
View Full Code Here

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

        {
            portletContextService = PlutoServices.getServices().getPortletContextService();
        }
       
        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 = null;
       
       
        try
        {
          // If this fails it means that the portlet will be not available.
          // Render Tag will take care of it.
          window = new PortletWindowImpl(container, windowConfig, requestedPortalUrl);
        }
        catch(RuntimeException ex)
        {
            if (LOG.isDebugEnabled()) {
                  LOG.debug("The portlet " + windowConfig.getPortletName() + " is not available. Is already deployed?");
              }
        }
   
        //start the markup
        StringBuffer tag = new StringBuffer();
    
        // Do not render if we don't have a window.
        if(window!=null)
        {
          PortletMode currentMode = requestedPortalUrl.getPortletMode(window.getId().getStringId());


          //        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

        // 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 (isWindowStateAllowed(driverConfig, state)) {
            // 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.