}
public void setTemplatesIfNeeded(WSRPPortletInfo info, PortletInvocation invocation, RuntimeContext runtimeContext) throws PortletInvokerException
{
// todo: could store templates in producer session info to avoid to re-generate them all the time?
SessionParams sessionParams = runtimeContext.getSessionParams();
if (info != null && info.isDoesUrlTemplateProcessing()
&& (!info.isTemplatesStoredInSession() || sessionParams == null || sessionParams.getSessionID() == null))
{
// we need to supply the templates since the portlet does URL processing and either doesn't store
// templates in the session or no session has been established yet
runtimeContext.setTemplates(WSRPTypeFactory.createTemplates(invocation.getContext()));
}