Examples of ResponseProperties


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

   protected final ResponseProperties getProperties(boolean create)
   {
      if (properties == null && create)
      {
         properties = new ResponseProperties();
      }
      return properties;
   }
View Full Code Here

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

                    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) {
View Full Code Here

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

      String contentType = urlConnection.getContentType();

      // init ResponseProperties for ContentResponse result
      Map<String, List<String>> headers = urlConnection.getHeaderFields();
      ResponseProperties props = new ResponseProperties();
      MultiValuedPropertyMap<String> transportHeaders = props.getTransportHeaders();
      for (Map.Entry<String, List<String>> entry : headers.entrySet())
      {
         String key = entry.getKey();
         if (key != null)
         {
            List<String> values = entry.getValue();
            if (values != null)
            {
               if (CookieUtil.SET_COOKIE.equals(key))
               {
                  final List<CookieUtil.Cookie> cookies = CookieUtil.extractCookiesFrom(url, values);
                  List<javax.servlet.http.Cookie> propCookies = props.getCookies();
                  for (CookieUtil.Cookie cookie : cookies)
                  {
                     propCookies.add(CookieUtil.convertFrom(cookie));
                  }
               }
View Full Code Here

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

            }
         }
      }

      // GTNWSRP-336
      final ResponseProperties properties = getResponsePropertiesFrom(mimeResponse, consumer.getProducerInfo().getEndpointConfigurationInfo().getWsdlDefinitionURL());
      return createContentResponse(mimeResponse, invocation, properties, mimeType, binary, markup, createCacheControl(mimeResponse));
   }
View Full Code Here

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

   }

   private ResponseProperties getResponsePropertiesFrom(MimeResponse mimeResponse, String producerURLAsString)
   {
      final List<NamedString> clientAttributes = mimeResponse.getClientAttributes();
      final ResponseProperties properties;
      if (ParameterValidation.existsAndIsNotEmpty(clientAttributes))
      {

         try
         {
            // make sure the URL is valid
            new URL(producerURLAsString);
         }
         catch (MalformedURLException e)
         {
            // shouldn't happen
            throw new RuntimeException(e);
         }
         properties = new ResponseProperties();
         for (NamedString attribute : clientAttributes)
         {
            final String name = attribute.getName();
            final String value = attribute.getValue();
            if (javax.portlet.MimeResponse.MARKUP_HEAD_ELEMENT.equals(name))
            {
               final Element element = PayloadUtils.parseFromXMLString(value);
               properties.getMarkupHeaders().addValue(name, element);
            }
            else
            {
               properties.getTransportHeaders().addValue(name, value);
            }
         }
      }
      else
      {
View Full Code Here

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

         mimeResponse.setCacheControl(WSRPTypeFactory.createCacheControl(expires, WSRPConstants.CACHE_PER_USER));
      }

      // GTNWSRP-336
      final ResponseProperties properties = content.getProperties();
      if (properties != null)
      {
         populateClientAttributesWith(mimeResponse, properties.getTransportHeaders());
         populateClientAttributesWith(mimeResponse, properties.getMarkupHeaders());
      }

      additionallyProcessIfNeeded(mimeResponse, response);

      return createResponse(mimeResponse);
View Full Code Here

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

         {
            return new ErrorResponseRenderer((ErrorResponse)response);
         }
         else
         {
            return new PageRenderer(new ResponseProperties(), requestPageNavigationalState != null ? requestPageNavigationalState : new PageNavigationalState(false));
         }
      }

      //
      throw new IllegalArgumentException("Unknown response type: " + response);
View Full Code Here

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

   {

      // What we collect during the different renders
      // we don't reuse the render properties argument since we want to avoid that
      // a portlet rendition affects another rendition of a portlet on the same page
      ResponseProperties renderProperties = new ResponseProperties();

      //
      Collection<Portlet> portlets = context.getPortlets();

      int capacity = portlets.size();
      fragments = new ArrayList<ContentResponse>(capacity);
      errors = new ArrayList<ErrorResponse>(capacity);

      for (Portlet portlet : portlets)
      {
         try
         {
            PortletInvocationResponse response = context.render(properties.getCookies(), pageNavigationalState, portlet.getContext().getId());

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

               //
               fragments.add(fragment);

               //
               ResponseProperties fragmentProperties = fragment.getProperties();
               if (fragmentProperties != null)
               {
                  renderProperties.append(fragmentProperties);
               }
            }
View Full Code Here

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

         }

         PageNavigationalState tckPageNavigationalState = new PageNavigationalState(false);

         //
         PageRenderer renderer = new PageRenderer(new ResponseProperties(), tckPageNavigationalState);

         //
         renderer.render(new TCKRendererContext(context, tckPageNavigationalState));
      }
   }
View Full Code Here

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

         renderer.render(new RendererContextImpl(context));
      }
      else
      {

         PageRenderer renderer = new PageRenderer(new ResponseProperties(), new PageNavigationalState(false));

         //
         renderer.render(new RendererContextImpl(context));
      }
   }
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.