Package org.apache.pluto.internal

Examples of org.apache.pluto.internal.InternalPortletRequest


     * @throws IOException
     */
    private void dispatch(HttpServletRequest request,
                          HttpServletResponse response)
    throws ServletException, IOException {
        InternalPortletRequest portletRequest = null;
        InternalPortletResponse portletResponse = null;
        try {
         
          // Save portlet config into servlet request.
            request.setAttribute(Constants.PORTLET_CONFIG, portletConfig);
           
            // Retrieve attributes from the servlet request.
            Integer methodId = (Integer) request.getAttribute(
                Constants.METHOD_ID);
            portletRequest = (InternalPortletRequest) request.getAttribute(
                Constants.PORTLET_REQUEST);
            portletResponse = (InternalPortletResponse) request.getAttribute(
                Constants.PORTLET_RESPONSE);
            portletRequest.init(portletContext, request);
           
            // The requested method is RENDER: call Portlet.render(..)
            if (methodId == Constants.METHOD_RENDER) {
                RenderRequestImpl renderRequest =
                    (RenderRequestImpl) portletRequest;
                RenderResponseImpl renderResponse =
                      (RenderResponseImpl) portletResponse;
                portlet.render(renderRequest, renderResponse);
               
            }
           
            // The requested method is ACTION: call Portlet.processAction(..)
            else if (methodId == Constants.METHOD_ACTION) {
                ActionRequestImpl actionRequest =
                      (ActionRequestImpl) portletRequest;
                ActionResponseImpl actionResponse =
                      (ActionResponseImpl) portletResponse;
                portlet.processAction(actionRequest, actionResponse);
            }
           
            // The requested method is NOOP: do nothing.
            else if (methodId == Constants.METHOD_NOOP) {
                // Do nothing.
            }

        } catch (javax.portlet.UnavailableException ex) {
            ex.printStackTrace();
            /*
            if (e.isPermanent()) {
                throw new UnavailableException(e.getMessage());
            } else {
                throw new UnavailableException(e.getMessage(), e.getUnavailableSeconds());
            }*/

            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
            try {
                portlet.destroy();
            } catch (Throwable th) {
                // Don't care for Exception
            }
           
            // TODO: Handle everything as permanently for now.
            throw new javax.servlet.UnavailableException(ex.getMessage());
           
        } catch (PortletException ex) {
            ex.printStackTrace();
            throw new ServletException(ex);
           
        } finally {
            request.removeAttribute(Constants.PORTLET_CONFIG);
            if (portletRequest != null) {
              portletRequest.release();
            }
        }
    }
View Full Code Here


     * @throws IOException
     */
    private void dispatch(HttpServletRequest request,
                          HttpServletResponse response)
        throws ServletException, IOException {
        InternalPortletRequest portletRequest = null;
        InternalPortletResponse portletResponse = null;
        try {

            // Save portlet config into servlet request.
            request.setAttribute(Constants.PORTLET_CONFIG, portletConfig);

            // Retrieve attributes from the servlet request.
            Integer methodId = (Integer) request.getAttribute(
                Constants.METHOD_ID);
            portletRequest = (InternalPortletRequest) request.getAttribute(
                Constants.PORTLET_REQUEST);
            portletResponse = (InternalPortletResponse) request.getAttribute(
                Constants.PORTLET_RESPONSE);
            portletRequest.init(portletContext, request);

            // The requested method is RENDER: call Portlet.render(..)
            if (methodId == Constants.METHOD_RENDER) {
                RenderRequestImpl renderRequest =
                    (RenderRequestImpl) portletRequest;
                RenderResponseImpl renderResponse =
                    (RenderResponseImpl) portletResponse;
                portlet.render(renderRequest, renderResponse);

            }

            // The requested method is ACTION: call Portlet.processAction(..)
            else if (methodId == Constants.METHOD_ACTION) {
                ActionRequestImpl actionRequest =
                    (ActionRequestImpl) portletRequest;
                ActionResponseImpl actionResponse =
                    (ActionResponseImpl) portletResponse;
                portlet.processAction(actionRequest, actionResponse);
            }

            // The requested method is ADMIN: call handlers.
            else if (methodId == Constants.METHOD_ADMIN) {
                ContainerInvocation inv = ContainerInvocation.getInvocation();
                PortalAdministrationService pas =
                    inv.getPortletContainer()
                        .getOptionalContainerServices()
                        .getPortalAdministrationService();

                Iterator it = pas.getAdministrativeRequestListeners().iterator();
                while(it.hasNext()) {
                    AdministrativeRequestListener l =(AdministrativeRequestListener)it.next();
                    l.administer(portletRequest, portletResponse);
                }
            }

            // The requested method is NOOP: do nothing.
            else if (methodId == Constants.METHOD_NOOP) {
                // Do nothing.
            }

        } catch (javax.portlet.UnavailableException ex) {
            ex.printStackTrace();
            /*
            if (e.isPermanent()) {
                throw new UnavailableException(e.getMessage());
            } else {
                throw new UnavailableException(e.getMessage(), e.getUnavailableSeconds());
            }*/

            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
            try {
                portlet.destroy();
            } catch (Throwable th) {
                // Don't care for Exception
            }

            // TODO: Handle everything as permanently for now.
            throw new javax.servlet.UnavailableException(ex.getMessage());

        } catch (PortletException ex) {
            ex.printStackTrace();
            throw new ServletException(ex);

        } finally {
            request.removeAttribute(Constants.PORTLET_CONFIG);
            if (portletRequest != null) {
                portletRequest.release();
            }
        }
    }
