protected PortletInvocation internalInitInvocation(WSRPPortletInvocationContext context)
{
ResourceInvocation resourceInvocation = new ResourceInvocation(context);
ResourceParams resourceParams = this.getResource.getResourceParams();
// only set the resource id if it's different from the place holder we use if the portlet doesn't set one
String id = this.getResource.getResourceParams().getResourceID();
if (!WSRPResourceURL.DEFAULT_RESOURCE_ID.equals(id))
{
resourceInvocation.setResourceId(id);
}
WSRPRequestContext requestContext = WSRPRequestContext.createRequestContext(markupRequest, resourceParams);
resourceInvocation.setRequestContext(requestContext);
resourceInvocation.setForm(requestContext.getForm());
//TODO: property set validation token for caching (ie ETAG)
String validationToken = null;
resourceInvocation.setValidationToken(validationToken);
resourceInvocation.setResourceState(createNavigationalState(resourceParams.getResourceState()));
String resourceCacheability = resourceParams.getResourceCacheability();
if (resourceCacheability != null)
{
CacheLevel cacheLevel = WSRPUtils.getCacheLevelFromResourceCacheability(resourceParams.getResourceCacheability());
resourceInvocation.setCacheLevel(cacheLevel);
}
else
{
// according to JSR 286, cache level must default to ResourceURL.PAGE