Examples of PublisherConfiguration


Examples of it.eng.spago.presentation.PublisherConfiguration

            // *******************************************************************
          } else {
              Exception serviceException = (Exception)responseContainer.getAttribute(PORTLET_EXCEPTION);
                RequestContextIFace requestContext =
                    new DefaultRequestContext(requestContainer, responseContainer);
                PublisherConfiguration publisher =
                  Publisher.getPublisherConfiguration(requestContext,
                      serviceException);
              String publisherType = publisher.getType();
              List resources = publisher.getResources();
               
                // if publisher is a loop publisher is necessary to recall the method process service
                // and do view (recursion) in order to exec the new request
                if (publisherType.equalsIgnoreCase(
                        Constants.LOOP_PUBLISHER_TYPE)) {
                    resources = new ArrayList();
                    try {
                      // START MODIFICATIONS BY DAVIDE ZERBETTO September 10th 2007
                      prepareRender(requestContext, publisher);
                      // refresh ResponseContainer in session
                      session.setAttribute(Constants.RESPONSE_CONTAINER, responseContainer);
                      // END MODIFICATIONS BY DAVIDE ZERBETTO September 10th 2007
                     
                      // se into the request a parameter loopback, the process service method
                      // will use it in order to know if is a loopback request or not
                      request.setAttribute(Constants.PUBLISHING_MODE_LOOPBACK, "TRUE");
                      // recall the process service, The name of the new request and response container
                      // are returned into an hashmap. Normally the names are set like parameters of the
                      // renderRequest from the process service method and when the container invokes
                      // the doView, doEdit, doHelp method these can get them. In this case calling the
                      // method directly, the container cannot recall the doView, doEdit, doHelp so the
                      // way is to set into the renderRequest object the names returned and call the
                      // doRenderService (recursion)
                     
                      //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                      //HashMap map = (HashMap)processService(request, response);
                      //requestContainerName = (String) map.get(REQUEST_CONTAINER_NAME);
                      //responseContainerName = (String) map.get(RESPONSE_CONTAINER_NAME);
                      // the new request and response name are set into the session, override the
                      // previous names
                      //session.setAttribute(REQUEST_CONTAINER_NAME, requestContainerName);
                        //session.setAttribute(RESPONSE_CONTAINER_NAME, responseContainerName);
                        //request.setAttribute(REQUEST_CONTAINER_NAME, requestContainerName);
                        //request.setAttribute(RESPONSE_CONTAINER_NAME, responseContainerName);
                      processService(request, response);
                        //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
                       
                      // recall the method for presentation
                        doRenderService(request, response);
                        return;                        
                    } catch (Exception e) {
                      TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.MAJOR,
                    "AdapterPortlet::doRenderService: error during the execution of the loopback request", e);
                    }
                }
             
             
             
              if (publisherType
                  .equalsIgnoreCase(Constants.LOOP_PUBLISHER_TYPE)
                  || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE)
                  || publisherType.equalsIgnoreCase(JSP_PUBLISHER_TYPE)) {           
                  Iterator iterator = resources.iterator();
                  SourceBean resourceSourceBean = null;               
                while (iterator.hasNext()) {
                  resourceSourceBean = (SourceBean)iterator.next();
                  if ( ((String)resourceSourceBean.getAttribute("mode")).equalsIgnoreCase(portletMode) )
                    break;
                }
                if (resourceSourceBean == null) {
                    TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.MAJOR,
                          "AdapterPortlet::doView: no resources defined for mode " + portletMode);
                } else
                  resource = (String)resourceSourceBean.getAttribute("resource");
                                                           
                  RouterPortlet router = new RouterPortlet(resource);
                  try {
                    //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                      //router.setParameter(Constants.REQUEST_CONTAINER, requestContainerName);
                      //router.setParameter(Constants.RESPONSE_CONTAINER,responseContainerName);
                      //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
                     
                      router.route(getPortletContext(), request, response);  
                } // try
                catch (Exception ex) {
                    TracerSingleton.log(
                        Constants.NOME_MODULO,
                        TracerSingleton.CRITICAL,
                        "AdapterPortlet::doView: ",
                        ex);
                } // catch (Excpetion ex) try   
                finally {
                    // Allow better garbage collection
                    publisher.release();
                }
              } // if (publisherType.equalsIgnoreCase(Constants.LOOP_PUBLISHER_TYPE)
                // || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE) ||
                // publisherType.equalsIgnoreCase(JSP_PUBLISHER_TYPE))
              else {
                  response.setContentType(HTTP_CONTENT_TYPE);
                  Monitor renderingMonitor =
                          MonitorFactory.start(
                              "view.portlet."
                                  + publisherType.toLowerCase()
                                  + "."
                                  + publisher.getName().toLowerCase());
                  try {
                      response.getWriter().print(
                          PresentationRendering.render(
                              responseContainer,
                              resources));
                      response.getWriter().flush();
                  } // try
                  catch (Exception ex) {
                    TracerSingleton.log(
                              Constants.NOME_MODULO,
                              TracerSingleton.DEBUG,
                              "AdapterPortlet::doView:eccezzione", ex);
                  } // catch (Exception ex)
                  finally {
                    // Allow better garbage collection
                    publisher.release();
                    // Stop performance measurement
                      renderingMonitor.stop();
                  } // finally
              } // if (publisherType.equalsIgnoreCase(AF_PUBLISHER_TYPE)
              // || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE) ||
