Package javax.portlet

Examples of javax.portlet.PortletContext


   * @throws PortletException
   * @throws IOException
   */
  protected void executeRenderResult(final String finalLocation) throws PortletException, IOException {
    LOG.debug("Executing result in Render phase");
    PortletContext ctx = PortletActionContext.getPortletContext();
    RenderRequest req = PortletActionContext.getRenderRequest();
    RenderResponse res = PortletActionContext.getRenderResponse();
    res.setContentType(contentType);
    if (TextUtils.stringSet(title)) {
      res.setTitle(title);
    }
    LOG.debug("Location: " + finalLocation);
    if (useDispatcherServlet) {
      req.setAttribute(DISPATCH_TO, finalLocation);
      PortletRequestDispatcher dispatcher = ctx.getNamedDispatcher(dispatcherServletName);
      if(dispatcher == null) {
        throw new PortletException("Could not locate dispatcher servlet \"" + dispatcherServletName + "\". Please configure it in your web.xml file");
      }
      dispatcher.include(req, res);
    } else {
      PortletRequestDispatcher dispatcher = ctx.getRequestDispatcher(finalLocation);
      if (dispatcher == null) {
        throw new PortletException("Could not locate dispatcher for '" + finalLocation + "'");
      }
      dispatcher.include(req, res);
    }
View Full Code Here


 
  // GenericPortlet Impl -----------------------------------------------------
 
    public void doView(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
        PortletContext context = getPortletContext();
        PortletRequestDispatcher requestDispatcher =
            context.getRequestDispatcher(VIEW_PAGE);
        requestDispatcher.include(request, response);
    }
View Full Code Here

        requestDispatcher.include(request, response);
    }

    protected void doEdit(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
        PortletContext context = getPortletContext();
        PortletRequestDispatcher requestDispatcher =
            context.getRequestDispatcher(EDIT_PAGE);
        requestDispatcher.include(request, response);
    }
View Full Code Here

        requestDispatcher.include(request, response);
    }
   
    protected void doHelp(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
      PortletContext context = getPortletContext();
      PortletRequestDispatcher requestDispatcher =
          context.getRequestDispatcher(HELP_PAGE);
      requestDispatcher.include(request, response);
    }
View Full Code Here

 
  // GenericPortlet Impl -----------------------------------------------------
 
    public void doView(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
        PortletContext context = getPortletContext();
        PortletRequestDispatcher requestDispatcher =
            context.getRequestDispatcher(VIEW_PAGE);
        requestDispatcher.include(request, response);
    }
View Full Code Here

        requestDispatcher.include(request, response);
    }

    protected void doEdit(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
        PortletContext context = getPortletContext();
        PortletRequestDispatcher requestDispatcher =
            context.getRequestDispatcher(EDIT_PAGE);
        requestDispatcher.include(request, response);
    }
View Full Code Here

        requestDispatcher.include(request, response);
    }
   
    protected void doHelp(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
      PortletContext context = getPortletContext();
      PortletRequestDispatcher requestDispatcher =
          context.getRequestDispatcher(HELP_PAGE);
      requestDispatcher.include(request, response);
    }
View Full Code Here

    protected TestResult checkGetContextFromSession(PortletSession session) {
        TestResult result = new TestResult();
        result.setDescription("Ensure that the PortletContext can be retrieved "
            + "from the portlet session.");
       
        PortletContext context = session.getPortletContext();
        if (context != null) {
          result.setReturnCode(TestResult.PASSED);
        } else {
          result.setReturnCode(TestResult.FAILED);
          result.setResultMessage("Fail to retrieve PortletContext from "
View Full Code Here

    public InternalPortletContext getPortletContext(ServletContext servletContext)
    throws PortletContainerException {
        if (!portletContexts.containsKey(servletContext)) {
            PortletAppDD portletAppDD = PortletDescriptorRegistry.getRegistry()
                .getPortletAppDD(servletContext);
            PortletContext portletContext = new PortletContextImpl(
                servletContext, portletAppDD);
            portletContexts.put(servletContext, portletContext);
        }
        return (InternalPortletContext) portletContexts.get(servletContext);
    }
View Full Code Here

        searchView.include(renderRequest, renderRespose);
    }

    public void init(PortletConfig portletConfig) throws PortletException {
        PortletContext pc = portletConfig.getPortletContext();
        searchView = pc
                .getRequestDispatcher("/WEB-INF/view/logmanager/search.jsp");
        helpView = pc
                .getRequestDispatcher("/WEB-INF/view/logmanager/viewhelp.jsp");
        super.init(portletConfig);
    }
View Full Code Here

TOP

Related Classes of javax.portlet.PortletContext

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.