View Full Code Here

                    portletWindow.getContextPath()), portletWindow);

        debugWithName("Admin request received for portlet: "
            +portletWindow.getPortletName());

        InternalPortletRequest internalRequest =
            new AdminRequest(this, internalPortletWindow, servletRequest) { };

        InternalPortletResponse internalResponse =
            new AdminResponse(this, internalPortletWindow, servletRequest, servletResponse);
View Full Code Here

    @Deprecated
    public Map<String, String> getUserInfo(final PortletRequest request) throws PortletContainerException {
        if (!(request instanceof InternalPortletRequest)) {
            throw new IllegalArgumentException("The PersonDirectoryUserInfoServices requires the PortletRequest parameter to implement the '" + InternalPortletRequest.class.getName() + "' interface.");
        }
        final InternalPortletRequest internalRequest = (InternalPortletRequest)request;
        final InternalPortletWindow internalPortletWindow = internalRequest.getInternalPortletWindow();

        return this.getUserInfo(request, internalPortletWindow);
    }
View Full Code Here

  public Map getUserInfo(PortletRequest request)
      throws PortletContainerException {
        if (!(request instanceof InternalPortletRequest)) {
            throw new IllegalArgumentException("The CasTicketUserInfoServices requires the PortletRequest parameter to implement the '" + InternalPortletRequest.class.getName() + "' interface.");
        }
        final InternalPortletRequest internalRequest = (InternalPortletRequest)request;
        final InternalPortletWindow internalPortletWindow = internalRequest.getInternalPortletWindow();

        return this.getUserInfo(request, internalPortletWindow);
  }
View Full Code Here

  public Map getUserInfo(PortletRequest request)
      throws PortletContainerException {
        if (!(request instanceof InternalPortletRequest)) {
            throw new IllegalArgumentException("The CasTicketUserInfoServices requires the PortletRequest parameter to implement the '" + InternalPortletRequest.class.getName() + "' interface.");
        }
        final InternalPortletRequest internalRequest = (InternalPortletRequest)request;
        final InternalPortletWindow internalPortletWindow = internalRequest.getInternalPortletWindow();

        return this.getUserInfo(request, internalPortletWindow);
  }
View Full Code Here

          new InternalPortletWindowImpl(portletAppCtx, portletWindow);

        debugWithName("Admin request received for portlet: "
            +portletWindow.getPortletName());

        InternalPortletRequest internalRequest =
            new AdminRequest(this, internalPortletWindow, servletRequest) { };

        InternalPortletResponse internalResponse =
            new AdminResponse(this, internalPortletWindow, servletRequest, servletResponse);
View Full Code Here

     * @throws IOException
     */
    private void dispatch(HttpServletRequest request,
                          HttpServletResponse response)
        throws ServletException, IOException {
        InternalPortletRequest portletRequest = null;
        InternalPortletResponse portletResponse = null;

        // Save portlet config into servlet request.
        request.setAttribute(Constants.PORTLET_CONFIG, portletConfig);

        // Retrieve attributes from the servlet request.
        Integer methodId = (Integer) request.getAttribute(
            Constants.METHOD_ID);

        portletRequest = (InternalPortletRequest) request.getAttribute(
            Constants.PORTLET_REQUEST);

        portletResponse = (InternalPortletResponse) request.getAttribute(
            Constants.PORTLET_RESPONSE);

        portletRequest.init(portletContext, request);

        PortletWindow window =
            ContainerInvocation.getInvocation().getPortletWindow();

        PortletInvocationEvent event =
            new PortletInvocationEvent(portletRequest, window, methodId.intValue());

        notify(event, true, null);

        try {

            // The requested method is RENDER: call Portlet.render(..)
            if (methodId == Constants.METHOD_RENDER) {
                RenderRequestImpl renderRequest =
                    (RenderRequestImpl) portletRequest;
                RenderResponseImpl renderResponse =
                    (RenderResponseImpl) portletResponse;
                portlet.render(renderRequest, renderResponse);

            }

            // The requested method is ACTION: call Portlet.processAction(..)
            else if (methodId == Constants.METHOD_ACTION) {
                ActionRequestImpl actionRequest =
                    (ActionRequestImpl) portletRequest;
                ActionResponseImpl actionResponse =
                    (ActionResponseImpl) portletResponse;
                portlet.processAction(actionRequest, actionResponse);
            }

            // The requested method is ADMIN: call handlers.
            else if (methodId == Constants.METHOD_ADMIN) {
                ContainerInvocation inv = ContainerInvocation.getInvocation();
                PortalAdministrationService pas =
                    inv.getPortletContainer()
                        .getOptionalContainerServices()
                        .getPortalAdministrationService();

                Iterator it = pas.getAdministrativeRequestListeners().iterator();
                while (it.hasNext()) {
                    AdministrativeRequestListener l = (AdministrativeRequestListener) it.next();
                    l.administer(portletRequest, portletResponse);
                }
            }

            // The requested method is NOOP: do nothing.
            else if (methodId == Constants.METHOD_NOOP) {
                // Do nothing.
            }

            notify(event, false, null);

        } catch (javax.portlet.UnavailableException ex) {
            ex.printStackTrace();
            /*
            if (e.isPermanent()) {
                throw new UnavailableException(e.getMessage());
            } else {
                throw new UnavailableException(e.getMessage(), e.getUnavailableSeconds());
            }*/

            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
            try {
                portlet.destroy();
            } catch (Throwable th) {
                // Don't care for Exception
            }

            // TODO: Handle everything as permanently for now.
            throw new javax.servlet.UnavailableException(ex.getMessage());

        } catch (PortletException ex) {
            notify(event, false, ex);
            ex.printStackTrace();
            throw new ServletException(ex);

        } finally {
            request.removeAttribute(Constants.PORTLET_CONFIG);
            if (portletRequest != null) {
                portletRequest.release();
            }
        }
    }
