Package org.exoplatform.web

Examples of org.exoplatform.web.WebAppController


    * @return Gadget Application
    * @throws Exception
    */
   private GadgetApplication getApplication()
   {
      WebAppController webController = getApplicationComponent(WebAppController.class);
      GadgetApplication application = webController.getApplication("eXoGadgets/" + gadgetId);
      if (application == null)
      {
         GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
         Gadget model;
         try
         {
            model = gadgetService.getGadget(gadgetId);
         }
         catch (Exception ex)
         {
            return null;
         }
         if (model != null)
         {
            application = GadgetUtil.toGadgetApplication(model);
            webController.addApplication(application);
         }
      }
      return application;
   }
View Full Code Here


        // Keep the old ClassLoader
        final ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
        boolean hasChanged = false;
        try {
            ServletConfig config = new PortalServletConfig(sConfig, portalContainer);
            WebAppController controller = (WebAppController) portalContainer.getComponentInstanceOfType(WebAppController.class);
            // Set the full classloader of the portal container
            Thread.currentThread().setContextClassLoader(portalContainer.getPortalClassLoader());
            hasChanged = true;

            controller.onHandlersInit(config);
            log.info("The WebAppController has been successfully initialized for the portal '" + portalContainer.getName()
                    + "'");
        } catch (Throwable t) {
            log.error("The WebAppController could not be initialized for the portal '" + portalContainer.getName() + "'", t);
        } finally {
View Full Code Here

     */
    @Override
    protected void onService(ExoContainer container, HttpServletRequest req, HttpServletResponse res) throws ServletException,
            IOException {
        try {
            WebAppController controller = (WebAppController) container.getComponentInstanceOfType(WebAppController.class);
            controller.service(req, res);
        } catch (Throwable t) {
            throw new ServletException(t);
        }
    }
View Full Code Here

      final ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
      boolean hasChanged = false;
      try
      {
         ServletConfig config = new PortalServletConfig(sConfig, portalContainer);
         WebAppController controller =
            (WebAppController)portalContainer.getComponentInstanceOfType(WebAppController.class);
         // Set the full classloader of the portal container
         Thread.currentThread().setContextClassLoader(portalContainer.getPortalClassLoader());
         hasChanged = true;
         PortalApplication application = new PortalApplication(config);
         application.onInit();
         controller.addApplication(application);
         controller.register(new PortalRequestHandler());
         log.info("The WebAppController has been successfully initialized for the portal '" + portalContainer.getName()
            + "'");
      }
      catch (Throwable t)
      {
View Full Code Here

   protected void onService(ExoContainer container, HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException
   {
      try
      {
         WebAppController controller = (WebAppController)container.getComponentInstanceOfType(WebAppController.class);
         controller.service(req, res);
      }
      catch (Throwable t)
      {
         throw new ServletException(t);
      }
View Full Code Here

      try
      {
         if (log.isInfoEnabled())
            log.info("Destroy session from '" + container == null ? "unknown" : ((PortalContainer)container).getName()
               + "' portal");
         WebAppController controller = (WebAppController)container.getComponentInstanceOfType(WebAppController.class);
         PortalApplication portalApp = controller.getApplication(PortalApplication.PORTAL_APPLICATION_ID);
         portalApp.getStateManager().expire(event.getSession().getId(), portalApp);
      }
      catch (Exception ex)
      {
         log.error("Error while destroying a portal session", ex);
View Full Code Here

    * @return Gadget Application
    * @throws Exception
    */
   private GadgetApplication getApplication()
   {
      WebAppController webController = getApplicationComponent(WebAppController.class);
      GadgetApplication application = webController.getApplication("eXoGadgets/" + gadgetId);
      if (application == null)
      {
         GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
         Gadget model;
         try
         {
            model = gadgetService.getGadget(gadgetId);
         }
         catch (Exception ex)
         {
            return null;
         }
         if (model != null)
         {
            application = GadgetUtil.toGadgetApplication(model);
            webController.addApplication(application);
         }
      }
      return application;
   }
View Full Code Here

     *
     * If it does not exist a new PortletApplication object is created, init and cached in the controller
     */
    private PortletApplication getPortletApplication() throws Exception {
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        WebAppController controller = (WebAppController) container.getComponentInstanceOfType(WebAppController.class);
        PortletApplication application = controller.getApplication(applicationId_);
        if (application == null) {
            if (appProvider != null) {
                // We are only expecting one
                application = appProvider.createApplication(getPortletConfig());
            } else {
                application = new PortletApplication(getPortletConfig());
            }
            application.onInit();
            application = controller.addApplication(application);
        }
        return application;
    }
View Full Code Here

        List<ExoContainer> containers = rootContainer.getComponentInstancesOfType(ExoContainer.class);
        containers.add(rootContainer);
        try {
            for (ExoContainer container : containers) {
                ExoContainerContext.setCurrentContainer(container);
                WebAppController controller = (WebAppController) container.getComponentInstanceOfType(WebAppController.class);
                // TODO: figure out what is happening with the controller not existing during shutdown
                if (controller != null) {
                    PortletApplication application = controller.getApplication(applicationId_);
                    if (application != null) {
                        application.onDestroy();
                        controller.removeApplication(applicationId_);
                    }
                }
            }
        } catch (Exception ex) {
            log.error("Error while destroying the porlet", ex);
View Full Code Here

      try
      {
         for (ExoContainer container : containers)
         {
            ExoContainerContext.setCurrentContainer(container);
            WebAppController controller =
               (WebAppController)container.getComponentInstanceOfType(WebAppController.class);
            //TODO: figure out what is happening with the controller not existing during shutdown
            if (controller != null)
            {
               PortletApplication application = controller.getApplication(applicationId_);
               if (application != null)
               {
                  application.onDestroy();
                  controller.removeApplication(applicationId_);
               }
            }
         }
      }
      catch (Exception ex)
View Full Code Here

TOP

Related Classes of org.exoplatform.web.WebAppController

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.