View Full Code Here

Examples of it.eng.spago.presentation.PublisherConfiguration

        Boolean isHttpResponseFreezed = (Boolean) responseContainer
                .getAttribute(Constants.HTTP_RESPONSE_FREEZED);
        if ((isHttpResponseFreezed == null) || (!isHttpResponseFreezed.booleanValue())) {
         
          // Retrieve publisher configuration for current service
            PublisherConfiguration publisherConfig = Publisher.getPublisherConfiguration(requestContext,
                    serviceException);
           
            try {
              // Retrieve renderer according to publisher type and channel type
            RenderIFace renderer = RenderManager.getInstance().getRenderer(publisherConfig);

            // Store in session last used publisher name
              Publisher.setLastPublisherName(publisherConfig.getName());

              // Setup phase
              renderer.prepareRender(requestContext, publisherConfig, getServletContext());
             
              // Render phase
              renderer.render(requestContext, publisherConfig, getServletContext());
            } finally {
              // Allow better garbage collection
              publisherConfig.release();
            }

        } // if ((isHttpResponseFreezed == null) ||
        // (!isHttpResponseFreezed.getBoolean()))
        else
View Full Code Here

Examples of it.eng.spago.presentation.PublisherConfiguration

            // *******************************************************************
          } else {
              Exception serviceException = (Exception)responseContainer.getAttribute(PORTLET_EXCEPTION);
                RequestContextIFace requestContext =
                    new DefaultRequestContext(requestContainer, responseContainer);
                PublisherConfiguration publisher =
                  Publisher.getPublisherConfiguration(requestContext,
                      serviceException);
              String publisherType = publisher.getType();
              List resources = publisher.getResources();
               
                // if publisher is a loop publisher is necessary to recall the method process service
                // and do view (recursion) in order to exec the new request
                if (publisherType.equalsIgnoreCase(
                        Constants.LOOP_PUBLISHER_TYPE)) {
                    resources = new ArrayList();
                    try {
                      // START MODIFICATIONS BY DAVIDE ZERBETTO September 10th 2007
                      prepareRender(requestContext, publisher);
                      // refresh ResponseContainer in session
                      session.setAttribute(Constants.RESPONSE_CONTAINER, responseContainer);
                      // END MODIFICATIONS BY DAVIDE ZERBETTO September 10th 2007
                     
                      // se into the request a parameter loopback, the process service method
                      // will use it in order to know if is a loopback request or not
                      request.setAttribute(Constants.PUBLISHING_MODE_LOOPBACK, "TRUE");
                      // recall the process service, The name of the new request and response container
                      // are returned into an hashmap. Normally the names are set like parameters of the
                      // renderRequest from the process service method and when the container invokes
                      // the doView, doEdit, doHelp method these can get them. In this case calling the
                      // method directly, the container cannot recall the doView, doEdit, doHelp so the
                      // way is to set into the renderRequest object the names returned and call the
                      // doRenderService (recursion)
                     
                      //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                      //HashMap map = (HashMap)processService(request, response);
                      //requestContainerName = (String) map.get(REQUEST_CONTAINER_NAME);
                      //responseContainerName = (String) map.get(RESPONSE_CONTAINER_NAME);
                      // the new request and response name are set into the session, override the
                      // previous names
                      //session.setAttribute(REQUEST_CONTAINER_NAME, requestContainerName);
                        //session.setAttribute(RESPONSE_CONTAINER_NAME, responseContainerName);
                        //request.setAttribute(REQUEST_CONTAINER_NAME, requestContainerName);
                        //request.setAttribute(RESPONSE_CONTAINER_NAME, responseContainerName);
                      processService(request, response);
                        //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
                       
                      // recall the method for presentation
                        doRenderService(request, response);
                        return;                        
                    } catch (Exception e) {
                      TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.MAJOR,
                    "AdapterPortlet::doRenderService: error during the execution of the loopback request", e);
                    }
                }
             
             
             
              if (publisherType
                  .equalsIgnoreCase(Constants.LOOP_PUBLISHER_TYPE)
                  || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE)
                  || publisherType.equalsIgnoreCase(JSP_PUBLISHER_TYPE)) {           
                  Iterator iterator = resources.iterator();
                  SourceBean resourceSourceBean = null;               
                while (iterator.hasNext()) {
                  resourceSourceBean = (SourceBean)iterator.next();
                  if ( ((String)resourceSourceBean.getAttribute("mode")).equalsIgnoreCase(portletMode) )
                    break;
                }
                if (resourceSourceBean == null) {
                    TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.MAJOR,
                          "AdapterPortlet::doView: no resources defined for mode " + portletMode);
                } else
                  resource = (String)resourceSourceBean.getAttribute("resource");
                                                           
                  RouterPortlet router = new RouterPortlet(resource);
                  try {
                    //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                      //router.setParameter(Constants.REQUEST_CONTAINER, requestContainerName);
                      //router.setParameter(Constants.RESPONSE_CONTAINER,responseContainerName);
                      //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
                     
                      router.route(getPortletContext(), request, response);  
                } // try
                catch (Exception ex) {
                    TracerSingleton.log(
                        Constants.NOME_MODULO,
                        TracerSingleton.CRITICAL,
                        "AdapterPortlet::doView: ",
                        ex);
                } // catch (Excpetion ex) try   
                finally {
                    // Allow better garbage collection
                    publisher.release();
                }
              } // if (publisherType.equalsIgnoreCase(Constants.LOOP_PUBLISHER_TYPE)
                // || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE) ||
                // publisherType.equalsIgnoreCase(JSP_PUBLISHER_TYPE))
              else {
                  response.setContentType(HTTP_CONTENT_TYPE);
                  Monitor renderingMonitor =
                          MonitorFactory.start(
                              "view.portlet."
                                  + publisherType.toLowerCase()
                                  + "."
                                  + publisher.getName().toLowerCase());
                  try {
                      response.getWriter().print(
                          PresentationRendering.render(
                              responseContainer,
                              resources));
                      response.getWriter().flush();
                  } // try
                  catch (Exception ex) {
                    TracerSingleton.log(
                              Constants.NOME_MODULO,
                              TracerSingleton.DEBUG,
                              "AdapterPortlet::doView:eccezzione", ex);
                  } // catch (Exception ex)
                  finally {
                    // Allow better garbage collection
                    publisher.release();
                    // Stop performance measurement
                      renderingMonitor.stop();
                  } // finally
              } // if (publisherType.equalsIgnoreCase(AF_PUBLISHER_TYPE)
              // || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE) ||