View Full Code Here

                    portletWindow.getContextPath()), portletWindow);

        debugWithName("Admin request received for portlet: "
            +portletWindow.getPortletName());

        InternalPortletRequest internalRequest =
            new AdminRequest(this, internalPortletWindow, servletRequest) { };

        InternalPortletResponse internalResponse =
            new AdminResponse(this, internalPortletWindow, servletRequest, servletResponse);
View Full Code Here

     * @throws IOException
     */
    private void dispatch(HttpServletRequest request,
                          HttpServletResponse response)
        throws ServletException, IOException {
        InternalPortletRequest portletRequest = null;
        InternalPortletResponse portletResponse = null;
        try {

            // Save portlet config into servlet request.
            request.setAttribute(Constants.PORTLET_CONFIG, portletConfig);

            // Retrieve attributes from the servlet request.
            Integer methodId = (Integer) request.getAttribute(
                Constants.METHOD_ID);
            portletRequest = (InternalPortletRequest) request.getAttribute(
                Constants.PORTLET_REQUEST);
            portletResponse = (InternalPortletResponse) request.getAttribute(
                Constants.PORTLET_RESPONSE);
            portletRequest.init(portletContext, request);

            // The requested method is RENDER: call Portlet.render(..)
            if (methodId == Constants.METHOD_RENDER) {
                RenderRequestImpl renderRequest =
                    (RenderRequestImpl) portletRequest;
                RenderResponseImpl renderResponse =
                    (RenderResponseImpl) portletResponse;
                portlet.render(renderRequest, renderResponse);

            }

            // The requested method is ACTION: call Portlet.processAction(..)
            else if (methodId == Constants.METHOD_ACTION) {
                ActionRequestImpl actionRequest =
                    (ActionRequestImpl) portletRequest;
                ActionResponseImpl actionResponse =
                    (ActionResponseImpl) portletResponse;
                portlet.processAction(actionRequest, actionResponse);
            }

            // The requested method is ADMIN: call handlers.
            else if (methodId == Constants.METHOD_ADMIN) {
                ContainerInvocation inv = ContainerInvocation.getInvocation();
                PortalAdministrationService pas =
                    inv.getPortletContainer()
                        .getOptionalContainerServices()
                        .getPortalAdministrationService();

                Iterator it = pas.getAdministrativeRequestListeners().iterator();
                while(it.hasNext()) {
                    AdministrativeRequestListener l =(AdministrativeRequestListener)it.next();
                    l.administer(portletRequest, portletResponse);
                }
            }

            // The requested method is NOOP: do nothing.
            else if (methodId == Constants.METHOD_NOOP) {
                // Do nothing.
            }

        } catch (javax.portlet.UnavailableException ex) {
            ex.printStackTrace();
            /*
            if (e.isPermanent()) {
                throw new UnavailableException(e.getMessage());
            } else {
                throw new UnavailableException(e.getMessage(), e.getUnavailableSeconds());
            }*/

            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.
            try {
                portlet.destroy();
            } catch (Throwable th) {
                // Don't care for Exception
            }

            // TODO: Handle everything as permanently for now.
            throw new javax.servlet.UnavailableException(ex.getMessage());

        } catch (PortletException ex) {
            ex.printStackTrace();
            throw new ServletException(ex);

        } finally {
            request.removeAttribute(Constants.PORTLET_CONFIG);
            if (portletRequest != null) {
                portletRequest.release();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.internal.InternalPortletRequest

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.