From f9ca7b50191bcc303c69ea0b8041cc294992a54a Mon Sep 17 00:00:00 2001 From: Erik Winlof Date: Wed, 11 Aug 2010 16:32:03 +0000 Subject: [PATCH] Implemented ALF-3926 "F11 Workflow can be started with a context (current folder)" - Better context/destination set for Start workflow when started form doclib - doclist REST api additions: metadata.container & items[].location.parent.nodeRef git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21743 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/slingshot/documentlibrary/doclist.get.js | 6 ++++++ .../slingshot/documentlibrary/doclist.get.json.ftl | 1 + .../alfresco/slingshot/documentlibrary/item.lib.ftl | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js index 87c7b7a5ac..edbc676b1d 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js @@ -135,6 +135,11 @@ function getDoclist() file: node.name }; } + location.parent = {}; + if (node.parent != null && node.parent.hasPermission("Read")) + { + location.parent.nodeRef = String(node.parent.nodeRef.toString()); + } // Resolved location item.location = location; @@ -163,6 +168,7 @@ function getDoclist() totalRecords: totalRecords, startIndex: startIndex }, + container: parsedArgs.rootNode, parent: parent, onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"), itemCount: diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.json.ftl index c767dad6c9..90e132e863 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.json.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.json.ftl @@ -5,6 +5,7 @@ "startIndex": ${doclist.paging.startIndex?c}, "metadata": { + <#if doclist.container??>"container": "${doclist.container.nodeRef}", "parent": { <#if doclist.parent??> diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/item.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/item.lib.ftl index b8fae72abf..639ed8be97 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/item.lib.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/item.lib.ftl @@ -63,7 +63,16 @@ "siteTitle": "${item.location.siteTitle!""}", "container": "${item.location.container!""}", "path": "${item.location.path!""}", - "file": "${item.location.file!""}" + "file": "${item.location.file!""}", + "parent": + { + <#if item.location.parent??> + <#assign parentLocation = item.location.parent> + <#if parentLocation??> + "nodeRef": "${parentLocation.nodeRef!""}" + + + } }, "permissions": {