actionInvocation.setForm(allParams);
invocation = type.cast(actionInvocation);
} else if (type.equals(ResourceInvocation.class)) {
ResourceInvocation resourceInvocation = new ResourceInvocation(pic);
resourceInvocation.setRequestContext(new AbstractRequestContext(servletRequest));
String resourceId = servletRequest.getParameter(Constants.RESOURCE_ID_PARAMETER);
if (!ParameterValidation.isNullOrEmpty(resourceId)) {
resourceInvocation.setResourceId(resourceId);
} else if (!ParameterValidation.isNullOrEmpty(prc.getRequestParameter(Constants.RESOURCE_ID_PARAMETER))) {
resourceInvocation.setResourceId(prc.getRequestParameter(Constants.RESOURCE_ID_PARAMETER));
}
String cachability = servletRequest.getParameter(Constants.CACHELEVEL_PARAMETER);
if (!ParameterValidation.isNullOrEmpty(cachability)) {
// we need to convert the given value to upper case as it might come from WSRP in lower case
resourceInvocation.setCacheLevel(CacheLevel.create(cachability.toUpperCase(Locale.ENGLISH)));
}
String resourceState = servletRequest.getParameter(ExoPortletInvocationContext.RESOURCE_STATE_PARAM_NAME);
if (!ParameterValidation.isNullOrEmpty(resourceState)) {
resourceInvocation.setResourceState(StateString.create(resourceState));
}
// remove the resource state from remaining params
allParams.remove(ExoPortletInvocationContext.RESOURCE_STATE_PARAM_NAME);
// deal with WSRP-specific parameters: add them to the invocation attributes if they exist and remove them from form
// params
String url = servletRequest.getParameter(WSRP_URL);
if (!ParameterValidation.isNullOrEmpty(url)) {
resourceInvocation.setAttribute(WSRP_URL, url);
}
allParams.remove(WSRP_URL);
String preferOperation = servletRequest.getParameter(WSRP_PREFER_OPERATION);
if (!ParameterValidation.isNullOrEmpty(preferOperation)) {
resourceInvocation.setAttribute(WSRP_PREFER_OPERATION, preferOperation);
}
allParams.remove(WSRP_PREFER_OPERATION);
String requiresRewrite = servletRequest.getParameter(WSRP_REQUIRES_REWRITE);
if (!ParameterValidation.isNullOrEmpty(requiresRewrite)) {
resourceInvocation.setAttribute(WSRP_REQUIRES_REWRITE, requiresRewrite);
}
allParams.remove(WSRP_REQUIRES_REWRITE);
// End WSRP-specific parameters handling
resourceInvocation.setForm(allParams);
invocation = type.cast(resourceInvocation);
} else if (type.equals(EventInvocation.class)) {
invocation = type.cast(new EventInvocation(pic));
} else if (type.equals(RenderInvocation.class)) {