Package org.gatein.pc.api.invocation.response

Examples of org.gatein.pc.api.invocation.response.ContentResponse


               PortletInvocationResponse response = result.getResponse();

               //
               if (response instanceof ContentResponse)
               {
                  ContentResponse fragmentResponse = (ContentResponse)response;

                  //
                  ResponseProperties properties = fragmentResponse.getProperties();

                  //
                  if (properties != null)
                  {
                     MultiValuedPropertyMap<Element> markupHeaders = properties.getMarkupHeaders();
View Full Code Here


      if (portletResp != null)
      {
         if (portletResp instanceof ContentResponse)
         {
            ContentResponse fragment = (ContentResponse)portletResp;
            PortletWindowNavigationalState windowNS = null;
            if (renderResponse.getPageNavigationalState() != null)
            {
               windowNS = renderResponse.getPageNavigationalState().getPortletWindowNavigationalState(portletTag.result.getWindowDef().getWindowId());
            }
            if (windowNS == null || !windowNS.getWindowState().equals(org.gatein.pc.api.WindowState.MINIMIZED))
            {
               if (fragment.getType() != ContentResponse.TYPE_EMPTY)
               {
                  String frag;
                  if (fragment.getType() == ContentResponse.TYPE_BYTES)
                  {
                     frag = fragment.getBytes().toString();
                  }
                  else
                  {
                     frag = fragment.getChars();
                  }

                  out.write(frag);
               }
            }
View Full Code Here

                    charset = null;
                    transportHeaders = null;
                    content = null;
                } else {
                    //
                    ContentResponse piResponse = (ContentResponse) portletResponse;
                    ResponseProperties properties = piResponse.getProperties();
                    transportHeaders = properties != null ? properties.getTransportHeaders() : null;

                    // Look at status code if there is one and honour it
                    String status = transportHeaders != null ? transportHeaders.getValue(ResourceResponse.HTTP_STATUS_CODE)
                            : null;
                    if (status != null) {
                        try {
                            statusCode = Integer.parseInt(status);
                        } catch (NumberFormatException e) {
                            statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
                        }
                    } else {
                        statusCode = HttpServletResponse.SC_OK;
                    }

                    //
                    contentType = piResponse.getContentType();
                    charset = piResponse.getEncoding();

                    //
                    log.trace("Try to get a resource of type: " + contentType + " for the portlet: "
                            + uiPortlet.getPortletContext());
                    if (piResponse.getChars() != null) {
                        content = piResponse.getChars();
                    } else if (piResponse.getBytes() != null) {
                        content = piResponse.getBytes();
                    } else {
                        content = null;
                    }
                }
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.invocation.response.ContentResponse

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.