public static V1Templates toV1Templates(Templates templates)
{
if (templates != null)
{
//TODO: should we be using the WSRP1TypeFactory,createTemplates(PortletInvocationContext) instead?
V1Templates v1Templates = new V1Templates();
v1Templates.setBlockingActionTemplate(templates.getBlockingActionTemplate());
v1Templates.setDefaultTemplate(templates.getDefaultTemplate());
v1Templates.setRenderTemplate(templates.getRenderTemplate());
v1Templates.setResourceTemplate(templates.getResourceTemplate());
v1Templates.setSecureBlockingActionTemplate(templates.getSecureBlockingActionTemplate());
v1Templates.setSecureRenderTemplate(templates.getSecureRenderTemplate());
v1Templates.setSecureResourceTemplate(templates.getSecureResourceTemplate());
List<Extension> extensions = templates.getExtensions();
if (extensions != null)
{
v1Templates.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
}
return v1Templates;
}
else