Package javax.portlet

Examples of javax.portlet.PortletConfig


     * @throws PortletException
     * @throws IOException
     */
    protected void executeRenderResult(final String finalLocation) throws PortletException, IOException {
        LOG.debug("Executing result in Render phase");
        PortletConfig cfg = PortletActionContext.getPortletConfig();
        RenderRequest req = PortletActionContext.getRenderRequest();
        RenderResponse res = PortletActionContext.getRenderResponse();
        LOG.debug("PortletConfig: " + cfg);
        LOG.debug("RenderRequest: " + req);
        LOG.debug("RenderResponse: " + res);
        res.setContentType(contentType);
        if (TextUtils.stringSet(title)) {
            res.setTitle(title);
        }
        LOG.debug("Location: " + finalLocation);
        PortletRequestDispatcher preparator = cfg.getPortletContext()
                .getNamedDispatcher("preparator");
        if(preparator == null) {
            throw new PortletException("Cannot look up 'preparator' servlet. Make sure that you" +
                    "have configured it correctly in the web.xml file.");
        }
        new IncludeTemplate() {
            protected void when(PortletException e) {
                LOG.error("PortletException while dispatching to 'preparator' servlet", e);
            }
            protected void when(IOException e) {
                LOG.error("IOException while dispatching to 'preparator' servlet", e);
            }
        }.include(preparator, req, res);
        PortletRequestDispatcher dispatcher = cfg.getPortletContext().getRequestDispatcher(finalLocation);
        if(dispatcher == null) {
            throw new PortletException("Could not locate dispatcher for '" + finalLocation + "'");
        }
        new IncludeTemplate() {
            protected void when(PortletException e) {
View Full Code Here


        Mock mockPrep = mock(PortletRequestDispatcher.class);

        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();
        ActionInvocation inv = (ActionInvocation)mockInvocation.proxy();

        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
View Full Code Here

        Mock mockPrep = mock(PortletRequestDispatcher.class);

        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();

        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
        mockPrep.expects(once()).method("include").with(params);
View Full Code Here

     
      // Add elements that should be excluded
      m.put("org.apache.myfaces.portlet.faces.tck.TestRequestScope_b", new AnnotatedExcludedBean());
      // Don't need to add additional excludedAttributes tests as they are covered in chapter 6 tests
     
      PortletConfig config = (PortletConfig) ctx.getELContext().getELResolver().getValue(ctx.getELContext(), null, "portletConfig");
      if (config == null)
      {
        throw new IllegalStateException("Unable to acquire the portletConfig!");
      }
      m.put("org.apache.myfaces.portlet.faces.tck.PortletConfig", config);
View Full Code Here

  {   
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
    Map<String, Object> m = extCtx.getSessionMap();
    ELResolver facesResolver = ctx.getELContext().getELResolver();
    PortletConfig config = (PortletConfig) facesResolver.getValue(ctx.getELContext(), null, "portletConfig");
     
    testRunner.setTestComplete(true);
    String view = (String) m.get("javax.portlet.faces.viewIdHistory.view");
    String edit = (String) m.get("javax.portlet.faces.viewIdHistory.edit");
    String help = (String) m.get("javax.portlet.faces.viewIdHistory.help");
   
    Map<String, String> defaultViewIdMap = (Map<String, String>) ((PortletContext)extCtx.getContext())
                          .getAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + config.getPortletName() + "." +
                                     Bridge.DEFAULT_VIEWID_MAP);
   
    if (view == null)
    {
      testRunner.setTestResult(false,
View Full Code Here

   */
  public boolean setupFilter(FilterConfig config, FilterRequestContext filterRequestContext,
    String filterPath) throws IOException, ServletException
  {
    boolean inPortletContext = false;
    PortletConfig portletConfig = (PortletConfig)filterRequestContext.getRequest()
      .getAttribute("javax.portlet.config");
    if (portletConfig != null)
    {
      inPortletContext = true;
      PortletRequest portletRequest = (PortletRequest)filterRequestContext.getRequest()
View Full Code Here

                log.error(msg,e);
                throw new UnavailableException(msg);
            }
     
            PortletContext portletContext = PortalAccessor.createPortletContext(servletContext, pa);           
            PortletConfig portletConfig = PortalAccessor.createPortletConfig(portletContext, pd);
           
            try
            {
              try
              {
View Full Code Here

  {   
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
    Map<String, Object> m = extCtx.getSessionMap();
    ELResolver facesResolver = ctx.getELContext().getELResolver();
    PortletConfig config = (PortletConfig) facesResolver.getValue(ctx.getELContext(), null, "portletConfig");
     
    testRunner.setTestComplete(true);
    String view = (String) m.get("javax.portlet.faces.viewIdHistory.view");
    String edit = (String) m.get("javax.portlet.faces.viewIdHistory.edit");
    String help = (String) m.get("javax.portlet.faces.viewIdHistory.help");
   
    Map<String, String> defaultViewIdMap = (Map<String, String>) ((PortletContext)extCtx.getContext())
                          .getAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + config.getPortletName() + "." +
                                     Bridge.DEFAULT_VIEWID_MAP);
   
    if (view == null)
    {
      testRunner.setTestResult(false,
View Full Code Here

     
      // Add elements that should be excluded
      m.put("org.apache.myfaces.portlet.faces.tck.TestRequestScope_b", new AnnotatedExcludedBean());
      // Don't need to add additional excludedAttributes tests as they are covered in chapter 6 tests
     
      PortletConfig config = (PortletConfig) ctx.getELContext().getELResolver().getValue(ctx.getELContext(), null, "portletConfig");
      if (config == null)
      {
        throw new IllegalStateException("Unable to acquire the portletConfig!");
      }
      m.put("org.apache.myfaces.portlet.faces.tck.PortletConfig", config);
View Full Code Here

                log.error(msg,e);
                throw new UnavailableException(msg);
            }
     
            PortletContext portletContext = PortalAccessor.createPortletContext(servletContext, pa);           
            PortletConfig portletConfig = PortalAccessor.createPortletConfig(portletContext, pd);
           
            try
            {
              try
              {
View Full Code Here

TOP

Related Classes of javax.portlet.PortletConfig

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.