protected RuntimeContext getRuntimeContext(WSRPBaseRequest request) {
RuntimeContext runtimeContext = new RuntimeContext();
runtimeContext.setUserAuthentication(consumerEnv.getUserAuthentication());
runtimeContext.setPortletInstanceKey(request.getPortletInstanceKey());
URLTemplateComposer templateComposer = consumerEnv.getTemplateComposer();
if (templateComposer != null) {
runtimeContext.setNamespacePrefix(templateComposer.getNamespacePrefix());
}
Boolean doesUrlTemplateProcess = null;
try {
PortletDescription desc = producer.getPortletDescription(getPortlet().getParent());
if (desc != null) {
doesUrlTemplateProcess = desc.getDoesUrlTemplateProcessing();
}
} catch (WSRPException e) {
// do nothing since exception has been logged already
// continue with assumption that portlet does not support template processing
}
if (doesUrlTemplateProcess != null && templateComposer != null && doesUrlTemplateProcess.booleanValue()) {
Templates templates = new Templates();
templates.setBlockingActionTemplate(templateComposer.createBlockingActionTemplate(true, true, true, true));
templates.setRenderTemplate(templateComposer.createRenderTemplate(true, true, true, true));
templates.setDefaultTemplate(templateComposer.createDefaultTemplate(true, true, true, true));
templates.setResourceTemplate(templateComposer.createResourceTemplate(true, true, true, true));
templates.setSecureBlockingActionTemplate(
templateComposer.createSecureBlockingActionTemplate(true, true, true, true));
templates.setSecureRenderTemplate(templateComposer.createSecureRenderTemplate(true, true, true, true));
templates.setSecureDefaultTemplate(templateComposer.createSecureDefaultTemplate(true, true, true, true));
templates.setSecureResourceTemplate(templateComposer.createSecureResourceTemplate(true, true, true, true));
runtimeContext.setTemplates(templates);
}
runtimeContext.setSessionID(request.getSessionID());
runtimeContext.setExtensions(null);