View Full Code Here

Examples of it.eng.spago.presentation.PublisherConfiguration

        Boolean isHttpResponseFreezed = (Boolean) responseContainer
                .getAttribute(Constants.HTTP_RESPONSE_FREEZED);
        if ((isHttpResponseFreezed == null) || (!isHttpResponseFreezed.booleanValue())) {
         
          // Retrieve publisher configuration for current service
            PublisherConfiguration publisherConfig = Publisher.getPublisherConfiguration(requestContext,
                    serviceException);
           
            try {
              // Retrieve renderer according to publisher type and channel type
            RenderIFace renderer = RenderManager.getInstance().getRenderer(publisherConfig);

            // Store in session last used publisher name
              Publisher.setLastPublisherName(publisherConfig.getName());

              // Setup phase
              renderer.prepareRender(requestContext, publisherConfig, getServletContext());
             
              // Render phase
              renderer.render(requestContext, publisherConfig, getServletContext());
            } finally {
              // Allow better garbage collection
              publisherConfig.release();
            }

        } // if ((isHttpResponseFreezed == null) ||
        // (!isHttpResponseFreezed.getBoolean()))
        else
View Full Code Here

Examples of it.eng.spago.presentation.PublisherConfiguration

            // *******************************************************************
          } else {
              Exception serviceException = (Exception)responseContainer.getAttribute(PORTLET_EXCEPTION);
                RequestContextIFace requestContext =
                    new DefaultRequestContext(requestContainer, responseContainer);
                PublisherConfiguration publisher =
                  Publisher.getPublisherConfiguration(requestContext,
                      serviceException);
              String publisherType = publisher.getType();
              List resources = publisher.getResources();
               
                // if publisher is a loop publisher is necessary to recall the method process service
                // and do view (recursion) in order to exec the new request
                if (publisherType.equalsIgnoreCase(
                        Constants.LOOP_PUBLISHER_TYPE)) {
                    resources = new ArrayList();
                    try {
                      // START MODIFICATIONS BY DAVIDE ZERBETTO September 10th 2007
                      prepareRender(requestContext, publisher);
                      // refresh ResponseContainer in session
                      session.setAttribute(Constants.RESPONSE_CONTAINER, responseContainer);
                      // END MODIFICATIONS BY DAVIDE ZERBETTO September 10th 2007
                     
                      // se into the request a parameter loopback, the process service method
                      // will use it in order to know if is a loopback request or not
                      request.setAttribute(Constants.PUBLISHING_MODE_LOOPBACK, "TRUE");
                      // recall the process service, The name of the new request and response container
                      // are returned into an hashmap. Normally the names are set like parameters of the
                      // renderRequest from the process service method and when the container invokes
                      // the doView, doEdit, doHelp method these can get them. In this case calling the
                      // method directly, the container cannot recall the doView, doEdit, doHelp so the
                      // way is to set into the renderRequest object the names returned and call the
                      // doRenderService (recursion)
                     
                      //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                      //HashMap map = (HashMap)processService(request, response);
                      //requestContainerName = (String) map.get(REQUEST_CONTAINER_NAME);
                      //responseContainerName = (String) map.get(RESPONSE_CONTAINER_NAME);
                      // the new request and response name are set into the session, override the
                      // previous names
                      //session.setAttribute(REQUEST_CONTAINER_NAME, requestContainerName);
                        //session.setAttribute(RESPONSE_CONTAINER_NAME, responseContainerName);
                        //request.setAttribute(REQUEST_CONTAINER_NAME, requestContainerName);
                        //request.setAttribute(RESPONSE_CONTAINER_NAME, responseContainerName);
                      processService(request, response);
                        //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
                       
                      // recall the method for presentation
                        doRenderService(request, response);
                        return;                        
                    } catch (Exception e) {
                      TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.MAJOR,
                    "AdapterPortlet::doRenderService: error during the execution of the loopback request", e);
                    }
                }
             
             
             
              if (publisherType
                  .equalsIgnoreCase(Constants.LOOP_PUBLISHER_TYPE)
                  || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE)
                  || publisherType.equalsIgnoreCase(JSP_PUBLISHER_TYPE)) {           
                  Iterator iterator = resources.iterator();
                  SourceBean resourceSourceBean = null;               
                while (iterator.hasNext()) {
                  resourceSourceBean = (SourceBean)iterator.next();
                  if ( ((String)resourceSourceBean.getAttribute("mode")).equalsIgnoreCase(portletMode) )
                    break;
                }
                if (resourceSourceBean == null) {
                    TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.MAJOR,
                          "AdapterPortlet::doView: no resources defined for mode " + portletMode);
                } else
                  resource = (String)resourceSourceBean.getAttribute("resource");
                                                           
                  RouterPortlet router = new RouterPortlet(resource);
                  try {
                    //**************** START MODFIFICATION ZERBETTO 09-10-2006 ****************
                      //router.setParameter(Constants.REQUEST_CONTAINER, requestContainerName);
                      //router.setParameter(Constants.RESPONSE_CONTAINER,responseContainerName);
                      //**************** END MODFIFICATION ZERBETTO 09-10-2006 ****************
                     
                      router.route(getPortletContext(), request, response);  
                } // try
                catch (Exception ex) {
                    TracerSingleton.log(
                        Constants.NOME_MODULO,
                        TracerSingleton.CRITICAL,
                        "AdapterPortlet::doView: ",
                        ex);
                } // catch (Excpetion ex) try   
                finally {
                    // Allow better garbage collection
                    publisher.release();
                }
              } // if (publisherType.equalsIgnoreCase(Constants.LOOP_PUBLISHER_TYPE)
                // || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE) ||
                // publisherType.equalsIgnoreCase(JSP_PUBLISHER_TYPE))
              else {
                  response.setContentType(HTTP_CONTENT_TYPE);
                  Monitor renderingMonitor =
                          MonitorFactory.start(
                              "view.portlet."
                                  + publisherType.toLowerCase()
                                  + "."
                                  + publisher.getName().toLowerCase());
                  try {
                      response.getWriter().print(
                          PresentationRendering.render(
                              responseContainer,
                              resources));
                      response.getWriter().flush();
                  } // try
                  catch (Exception ex) {
                    TracerSingleton.log(
                              Constants.NOME_MODULO,
                              TracerSingleton.DEBUG,
                              "AdapterPortlet::doView:eccezzione", ex);
                  } // catch (Exception ex)
                  finally {
                    // Allow better garbage collection
                    publisher.release();
                    // Stop performance measurement
                      renderingMonitor.stop();
                  } // finally
              } // if (publisherType.equalsIgnoreCase(AF_PUBLISHER_TYPE)
              // || publisherType.equalsIgnoreCase(SERVLET_PUBLISHER_TYPE) ||
View Full Code Here

Examples of it.eng.spago.presentation.PublisherConfiguration

        Boolean isHttpResponseFreezed = (Boolean) responseContainer
                .getAttribute(Constants.HTTP_RESPONSE_FREEZED);
        if ((isHttpResponseFreezed == null) || (!isHttpResponseFreezed.booleanValue())) {
         
          // Retrieve publisher configuration for current service
            PublisherConfiguration publisherConfig = Publisher.getPublisherConfiguration(requestContext,
                    serviceException);
           
            try {
              // Retrieve renderer according to publisher type and channel type
            RenderIFace renderer = RenderManager.getInstance().getRenderer(publisherConfig);

            // Store in session last used publisher name
              Publisher.setLastPublisherName(publisherConfig.getName());

              // Setup phase
              renderer.prepareRender(requestContext, publisherConfig, getServletContext());
             
              // Render phase
              renderer.render(requestContext, publisherConfig, getServletContext());
            } finally {
              // Allow better garbage collection
              publisherConfig.release();
            }

        } // if ((isHttpResponseFreezed == null) ||
        // (!isHttpResponseFreezed.getBoolean()))
        else
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.