Files
alfresco-community-repo/config/alfresco/templates/webscripts/org/alfresco/cmis/checkedout.get.js
Dave Ward 2454c27cd6 SAIL-173: Added processing of includeRelationships argument to CMIS REST and SOAP bindings
- Despite its name, this argument is not a Boolean!
- TODO: Extend TCK to test relationships

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18897 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2010-02-27 15:23:11 +00:00

58 lines
1.8 KiB
JavaScript

<import resource="classpath:alfresco/templates/webscripts/org/alfresco/cmis/lib/read.lib.js">
script:
{
// locate (optional) folder
model.folder = null;
var folderId = args[cmis.ARG_FOLDER_ID];
if (folderId !== null)
{
var folder = getObjectFromObjectId(folderId);
if (folder.node === null)
{
break script;
}
model.folder = folder.node;
if (!model.folder.isContainer)
{
status.code = 400;
status.message = "Folder id " + folder.ref + " does not refer to a folder";
status.redirect = true;
break script;
}
}
// NOTE: includeDescendants is an extension of CMIS
model.includeDescendants = (args.includeDescendants == "true") ? true : false;
// property filter
model.filter = args[cmis.ARG_FILTER];
if (model.filter === null)
{
model.filter = "*";
}
// rendition filter
model.renditionFilter = args[cmis.ARG_RENDITION_FILTER];
if (model.renditionFilter === null || model.renditionFilter.length == 0)
{
model.renditionFilter = "cmis:none";
}
// include allowable actions
var includeAllowableActions = args[cmis.ARG_INCLUDE_ALLOWABLE_ACTIONS];
model.includeAllowableActions = (includeAllowableActions == "true" ? true : false);
// include relationships
model.includeRelationships = args[cmis.ARG_INCLUDE_RELATIONSHIPS];
if (model.includeRelationships == null || model.includeRelationships.length == 0)
{
model.includeRelationships = "none";
}
// retrieve checked-out
var page = paging.createPageOrWindow(args);
var paged = cmis.queryCheckedOut(person.properties.userName, model.folder, model.includeDescendants, page);
model.results = paged.results;
model.cursor = paged.cursor;
}