mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/**
|
||||||
* doclist
|
* Document List Component: doclist
|
||||||
*
|
*
|
||||||
* Inputs:
|
* Inputs:
|
||||||
* mandatory: nodeRef = parent space nodeRef
|
* mandatory: nodeRef = parent space nodeRef
|
||||||
|
* OR: path = parent space relative path from companyhome
|
||||||
*
|
*
|
||||||
* Outputs:
|
* Outputs:
|
||||||
* doclist - object containing list of child folders and documents in the parent space
|
* doclist - object containing list of child folders and documents in the parent space
|
||||||
@@ -16,15 +17,15 @@ function getDoclist(nodeRef, path, type)
|
|||||||
|
|
||||||
/* nodeRef input */
|
/* nodeRef input */
|
||||||
var parentSpace = null;
|
var parentSpace = null;
|
||||||
if ((nodeRef != null) && (nodeRef != ""))
|
if ((nodeRef !== null) && (nodeRef != ""))
|
||||||
{
|
{
|
||||||
parentSpace = search.findNode(nodeRef);
|
parentSpace = search.findNode(nodeRef);
|
||||||
}
|
}
|
||||||
else if ((path != null) && path != "")
|
else if ((path !== null) && path != "")
|
||||||
{
|
{
|
||||||
parentSpace = companyhome.childByNamePath(path);
|
parentSpace = companyhome.childByNamePath(path);
|
||||||
}
|
}
|
||||||
if (parentSpace == null)
|
if (parentSpace === null)
|
||||||
{
|
{
|
||||||
// return jsonError("Parent space nodeRef not supplied");
|
// return jsonError("Parent space nodeRef not supplied");
|
||||||
parentSpace = companyhome;
|
parentSpace = companyhome;
|
||||||
@@ -33,7 +34,7 @@ function getDoclist(nodeRef, path, type)
|
|||||||
var showDocs = true,
|
var showDocs = true,
|
||||||
showFolders = true;
|
showFolders = true;
|
||||||
|
|
||||||
if ((type != null) && (type != ""))
|
if ((type !== null) && (type != ""))
|
||||||
{
|
{
|
||||||
showDocs = (type == "documents");
|
showDocs = (type == "documents");
|
||||||
showFolders = (type == "folders");
|
showFolders = (type == "folders");
|
||||||
@@ -41,7 +42,7 @@ function getDoclist(nodeRef, path, type)
|
|||||||
|
|
||||||
for each(item in parentSpace.children)
|
for each(item in parentSpace.children)
|
||||||
{
|
{
|
||||||
if ((item.isContainer && showFolders) || (!item.isContainer && showDocs))
|
if ((item.isContainer && showFolders) || (item.isDocument && showDocs))
|
||||||
{
|
{
|
||||||
items.push(item);
|
items.push(item);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user