Examples of FragmentResponse


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

        Text markup = null;
        if (pir instanceof FragmentResponse) {
            JavascriptManager jsMan = context.getJavascriptManager();
            jsMan.loadScriptResource(ResourceScope.PORTLET, getApplicationId());

            FragmentResponse fragmentResponse = (FragmentResponse) pir;
            switch (fragmentResponse.getType()) {
                case FragmentResponse.TYPE_CHARS:
                    markup = Text.create(fragmentResponse.getContent());
                    break;
                case FragmentResponse.TYPE_BYTES:
                    markup = Text.create(fragmentResponse.getBytes(), Charset.forName("UTF-8"));
                    break;
                case FragmentResponse.TYPE_EMPTY:
                    markup = Text.create("");
                    break;
            }
            setConfiguredTitle(fragmentResponse.getTitle());

            // setup portlet properties
            if (fragmentResponse.getProperties() != null) {
                // setup transport headers
                if (fragmentResponse.getProperties().getTransportHeaders() != null) {
                    MultiValuedPropertyMap<String> transportHeaders = fragmentResponse.getProperties().getTransportHeaders();
                    for (String key : transportHeaders.keySet()) {
                        if (JAVASCRIPT_DEPENDENCY.equals(key)) {
                            for (String value : transportHeaders.getValues(key)) {
                                jsMan.require(value);
                            }
                        } else {
                            for (String value : transportHeaders.getValues(key)) {
                                prcontext.getResponse().setHeader(key, value);
                            }
                        }
                    }
                }

                // setup up portlet cookies
                if (fragmentResponse.getProperties().getCookies() != null) {
                    List<Cookie> cookies = fragmentResponse.getProperties().getCookies();
                    for (Cookie cookie : cookies) {
                        prcontext.getResponse().addCookie(cookie);
                    }
                }

                // setup markup headers
                if (fragmentResponse.getProperties().getMarkupHeaders() != null) {
                    MultiValuedPropertyMap<Element> markupHeaders = fragmentResponse.getProperties().getMarkupHeaders();

                    List<Element> markupElements = markupHeaders.getValues(MimeResponse.MARKUP_HEAD_ELEMENT);
                    if (markupElements != null) {
                        for (Element element : markupElements) {
                            if (!context.useAjax() && "title".equals(element.getNodeName().toLowerCase())
View Full Code Here

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

   }

   @Override
   protected ContentResponse createResponse(ResponseProperties props, Map<String, Object> attrs, String contentType, byte[] bytes, CacheControl cacheControl)
   {
      return new FragmentResponse(props, attrs, contentType, null,  bytes, responseTitle, cacheControl, responseNextModes != null ? responseNextModes : preq.supportedModes);
   }
View Full Code Here

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

   }

   @Override
   protected ContentResponse createResponse(ResponseProperties props, Map<String, Object> attrs, String contentType, String chars, CacheControl cacheControl)
   {
      return new FragmentResponse(props, attrs, contentType, null, chars, responseTitle, cacheControl, responseNextModes != null ? responseNextModes : preq.supportedModes);
   }
View Full Code Here

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

   }

   @Override
   protected ContentResponse createResponse(ResponseProperties props, Map<String, Object> attrs, String contentType, CacheControl cacheControl)
   {
      return new FragmentResponse(props, attrs, contentType, responseTitle, cacheControl, responseNextModes != null ? responseNextModes : preq.supportedModes);
   }
View Full Code Here

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

      throw new IllegalArgumentException("Mime type " + contentType + " not accepted as content type");
   }

   protected ContentResponse createMarkupResponse(ResponseProperties properties, Map<String, Object> attributeMap, String contentType, byte[] bytes, String chars, CacheControl cacheControl)
   {
      return new FragmentResponse(
         properties,
         attributeMap,
         contentType,
         bytes,
         chars,
View Full Code Here

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

               // We substitute with the appropriate content response
               RevalidateMarkupResponse revalidate = (RevalidateMarkupResponse)response;
               CacheControl control = revalidate.getCacheControl();
               if (cachedContent instanceof FragmentResponse)
               {
                  response = new FragmentResponse((FragmentResponse)cachedContent, control);
               }
               else
               {
                  response = new ContentResponse(cachedContent, control);
               }
View Full Code Here

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

      JspWriter out = getJspContext().getOut();

      if (portletResp instanceof FragmentResponse)
      {
         FragmentResponse fragment = (FragmentResponse)portletResp;
         out.write(fragment.getTitle());
      }
   }
View Full Code Here

Examples of org.jboss.portal.portlet.invocation.response.FragmentResponse

      throw new IllegalArgumentException("Mime type " + contentType + " not accepted as content type");
   }

   protected ContentResponse createMarkupResponse(ResponseProperties properties, Map<String, Object> attributeMap, String contentType, byte[] bytes, String chars, CacheControl cacheControl)
   {
      return new FragmentResponse(
         properties,
         attributeMap,
         contentType,
         bytes,
         chars,
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.