}
PortletContext portletContext = requestPrecursor.getPortletContext();
// since we actually extracted the data into MarkupParams in the RequestPrecursor, use that! :)
MarkupParams params = requestPrecursor.getMarkupParams();
// access mode
InstanceContext instanceContext = invocation.getInstanceContext();
ParameterValidation.throwIllegalArgExceptionIfNull(instanceContext, "instance context");
AccessMode accessMode = instanceContext.getAccessMode();
ParameterValidation.throwIllegalArgExceptionIfNull(accessMode, "access mode");
if (debug)
{
log.debug("Portlet is requesting " + accessMode + " access mode");
}
// if the portlet didn't request a resource id, use the fake one:
if (ParameterValidation.isNullOrEmpty(resourceId))
{
throw new IllegalArgumentException("GetResource needs a valid resource id.");
}
// Create ResourceParams
ResourceParams resourceParams = WSRPTypeFactory.createResourceParams(params.isSecureClientCommunication(),
params.getLocales(), params.getMimeTypes(), params.getMode(), params.getWindowState(), resourceId,
WSRPUtils.getStateChangeFromAccessMode(accessMode));
resourceParams.setNavigationalContext(params.getNavigationalContext());
resourceParams.setClientData(params.getClientData());
resourceParams.setResourceCacheability(WSRPUtils.getResourceCacheabilityFromCacheLevel(invocation.getCacheLevel()));
resourceParams.getExtensions().addAll(ExtensionAccess.getConsumerExtensionAccessor().getRequestExtensionsFor(ResourceParams.class));
for (Map.Entry<String, String[]> entry : invocation.getForm().entrySet())
{