public static V1RuntimeContext toV1RuntimeContext(RuntimeContext runtimeContext)
{
if (runtimeContext != null)
{
V1RuntimeContext v1RuntimeContext = WSRP1TypeFactory.createRuntimeContext(runtimeContext.getUserAuthentication(), runtimeContext.getPortletInstanceKey(), runtimeContext.getNamespacePrefix());
v1RuntimeContext.setNamespacePrefix(runtimeContext.getNamespacePrefix());
v1RuntimeContext.setPortletInstanceKey(runtimeContext.getPortletInstanceKey());
SessionParams sessionParams = runtimeContext.getSessionParams();
if (sessionParams != null)
{
v1RuntimeContext.setSessionID(sessionParams.getSessionID());
}
v1RuntimeContext.setTemplates(V2ToV1Converter.toV1Templates(runtimeContext.getTemplates()));
List<Extension> extensions = runtimeContext.getExtensions();
if (extensions != null)
{
v1RuntimeContext.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
}
return v1RuntimeContext;
}
else