Share Folder details page

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14298 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2009-05-13 13:36:28 +00:00
parent b19cad46de
commit d741ceb07e
5 changed files with 41 additions and 8 deletions

View File

@@ -5,6 +5,7 @@
<@renderParent node.parent indent+" " /> <@renderParent node.parent indent+" " />
</#if> </#if>
${indent}"type": "${node.typeShort}", ${indent}"type": "${node.typeShort}",
${indent}"isContainer": ${node.isContainer?string},
${indent}"hasChildren": ${(node.children?size > 0)?string}, ${indent}"hasChildren": ${(node.children?size > 0)?string},
${indent}"name": "${node.properties.name!""}", ${indent}"name": "${node.properties.name!""}",
${indent}"description": "${node.properties.description!""}", ${indent}"description": "${node.properties.description!""}",
@@ -26,11 +27,11 @@
<#list results as row> <#list results as row>
{ {
"type": "${row.item.typeShort}", "type": "${row.item.typeShort}",
"isContainer": ${row.item.isContainer?string},
"hasChildren": ${(row.item.children?size > 0)?string}, "hasChildren": ${(row.item.children?size > 0)?string},
"name": "${row.item.properties.name!""}", "name": "${row.item.properties.name!""}",
"description": "${row.item.properties.description!""}", "description": "${row.item.properties.description!""}",
"displayPath": "${row.item.displayPath!""}", "displayPath": "${row.item.displayPath!""}",
"hasChildren": ${(row.item.children?size > 0)?string},
"nodeRef": "${row.item.nodeRef}"<#if row.selectable?exists>, "nodeRef": "${row.item.nodeRef}"<#if row.selectable?exists>,
"selectable" : ${row.selectable?string}</#if> "selectable" : ${row.selectable?string}</#if>
}<#if row_has_next>,</#if> }<#if row_has_next>,</#if>

View File

@@ -14,7 +14,7 @@ function getDocList(filter)
var items = new Array(); var items = new Array();
var assets; var assets;
// Is our thumbnail tpe registered? // Is our thumbnail type registered?
var haveThumbnails = thumbnailService.isThumbnailNameRegistered(THUMBNAIL_NAME); var haveThumbnails = thumbnailService.isThumbnailNameRegistered(THUMBNAIL_NAME);
// Use helper function to get the arguments // Use helper function to get the arguments
@@ -73,7 +73,18 @@ function getDocList(filter)
// Possibly an old indexed node - ignore it // Possibly an old indexed node - ignore it
} }
} }
assets = folderAssets.concat(documentAssets);
var folderAssetsCount = folderAssets.length,
documentAssetsCount = documentAssets.length;
if (url.templateArgs.type === "documents")
{
assets = documentAssets;
}
else
{
assets = folderAssets.concat(documentAssets);
}
// Make a note of totalRecords before trimming the assets array // Make a note of totalRecords before trimming the assets array
var totalRecords = assets.length; var totalRecords = assets.length;
@@ -261,6 +272,11 @@ function getDocList(filter)
{ {
luceneQuery: query, luceneQuery: query,
onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"), onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"),
itemCount:
{
folders: folderAssetsCount,
documents: documentAssetsCount
},
paging: paging:
{ {
startIndex: startIndex, startIndex: startIndex,

View File

@@ -2,6 +2,7 @@
<#assign workingCopyLabel = " " + message("coci_service.working_copy_label")> <#assign workingCopyLabel = " " + message("coci_service.working_copy_label")>
<#assign paging = doclist.paging> <#assign paging = doclist.paging>
<#assign user = doclist.user> <#assign user = doclist.user>
<#assign itemCount = doclist.itemCount>
<#escape x as jsonUtils.encodeJSONString(x)> <#escape x as jsonUtils.encodeJSONString(x)>
{ {
"totalRecords": ${paging.totalRecords?c}, "totalRecords": ${paging.totalRecords?c},
@@ -18,7 +19,12 @@
"delete" : ${user.permissions.delete?string} "delete" : ${user.permissions.delete?string}
} }
}, },
"onlineEditing": ${doclist.onlineEditing?string} "onlineEditing": ${doclist.onlineEditing?string},
"itemCounts":
{
"folders": ${(itemCount.folders!0)?string},
"documents": ${(itemCount.documents!0)?string}
}
}, },
"items": "items":
[ [

View File

@@ -108,6 +108,9 @@ function getFilterParams(filter, parsedArgs)
var filterQuery = "+PATH:\"" + parsedArgs.parentNode.qnamePath + "/*\""; var filterQuery = "+PATH:\"" + parsedArgs.parentNode.qnamePath + "/*\"";
filterQuery += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\""; filterQuery += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\"";
filterQuery += " -TYPE:\"{http://www.alfresco.org/model/forum/1.0}forums\""; filterQuery += " -TYPE:\"{http://www.alfresco.org/model/forum/1.0}forums\"";
filterQuery += " -TYPE:\"{http://www.alfresco.org/model/forum/1.0}forum\"";
filterQuery += " -TYPE:\"{http://www.alfresco.org/model/forum/1.0}topic\"";
filterQuery += " -TYPE:\"{http://www.alfresco.org/model/forum/1.0}post\"";
filterParams.query = filterQuery; filterParams.query = filterQuery;
break; break;
@@ -118,7 +121,7 @@ function getFilterParams(filter, parsedArgs)
const TYPE_MAP = const TYPE_MAP =
{ {
"documents": '+(TYPE:"{http://www.alfresco.org/model/content/1.0}content" OR TYPE:"{http://www.alfresco.org/model/application/1.0}filelink")', "documents": '+(TYPE:"{http://www.alfresco.org/model/content/1.0}content" OR TYPE:"{http://www.alfresco.org/model/application/1.0}filelink" OR TYPE:"{http://www.alfresco.org/model/content/1.0}folder")',
"folders": '+TYPE:"{http://www.alfresco.org/model/content/1.0}folder"', "folders": '+TYPE:"{http://www.alfresco.org/model/content/1.0}folder"',
"images": "-TYPE:\"{http://www.alfresco.org/model/content/1.0}thumbnail\" +@cm\\:content.mimetype:image/*" "images": "-TYPE:\"{http://www.alfresco.org/model/content/1.0}thumbnail\" +@cm\\:content.mimetype:image/*"
}; };

View File

@@ -10,7 +10,14 @@ function getTreenode(siteId, path)
{ {
try try
{ {
var items = new Array(); var items = new Array(),
ignoredTypes =
{
"{http://www.alfresco.org/model/forum/1.0}forums": true,
"{http://www.alfresco.org/model/forum/1.0}forum": true,
"{http://www.alfresco.org/model/forum/1.0}topic": true,
"{http://www.alfresco.org/model/forum/1.0}post": true
};
// Use helper function to get the arguments // Use helper function to get the arguments
var parsedArgs = getParsedArgs(); var parsedArgs = getParsedArgs();
@@ -22,7 +29,7 @@ function getTreenode(siteId, path)
// Look for folders in the parentNode // Look for folders in the parentNode
for each(item in parsedArgs.parentNode.children) for each(item in parsedArgs.parentNode.children)
{ {
if (item.isSubType("cm:folder")) if (item.isSubType("cm:folder") && !(item.type in ignoredTypes))
{ {
items.push(item); items.push(item);
} }