From 2de1c57655fe1c7335160170cba95b7edfcac58b Mon Sep 17 00:00:00 2001 From: Mike Hatfield Date: Thu, 22 May 2008 09:18:22 +0000 Subject: [PATCH] doclist data webscript update for non-document repo objects git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9221 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../slingshot/documentlibrary/doclist.get.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 18cbfe17f8..6376d14ef1 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 @@ -1,8 +1,9 @@ -/* - * doclist +/** + * Document List Component: doclist * * Inputs: * mandatory: nodeRef = parent space nodeRef + * OR: path = parent space relative path from companyhome * * Outputs: * doclist - object containing list of child folders and documents in the parent space @@ -16,15 +17,15 @@ function getDoclist(nodeRef, path, type) /* nodeRef input */ var parentSpace = null; - if ((nodeRef != null) && (nodeRef != "")) + if ((nodeRef !== null) && (nodeRef != "")) { parentSpace = search.findNode(nodeRef); } - else if ((path != null) && path != "") + else if ((path !== null) && path != "") { parentSpace = companyhome.childByNamePath(path); } - if (parentSpace == null) + if (parentSpace === null) { // return jsonError("Parent space nodeRef not supplied"); parentSpace = companyhome; @@ -33,7 +34,7 @@ function getDoclist(nodeRef, path, type) var showDocs = true, showFolders = true; - if ((type != null) && (type != "")) + if ((type !== null) && (type != "")) { showDocs = (type == "documents"); showFolders = (type == "folders"); @@ -41,7 +42,7 @@ function getDoclist(nodeRef, path, type) for each(item in parentSpace.children) { - if ((item.isContainer && showFolders) || (!item.isContainer && showDocs)) + if ((item.isContainer && showFolders) || (item.isDocument && showDocs)) { items.push(item); }