return renderString;
}
protected Response internalProcessResponse(PortletInvocationResponse response)
{
ContentResponse content = (ContentResponse)response;
String itemString = null;
byte[] itemBinary = null;
String contentType = content.getContentType();
Boolean requiresRewriting = Boolean.FALSE;
switch (content.getType())
{
case ContentResponse.TYPE_CHARS:
itemString = processFragmentString(content.getChars());
requiresRewriting = Boolean.TRUE; // assume that if we got chars, we'll need to rewrite content
break;
case ContentResponse.TYPE_BYTES:
itemBinary = content.getBytes(); // fix-me: might need to convert to Base64?
// set rewriting to true if needed
if (MIMEUtils.needsRewriting(contentType))
{
requiresRewriting = Boolean.TRUE;
}
break;
case ContentResponse.TYPE_EMPTY:
itemString = EMPTY;
contentType = markupRequest.getMediaType(); // assume we got what we asked for :)
break;
}
// create the appropriate MimeResponse subclass based on content of the portlet container ContentResponse
LocalMimeResponse mimeResponse = WSRPTypeFactory.createMimeResponse(contentType, itemString, itemBinary, getReifiedClass());
mimeResponse.setLocale(markupRequest.getLocale());
//TODO: figure out useCachedItem
Boolean useCachedItem = false;
mimeResponse.setRequiresRewriting(requiresRewriting);
mimeResponse.setUseCachedItem(useCachedItem);
//TODO: check if anything actually uses the ccpp profile warning
String ccppProfileWarning = null;
mimeResponse.setCcppProfileWarning(ccppProfileWarning);
// cache information
int expires = content.getCacheControl().getExpirationSecs();
// only create a CacheControl if expiration time is not 0
if (expires != 0)
{
// if expires is negative, replace by -1 to make sure
if (expires < 0)
{
expires = -1;
}
mimeResponse.setCacheControl(WSRPTypeFactory.createCacheControl(expires, WSRPConstants.CACHE_PER_USER));
}
// GTNWSRP-336: make sure we transmit response properties to the consumer
final ResponseProperties properties = content.getProperties();
if (properties != null)
{
populateClientAttributesWith(mimeResponse, properties.getTransportHeaders());
populateClientAttributesWith(mimeResponse, properties.getMarkupHeaders());
}