NodeInfoBean update - optional template parameter on sendNodeInfo()

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5582 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-05-01 07:28:10 +00:00
parent 72b5e97ad2
commit f6b89ebb0e

View File

@@ -73,12 +73,18 @@ public class NodeInfoBean
{ {
throw new IllegalArgumentException("'noderef' parameter is missing"); throw new IllegalArgumentException("'noderef' parameter is missing");
} }
String strTemplate = (String)context.getExternalContext().getRequestParameterMap().get("template");
if (strTemplate == null || strTemplate.length() == 0)
{
strTemplate = "node_summary_panel.ftl";
}
NodeRef nodeRef = new NodeRef(strNodeRef); NodeRef nodeRef = new NodeRef(strNodeRef);
if (this.nodeService.exists(nodeRef)) if (this.nodeService.exists(nodeRef))
{ {
Repository.getServiceRegistry(context).getTemplateService().processTemplate( Repository.getServiceRegistry(context).getTemplateService().processTemplate(
"/alfresco/templates/client/node_summary_panel.ftl", getModel(nodeRef), out); "/alfresco/templates/client/" + strTemplate, getModel(nodeRef), out);
} }
else else
{ {