diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl
index d732f446ce..5019412239 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl
@@ -30,9 +30,9 @@
${node.properties.creator!""}
[@contentstream node/]
urn:uuid:${node.id}
-
+
[@linkstream node "enclosure"/]
-
+
[@linkstream node "edit-media"/]
[@documentCMISLinks node=node/]
${xmldate(node.properties.created)}
@@ -41,21 +41,20 @@
${xmldate(node.properties.modified)}
${xmldate(node.properties.modified)}
${absurl(url.context)}${node.icon16}
-
+
[@objectCMISProps node propfilter/]
[#if includeallowableactions][@allowableactions node/][/#if]
-
+
[/@entry]
[/#macro]
[#macro documentCMISLinks node]
-
-
-
-
-[@linkstream node "stream"/]
-
-
+[@linkallowableactions node/]
+[@linkrelationships node/]
+[@linkparents node/]
+[@linkversions node/]
+[@linktype node/]
+[@linkservice/]
[/#macro]
@@ -68,7 +67,7 @@
${node.properties.creator}
[@contentstream node/]
urn:uuid:${node.id}
-
+
[@linkstream node "enclosure"/]
[@documentCMISLinks node=node/]
${xmldate(node.properties.created)}
@@ -77,9 +76,9 @@
${xmldate(node.properties.modified)}
${xmldate(node.properties.modified)}
${absurl(url.context)}${node.icon16}
-
+
[@objectCMISProps node propfilter/]
-
+
[/@entry]
[/#macro]
@@ -93,9 +92,9 @@
${node.properties.creator}
[@contentstream node/]
urn:uuid:${node.id}
-
+
[@linkstream node "enclosure"/]
-
+
[@linkstream node "edit-media"/]
[@documentCMISLinks node=node/]
${xmldate(node.properties.created)}
@@ -105,10 +104,10 @@
${xmldate(node.properties.modified)}
[#-- TODO: the edit link refers to the updatable node resource, allowing updates on PWCs without checkin --]
${absurl(url.context)}${node.icon16}
-
+
[@objectCMISProps node propfilter/]
[#if includeallowableactions][@allowableactions node/][/#if]
-
+
[/@entry]
[/#macro]
@@ -117,13 +116,17 @@
[#-- ATOM Entry for Folder --]
[#-- --]
-[#macro folder node propfilter="*" typesfilter="any" includeallowableactions=false includerelationships="none" ns="" depth=1 maxdepth=1]
+[#macro foldertree node propfilter="*" includeallowableactions=false includerelationships="none" ns="" maxdepth=-1]
+[@folder node propfilter "folders" includeallowableactions includerelationships ns 1 maxdepth "tree"/]
+[/#macro]
+
+[#macro folder node propfilter="*" typesfilter="any" includeallowableactions=false includerelationships="none" ns="" depth=1 maxdepth=1 nestedkind=""]
[@entry ns]
${node.properties.creator}
${node.id} [#-- TODO --]
urn:uuid:${node.id}
-
-
+
+
[@folderCMISLinks node/]
${xmldate(node.properties.created)}
${node.properties.description!node.properties.title!""} [#-- TODO --]
@@ -131,34 +134,40 @@
${xmldate(node.properties.modified)}
${xmldate(node.properties.modified)}
${absurl(url.context)}${node.icon16}
-
-[#-- recurse for depth greater than 1 --]
+
[@objectCMISProps node propfilter/]
[#if includeallowableactions][@allowableactions node/][/#if]
-
-[#if depth < maxdepth || depth == -1]
-[#list cmischildren(node, typesfilter) as child]
+
+[#-- recurse for depth greater than 1 --]
+[#if maxdepth == -1 || depth < maxdepth]
+[#assign nested = cmischildren(node, typesfilter)/]
+[#if nested?size > 0]
+
+[@feedLib.node node "${nestedkind}"/]
+[#list nested as child]
[#if child.isDocument]
[@document child propfilter includeallowableactions includerelationships/]
[#else]
- [@folder child propfilter typesfilter includeallowableactions includerelationships/]
- [@folder child propfilter typesfilter includeallowableactions includerelationships ns depth+1 maxdepth/]
+ [@folder child propfilter typesfilter includeallowableactions includerelationships ns depth+1 maxdepth nestedkind/]
[/#if]
[/#list]
+
+[/#if]
[/#if]
[/@entry]
[/#macro]
[#macro folderCMISLinks node]
-
-
-[#if cmisproperty(node, "cmis:ParentId")?is_string]
-
+[@linkallowableactions node/]
+[@linkrelationships node/]
+[#if cmisproperty(node, cmisconstants.PROP_PARENT_ID)?is_string]
+[@linkparent node/]
[/#if]
-
-
-
-
+[@linkchildren node/]
+[@linkdescendants node/]
+[@linktree node/]
+[@linktype node/]
+[@linkservice/]
[/#macro]
@@ -168,30 +177,30 @@
[#macro assoc assoc propfilter="*" includeallowableactions=false ns=""]
[@entry ns]
-${xmldate(date)} [#-- TODO: [@namedvalue "cmis:CreatedBy" assoc "STRING"/] --]
-[@namedvalue "cmis:ObjectId" assoc "ID"/] [#-- TODO: spec id, how to map? --]
-[@namedvalue "cmis:ObjectId" assoc "ID"/] [#-- TODO: id compliant --]
+${xmldate(date)} [#-- TODO: [@namedvalue cmisconstants.PROP_CREATED_BY assoc cmisconstants.DATATYPE_STRING/] --]
+[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/] [#-- TODO: spec id, how to map? --]
+[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/] [#-- TODO: id compliant --]
[@assocCMISLinks assoc=assoc/]
-${xmldate(date)} [#-- TODO: [@namedvalue "cmis:CreationDate" assoc "DATETIME"/] --]
-[@namedvalue "cmis:ObjectId" assoc "ID"/] [#-- TODO: spec id, how to map? --]
-
[@namedvalue "cmis:ObjectId" assoc "ID"/] [#-- TODO: spec id, how to map? --]
-${xmldate(date)} [#-- TODO: [@namedvalue "cmis:LastModificationDate" assoc "DATETIME"/] --]
-${xmldate(date)} [#-- TODO: [@namedvalue "cmis:LastModificationDate" assoc "DATETIME"/] --]
-
+${xmldate(date)} [#-- TODO: [@namedvalue cmisconstants.PROP_CREATION_DATE assoc cmisconstants.DATATYPE_DATETIME/] --]
+[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/] [#-- TODO: spec id, how to map? --]
+[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/] [#-- TODO: spec id, how to map? --]
+${xmldate(date)} [#-- TODO: [@namedvalue cmisconstants.PROP_LAST_MODIFICATION_DATE assoc cmisconstants.DATATYPE_DATETIME/] --]
+${xmldate(date)} [#-- TODO: [@namedvalue cmisconstants.PROP_LAST_MODIFICATION_DATE assoc cmisconstants.DATATYPE_DATETIME/] --]
+
[@objectCMISProps assoc propfilter/]
[#-- TODO: [#if includeallowableactions][@allowableactions node/][/#if] --]
-
+
[/@entry]
[/#macro]
[#macro assocCMISLinks assoc]
[#-- TODO: --]
-
-
-
-
+[@linktype assoc/]
+[@linktosource assoc.source/]
+[@linktotarget assoc.target/]
+[@linkservice/]
[/#macro]
@@ -214,8 +223,8 @@
[/#if]
urn:uuid:${node.id}
-
-
+
+
[#if node.isDocument]
[@linkstream node "enclosure"/]
[@linkstream node "edit-media"/]
@@ -227,7 +236,7 @@
${xmldate(node.properties.modified)}
${absurl(url.context)}${node.icon16}
[/#if]
-
+
[#assign rowvalues = row.values]
@@ -241,7 +250,7 @@
[/#list]
[#if row.nodes?? && includeallowableactions][@allowableactions node/][/#if]
-
+
[/@entry]
[/#macro]
@@ -264,40 +273,40 @@
[/#macro]
[#macro propvalue name value type]
-[#if type == "STRING"]
-[@values value;v][@stringvalue v/][/@values]
-[#elseif type == "INTEGER"]
-[@values value;v][@integervalue v/][/@values]
-[#elseif type == "DECIMAL"]
-[@values value;v][@decimalvalue v/][/@values]
-[#elseif type == "BOOLEAN"]
-[@values value;v][@booleanvalue v/][/@values]
-[#elseif type == "DATETIME"]
-[@values value;v][@datetimevalue v/][/@values]
-[#elseif type == "URI"]
+[#if type.label == cmisconstants.DATATYPE_STRING]
+[@values value;v][@stringvalue v/][/@values]
+[#elseif type.label == cmisconstants.DATATYPE_INTEGER]
+[@values value;v][@integervalue v/][/@values]
+[#elseif type.label == cmisconstants.DATATYPE_DECIMAL]
+[@values value;v][@decimalvalue v/][/@values]
+[#elseif type.label == cmisconstants.DATATYPE_BOOLEAN]
+[@values value;v][@booleanvalue v/][/@values]
+[#elseif type.label == cmisconstants.DATATYPE_DATETIME]
+[@values value;v][@datetimevalue v/][/@values]
+[#elseif type.label == cmisconstants.DATATYPE_URI]
[#-- TODO: check validity of abs url prefix --]
-[@values value;v][@urivalue absurl(url.serviceContext) + v/][/@values]
-[#elseif type == "ID"]
-[@values value;v][@idvalue v/][/@values]
+[@values value;v][@urivalue absurl(url.serviceContext) + v/][/@values]
+[#elseif type.label == cmisconstants.DATATYPE_ID]
+[@values value;v][@idvalue v/][/@values]
[#-- TODO: remaining property types --]
[/#if]
[/#macro]
[#macro propnull name type]
-[#if type == "STRING"]
-
-[#elseif type == "INTEGER"]
-
-[#elseif type == "DECIMAL"]
-
-[#elseif type == "BOOLEAN"]
-
-[#elseif type == "DATETIME"]
-
-[#elseif type == "URI"]
-
-[#elseif type == "ID"]
-
+[#if type.label == cmisconstants.DATATYPE_STRING]
+
+[#elseif type.label == cmisconstants.DATATYPE_INTEGER]
+
+[#elseif type.label == cmisconstants.DATATYPE_DECIMAL]
+
+[#elseif type.label == cmisconstants.DATATYPE_BOOLEAN]
+
+[#elseif type.label == cmisconstants.DATATYPE_DATETIME]
+
+[#elseif type.label == cmisconstants.DATATYPE_URI]
+
+[#elseif type.label == cmisconstants.DATATYPE_ID]
+
[#-- TODO: remaining property types --]
[/#if]
[/#macro]
@@ -313,20 +322,20 @@
[/#macro]
[#macro typedvalue value type]
-[#if type == "STRING"]
+[#if type== cmisconstants.DATATYPE_STRING]
[@values value;v][@stringvalue v/][/@values]
-[#elseif type == "INTEGER"]
+[#elseif type == cmisconstants.DATATYPE_INTEGER]
[@values value;v][@integervalue v/][/@values]
-[#elseif type == "DECIMAL"]
+[#elseif type == cmisconstants.DATATYPE_DECIMAL]
[@values value;v][@decimalvalue v/][/@values]
-[#elseif type == "BOOLEAN"]
+[#elseif type == cmisconstants.DATATYPE_BOOLEAN]
[@values value;v][@booleanvalue v/][/@values]
-[#elseif type == "DATETIME"]
+[#elseif type == cmisconstants.DATATYPE_DATETIME]
[@values value;v][@datetimevalue v/][/@values]
-[#elseif type == "URI"]
+[#elseif type == cmisconstants.DATATYPE_URI]
[#-- TODO: check validity of abs url prefix --]
[@values value;v][@urivalue absurl(url.serviceContext) + v/][/@values]
-[#elseif type == "ID"]
+[#elseif type == cmisconstants.DATATYPE_ID]
[@values value;v][@idvalue v/][/@values]
[#-- TODO: remaining property types --]
[/#if]
@@ -366,67 +375,79 @@
[#-- ATOM Entry for Type Definition --]
[#-- --]
-[#macro typedef typedef includeProperties=true includeInheritedProperties=true ns=""]
+[#macro typedef typedefn includeProperties=true includeInheritedProperties=true ns="" depth=1 maxdepth=1]
[@entry ns=ns]
${person.properties.userName}
-${typedef.typeId.id} [#-- TODO --]
-urn:uuid:type-${typedef.typeId.id}
-
-[@typedefCMISLinks typedef/]
-[#if typedef.description??]${typedef.description?xml}[#else]${typedef.displayName?xml}[/#if]
-${typedef.displayName}
+${typedefn.typeId.id} [#-- TODO --]
+urn:uuid:type-${typedefn.typeId.id}
+
+[@typedefCMISLinks typedefn/]
+[#if typedefn.description??]${typedefn.description?xml}[#else]${typedefn.displayName?xml}[/#if]
+${typedefn.displayName}
${xmldate(date)} [#-- TODO --]
-[@typedefCMISProps typedef includeProperties/]
+[@typedefCMISProps typedefn includeProperties/]
+[#-- recurse for depth greater than 1 --]
+[#if maxdepth == -1 || depth < maxdepth]
+[#assign nested = typedefn.getSubTypes(false)/]
+[#if nested?size > 1]
+
+[@feedLib.typedef typedefn=typedefn kind="descendants" author="${person.properties.userName}"/]
+[#list nested as child]
+ [@typedef child includeProperties includeInheritedProperties ns depth+1 maxdepth/]
+[/#list]
+
+[/#if]
+[/#if]
[/@entry]
[/#macro]
[#macro typedefCMISLinks typedef]
-
+[@linktype typedef/]
[#if typedef.parentType??]
-
+[@linktypeparent typedef/]
[/#if]
-
-
-
+[@linktypechildren typedef/]
+[@linktypedescendants typedef/]
+[@linkservice/]
[/#macro]
[#macro typedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
-[#if typedef.baseType.typeId.id = "cmis:Document"]
+[#if typedef.baseType.typeId.id = cmisconstants.TYPE_DOCUMENT]
[@documenttypedefCMISProps typedef includeProperties includeInheritedProperties/]
-[#elseif typedef.baseType.typeId.id = "cmis:Folder"]
+[#elseif typedef.baseType.typeId.id = cmisconstants.TYPE_FOLDER]
[@foldertypedefCMISProps typedef includeProperties includeInheritedProperties/]
-[#elseif typedef.baseType.typeId.id = "cmis:Relationship"]
+[#elseif typedef.baseType.typeId.id = cmisconstants.TYPE_RELATIONSHIP]
[@relationshiptypedefCMISProps typedef includeProperties includeInheritedProperties/]
-[#elseif typedef.baseType.typeId.id = "cmis:Policy"]
+[#elseif typedef.baseType.typeId.id = cmisconstants.TYPE_POLICY]
[@policytypedefCMISProps typedef includeProperties includeInheritedProperties/]
[/#if]
[/#macro]
[#macro documenttypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
-
+
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
${typedef.versionable?string}
${typedef.contentStreamAllowed.label}
-
+
[/#macro]
[#macro foldertypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
-
+
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
-
+
[/#macro]
[#macro relationshiptypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
-
+
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
[#-- TODO: source and target types --]
-
+
[/#macro]
[#macro policytypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
-
+
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
-
+
[/#macro]
[#macro objecttypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
@@ -459,23 +480,23 @@
[/#macro]
[#macro propdefCMISProps propdef inherited=false]
-[#if propdef.dataType == "BOOLEAN"]
+[#if propdef.dataType.label == cmisconstants.DATATYPE_BOOLEAN]
[@booleanpropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "ID"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_ID]
[@idpropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "INTEGER"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_INTEGER]
[@integerpropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "DATETIME"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_DATETIME]
[@datetimepropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "DECIMAL"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_DECIMAL]
[@decimalpropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "HTML"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_HTML]
[@htmlpropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "STRING"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_STRING]
[@stringpropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "URI"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_URI]
[@uripropdefCMISProps propdef inherited/]
-[#elseif propdef.dataType == "XML"]
+[#elseif propdef.dataType.label == cmisconstants.DATATYPE_XML]
[@xmlpropdefCMISProps propdef inherited/]
[/#if]
[/#macro]
@@ -566,37 +587,37 @@
[#macro cmisChoices choices type]
[#if choices?exists]
[#list choices as choice]
-[#if type == "STRING"]
+[#if type.label == cmisconstants.DATATYPE_STRING]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
-[#elseif type == "INTEGER"]
+[#elseif type.label == cmisconstants.DATATYPE_INTEGER]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
-[#elseif type == "DECIMAL"]
+[#elseif type.label == cmisconstants.DATATYPE_DECIMAL]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
-[#elseif type == "BOOLEAN"]
+[#elseif type.label == cmisconstants.DATATYPE_BOOLEAN]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
-[#elseif type == "DATETIME"]
+[#elseif type.label == cmisconstants.DATATYPE_DATETIME]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
-[#elseif type == "URI"]
+[#elseif type.label == cmisconstants.DATATYPE_URI]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
-[#elseif type == "ID"]
+[#elseif type.label == cmisconstants.DATATYPE_ID]
[@cmisChoices choice.children type/]
[@stringvalue choice.value/]
@@ -607,6 +628,96 @@
[/#if]
[/#macro]
+
+[#-- --]
+[#-- Link Relations --]
+[#-- --]
+
+[#-- Link to repository service document --]
+[#macro linkservice]
+
+[/#macro]
+
+[#-- Link to node allowable actions --]
+[#macro linkallowableactions node]
+
+[/#macro]
+
+[#-- Link to node relationships --]
+[#macro linkrelationships node]
+
+[/#macro]
+
+[#-- Link to node parents --]
+[#macro linkparents node]
+
+[/#macro]
+
+[#-- Link to folder parent --]
+[#macro linkparent node]
+
+[/#macro]
+
+[#-- Link to node children --]
+[#macro linkchildren node]
+
+[/#macro]
+
+[#-- Link to node descendants --]
+[#macro linkdescendants node]
+
+[/#macro]
+
+[#-- Link to node tree --]
+[#macro linktree node]
+
+[/#macro]
+
+[#-- Link to node versions --]
+[#macro linkversions node]
+
+[/#macro]
+
+[#-- Link to source node --]
+[#macro linktosource node]
+
+[/#macro]
+
+[#-- Link to target node --]
+[#macro linktotarget node]
+
+[/#macro]
+
+[#-- Link to content stream --]
+[#macro linkstream node rel=""]
+
+[/#macro]
+
+[#-- Link to node type --]
+[#macro linktype object]
+
+[/#macro]
+
+[#-- Link to type parent --]
+[#macro linktypeparent typedef]
+
+[/#macro]
+
+[#-- Link to type children --]
+[#macro linktypechildren typedef]
+
+[/#macro]
+
+[#-- Link to type descendants --]
+[#macro linktypedescendants typedef]
+
+[/#macro]
+
+
+[#-- --]
+[#-- General Utils --]
+[#-- --]
+
[#-- Helper to render Atom Summary --]
[#macro contentsummary node][#if node.properties.description??]${node.properties.description}[#elseif node.properties.title??]${node.properties.title}[#elseif node.mimetype?? && node.mimetype == "text/plain"]${cropContent(node.properties.content, 50)}[#else]${node.properties.name}[/#if][/#macro]
@@ -616,9 +727,6 @@
[#-- Helper to render atom content element --]
[#macro contentstream node][/#macro]
-[#-- Helper to render atom content element --]
-[#macro linkstream node rel=""][/#macro]
-
[#-- Helper to render Alfresco content stream uri --]
[#macro contenturi node]${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content[#if node.properties.name?? && node.properties.name?last_index_of(".") != -1]${encodeuri(node.properties.name?substring(node.properties.name?last_index_of(".")))}[/#if][/#macro]
@@ -633,3 +741,6 @@
[#-- Helper to render Alfresco Assoc uri --]
[#macro assocuri assoc]/api/rel/[@noderef assoc.source/]/type/${cmistype(assoc).typeId.id!"undefined"}/target/[@noderef assoc.target/][/#macro]
+
+[#-- Helper to render Alfresco Type uri --]
+[#macro typeuri typedef]/api/type/${typedef.typeId.id}[/#macro]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.js b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.js
index 0a843fb38a..13de42c1c3 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.js
@@ -8,12 +8,12 @@
//
function createNode(parent, entry, slug)
{
- var object = entry.getExtension(atom.names.cmis_object);
+ var object = entry.getExtension(atom.names.cmisra_object);
var typeId = (object !== null) ? object.objectTypeId.nativeValue : null;
// locate type definition
// TODO: check this against spec - default to Document, if not specified
- var type = cmis.queryType(typeId === null ? "document" : typeId);
+ var type = cmis.queryType(typeId === null ? DOCUMENT_TYPE_ID.id : typeId);
if (type === null)
{
status.code = 400;
@@ -24,13 +24,13 @@ function createNode(parent, entry, slug)
// construct node of folder or file
var name = (slug !== null) ? slug : entry.title;
- var baseType = type.typeId.baseTypeId.id;
- if (baseType == "document")
+ var baseType = type.typeId.baseTypeId;
+ if (baseType == DOCUMENT_TYPE_ID)
{
node = parent.createFile(name);
// TODO: versioningState argument (CheckedOut/CheckedInMinor/CheckedInMajor)
}
- else if (baseType == "folder")
+ else if (baseType == FOLDER_TYPE_ID)
{
node = parent.createFolder(name);
}
@@ -43,8 +43,7 @@ function createNode(parent, entry, slug)
}
// specialize to required custom type
- var objectType = type.typeId.id;
- if (objectType != "document" && objectType != "folder")
+ if (type.typeId != DOCUMENT_TYPE_ID && type.typeId != FOLDER_TYPE_ID)
{
if (!node.specializeType(type.typeId.QName))
{
@@ -56,7 +55,7 @@ function createNode(parent, entry, slug)
}
// update node properties (excluding object type & name)
- var exclude = [ "ObjectTypeId", "Name" ];
+ var exclude = [ PROP_OBJECT_TYPE_ID, PROP_NAME ];
var updated = updateNode(node, entry, exclude, function(propDef) {return patchValidator(propDef, true);});
// only return node if updated successfully
@@ -85,16 +84,16 @@ function updateNode(node, entry, exclude, validator)
}
var updated = false;
- var object = entry.getExtension(atom.names.cmis_object);
+ var object = entry.getExtension(atom.names.cmisra_object);
var props = (object == null) ? null : object.properties;
var vals = new Object();
// calculate list of properties to update
// TODO: consider array form of properties.names
- var updateProps = (props == null) ? new Array() : props.names.toArray().filter(function(element, index, array) {return true;});
- updateProps.push("Name"); // mapped to entry.title
+ var updateProps = (props == null) ? new Array() : props.ids.toArray().filter(function(element, index, array) {return true;});
+ updateProps.push(PROP_NAME); // mapped to entry.title
var exclude = (exclude == null) ? new Array() : exclude;
- exclude.push("BaseType"); // TODO: CMIS Issue where BaseType is not a property
+ exclude.push(PROP_BASE_TYPE_ID);
updateProps = updateProps.filter(includeProperty, exclude);
// build values to update
@@ -134,7 +133,7 @@ function updateNode(node, entry, exclude, validator)
{
if (prop.isMultiValued())
{
- if (propDef.updatability === Packages.org.alfresco.cmis.CMISCardinalityEnum.MULTI_VALUED)
+ if (propDef.updatability === CMISCardinalityEnum.MULTI_VALUED)
{
status.code = 500;
status.message = "Property " + propName + " is single valued."
@@ -150,7 +149,7 @@ function updateNode(node, entry, exclude, validator)
}
// NOTE: special case name: entry.title overrides cmis:name
- if (propName === "Name")
+ if (propName === PROP_NAME)
{
val = entry.title;
}
@@ -207,18 +206,18 @@ function updateNode(node, entry, exclude, validator)
//
function createAssociation(source, entry)
{
- var object = entry.getExtension(atom.names.cmis_object);
+ var object = entry.getExtension(atom.names.cmisra_object);
var typeId = (object !== null) ? object.objectTypeId.nativeValue : null;
// locate relationship type definition
// TODO: check this against spec - default to Relationship, if not specified
- var type = cmis.queryType(typeId === null ? "relationship" : typeId);
+ var type = cmis.queryType(typeId === null ? RELATIONSHIP_TYPE_ID.id : typeId);
if (type === null)
{
status.setCode(400, "CMIS object type " + typeId + " not understood");
return null;
}
- if (type.typeId.baseTypeId.id != "relationship")
+ if (type.typeId.baseTypeId != RELATIONSHIP_TYPE_ID)
{
status.setCode(400, "CMIS object type " + typeId + " is not a relationship type");
return null;
@@ -256,14 +255,14 @@ function createAssociation(source, entry)
function patchValidator(propDef, pwc)
{
// is the property write-able?
- if (propDef.updatability === Packages.org.alfresco.cmis.CMISUpdatabilityEnum.READ_ONLY)
+ if (propDef.updatability === CMISUpdatabilityEnum.READ_ONLY)
{
status.code = 500;
status.message = "Property " + propName + " cannot be updated. It is read only."
status.redirect = true;
return null;
}
- if (!pwc && propDef.updatability === Packages.org.alfresco.cmis.CMISUpdatabilityEnum.READ_AND_WRITE_WHEN_CHECKED_OUT)
+ if (!pwc && propDef.updatability === CMISUpdatabilityEnum.READ_AND_WRITE_WHEN_CHECKED_OUT)
{
status.code = 500;
status.message = "Property " + propName + " can only be updated on a private working copy.";
@@ -288,11 +287,11 @@ function patchValidator(propDef, pwc)
function putValidator(propDef, pwc)
{
// is the property write-able?
- if (propDef.updatability === Packages.org.alfresco.cmis.CMISUpdatabilityEnum.READ_ONLY)
+ if (propDef.updatability === CMISUpdatabilityEnum.READ_ONLY)
{
return false;
}
- if (!pwc && propDef.updatability === Packages.org.alfresco.cmis.CMISUpdatabilityEnum.READ_AND_WRITE_WHEN_CHECKED_OUT)
+ if (!pwc && propDef.updatability === CMISUpdatabilityEnum.READ_AND_WRITE_WHEN_CHECKED_OUT)
{
return false;
}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl
index 97f2cd4d54..d9ba3095aa 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl
@@ -31,14 +31,30 @@
[#-- ATOM Feed for Node --]
[#-- --]
-[#macro node node title=""]
+[#macro node node kind=""]
${node.properties.creator!""}
Alfresco (${server.edition})
${absurl(url.context)}/images/logo/AlfrescoLogo16.ico
-urn:uuid:${node.id}[#if title != ""]-${title}[/#if]
+urn:uuid:${node.id}[#if kind != ""]-${kind}[/#if]
[#nested] [#-- NOTE: Custom links --]
-${node.name}[#if title != ""] ${title?capitalize}[/#if]
+${node.name}[#if kind != ""] ${kind?capitalize}[/#if]
${xmldate(node.properties.modified)}
[/#macro]
+
+
+[#-- --]
+[#-- ATOM Feed for Type Container --]
+[#-- --]
+
+[#macro typedef typedefn kind="children" author="System"]
+${author}
+Alfresco (${server.edition})
+${absurl(url.context)}/images/logo/AlfrescoLogo16.ico
+urn:uuid:type-${typedefn.typeId.id}-${kind}
+
+[#nested] [#-- NOTE: Custom links --]
+${typedefn.displayName} ${kind?capitalize}
+${xmldate(date)}
+[/#macro]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/constants.lib.js b/config/alfresco/templates/webscripts/org/alfresco/cmis/constants.lib.js
index 8620873b57..5bbdbb7a4e 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/cmis/constants.lib.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/constants.lib.js
@@ -2,5 +2,19 @@
// Constants
//
+// Base Type Ids
+DOCUMENT_TYPE_ID = Packages.org.alfresco.cmis.CMISDictionaryModel.DOCUMENT_TYPE_ID;
+FOLDER_TYPE_ID = Packages.org.alfresco.cmis.CMISDictionaryModel.FOLDER_TYPE_ID;
+RELATIONSHIP_TYPE_ID = Packages.org.alfresco.cmis.CMISDictionaryModel.RELATIONSHIP_TYPE_ID;
+POLICY_TYPE_ID = Packages.org.alfresco.cmis.CMISDictionaryModel.POLICY_TYPE_ID;
+
+// Property Names
+// NOTE: force conversion of java to javascript strings (hack)
+PROP_BASE_TYPE_ID = Packages.org.alfresco.cmis.CMISDictionaryModel.PROP_BASE_TYPE_ID + "";
+PROP_OBJECT_TYPE_ID = Packages.org.alfresco.cmis.CMISDictionaryModel.PROP_OBJECT_TYPE_ID + "";
+PROP_NAME = Packages.org.alfresco.cmis.CMISDictionaryModel.PROP_NAME + "";
+
// CMIS Enums
CMISRelationshipDirectionEnum = Packages.org.alfresco.cmis.CMISRelationshipDirectionEnum;
+CMISCardinalityEnum = Packages.org.alfresco.cmis.CMISCardinalityEnum;
+CMISUpdatabilityEnum = Packages.org.alfresco.cmis.CMISUpdatabilityEnum;
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/ns.lib.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/cmis/ns.lib.atom.ftl
index 02b0d14e26..acbe90a863 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/cmis/ns.lib.atom.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/ns.lib.atom.ftl
@@ -6,7 +6,7 @@
[#macro cmisraNS]http://docs.oasis-open.org/ns/cmis/restatom/200901[/#macro]
[#macro alfNS]http://www.alfresco.org[/#macro]
[#macro opensearchNS]http://a9.com/-/spec/opensearch/1.1/[/#macro]
-[#macro serviceNS]xmlns="[@appNS/]" xmlns:atom="[@atomNS/]" xmlns:cmis="[@cmisNS/]" xmlns:cmisra="[@cmisraNS/]" xmlns:alf="[@alfNS/]"[/#macro]
-[#macro feedNS]xmlns="[@atomNS/]" xmlns:app="[@appNS/]" xmlns:cmis="[@cmisNS/]" xmlns:alf="[@alfNS/]" xmlns:opensearch="[@opensearchNS/]"[/#macro]
-[#macro entryNS]xmlns="[@atomNS/]" xmlns:app="[@appNS/]" xmlns:cmis="[@cmisNS/]" xmlns:alf="[@alfNS/]"[/#macro]
+[#macro serviceNS]xmlns="[@appNS/]" xmlns:atom="[@atomNS/]" xmlns:cmisra="[@cmisraNS/]" xmlns:cmis="[@cmisNS/]" xmlns:alf="[@alfNS/]"[/#macro]
+[#macro feedNS]xmlns="[@atomNS/]" xmlns:app="[@appNS/]" xmlns:cmisra="[@cmisraNS/]" xmlns:cmis="[@cmisNS/]" xmlns:alf="[@alfNS/]" xmlns:opensearch="[@opensearchNS/]"[/#macro]
+[#macro entryNS]xmlns="[@atomNS/]" xmlns:app="[@appNS/]" xmlns:cmisra="[@cmisraNS/]" xmlns:cmis="[@cmisNS/]" xmlns:alf="[@alfNS/]"[/#macro]
[#macro allowableactionsNS]xmlns:cmis="[@cmisNS/]"[/#macro]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl
index 7e2dc982ee..55d5e32285 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl
@@ -2,12 +2,15 @@
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
-
+
${server.name}
root collection
+
+ type collection
+
checkedout collection
application/atom+xml;type=entry
@@ -16,15 +19,16 @@
unfiled collection
application/atom+xml;type=entry
-
- type collection
-
query collection
application/cmisquery+xml
-
+
+
+
+
+
${server.id}
${server.name}
self
@@ -39,22 +43,29 @@
[#-- TODO --]none
${allVersionsSearchable?string}
[#-- TODO --]none
- [#-- ISSUE CMIS-342 --]cmis:Document
- [#-- TODO, ISSUE CMIS-342 --]anytime
- [#-- TODO CMIS-342 --]true
+ cmis:document
+ anytime
+ true
true
${pwcSearchable?string}
true
${querySupport}
- [#-- TODO, ISSUE CMIS-342 --]false
+ [#-- TODO: implement rendition spec --]
+ none
false
false
${joinSupport}
- [#-- TODO: wait for ACL proposal before implementing --]
+ [#-- TODO: implement ACL spec --]
[#-- --]
${cmisVersion}
+
+ ${absurl(url.serviceContext)}/api/node/{id}?filter={filter}&includeAllowableActions={includeAllowableActions}&includeRelationships={includeRelationships}
+ entrybyid
+ application/atom+xml;type=entry
+
+
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.cmisallowableactions.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.cmisallowableactions.ftl
index 59717fdc16..86117df503 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.cmisallowableactions.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.cmisallowableactions.ftl
@@ -5,9 +5,6 @@
[#assign namespace][@nsLib.allowableactionsNS/][/#assign]
-[@entryLib.allowableactions node=node ns=namespace]
- ${cmisproperty(node, "ObjectId")}
- ${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}
-[/@entryLib.allowableactions]
+[@entryLib.allowableactions node=node ns=namespace/]
[/#compress]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.desc.xml
index d2e2ee5315..a61cc79535 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/allowableactions.get.desc.xml
@@ -1,8 +1,8 @@
Retrieve Allowable Actions
Retrieve Allowable Actions
- /api/node/{store_type}/{store_id}/{id}/permissions
- /api/path/{store_type}/{store_id}/{id}/permissions
+ /api/node/{store_type}/{store_id}/{id}/allowableactions
+ /api/path/{store_type}/{store_id}/{id}/allowableactions
guest
argument
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/checkedout.post.atomentry.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/checkedout.post.atomentry.js
index 95f40ae8b0..6c703450c7 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/checkedout.post.atomentry.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/checkedout.post.atomentry.js
@@ -10,7 +10,7 @@ script:
}
// extract object id from atom entry
- var object = entry.getExtension(atom.names.cmis_object);
+ var object = entry.getExtension(atom.names.cmisra_object);
var objectId = (object !== null) ? object.objectId.stringValue : null;
if (objectId === null)
{
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.post.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.post.atom.js
index 2b7aef6473..1f99eb4530 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.post.atom.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.post.atom.js
@@ -1,3 +1,4 @@
+
script:
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atom.js
deleted file mode 100644
index 2b7aef6473..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atom.js
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-script:
-{
- // ensure atom entry is posted
- if (entry === null)
- {
- status.code = 400;
- status.message = "Expected atom entry";
- status.redirect = true;
- break script;
- }
-
- // locate parent node
- var pathSegments = url.match.split("/");
- var reference = [ url.templateArgs.store_type, url.templateArgs.store_id ].concat(url.templateArgs.id.split("/"));
- model.parent = cmis.findNode(pathSegments[2], reference);
- if (model.parent === null)
- {
- status.code = 404;
- status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not found";
- status.redirect = true;
- break script;
- }
-
- // create node
- var node = createNode(model.parent, entry, slug);
- if (node == null)
- {
- break script;
- }
-
- // success
- node.save();
- model.node = node;
- // TODO: set Content-Location
- status.code = 201;
- status.location = url.server + url.serviceContext + "/api/node/" + node.nodeRef.storeRef.protocol + "/" + node.nodeRef.storeRef.identifier + "/" + node.nodeRef.id;
- status.redirect = true;
-}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atomentry.201.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atomentry.201.ftl
deleted file mode 100644
index 836601b05f..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atomentry.201.ftl
+++ /dev/null
@@ -1,16 +0,0 @@
-[#ftl]
-[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
-[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
-[#compress]
-
-
-
-[#assign namespace][@nsLib.entryNS/][/#assign]
-
-[#if node.isDocument]
- [@entryLib.document node=node propfilter="*" includeallowableactions=false includerelationships="none" ns=namespace/]
-[#else]
- [@entryLib.folder node=node propfilter="*" includeallowableactions=false includerelationships="none" ns=namespace/]
-[/#if]
-
-[/#compress]
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.desc.xml
deleted file mode 100644
index 1b485512e4..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.desc.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
- Create folder or document (createDocument, createFolder)
-
-
-
-Inputs:
-
-ID typeId: Document type
-Collection properties
-(Optional) ID folderId: Parent folder for this new document
-(Optional) ContentStream contentStream
-(Optional) Enum versioningState: CheckedOut, CheckedInMinor, CheckedInMajor (Default)
-
-Outputs:
-
-ID objectId: Id of the created document object
-
-The versioningState input is used to create a document in a checked-out state, or as a checked-in minor version, or as a checked-in major version. If created in a checked-out state, the object is a PWC and there is no corresponding "checked out document". (See the "Versioning" section.)
-If the Document’s Object Type does not allow content-stream and a content-stream is provided, or if content-stream is required and a content-stream is not provided, throw ConstraintViolationException.
-If a Folder is specified, and the Document’s Object Type is not one of the “Allowed_Child_Object_Types” for this Folder, throw ConstraintViolationException.
-If unfiling is not supported and a Folder is not specified, throw FolderNotValidException.
-Repositories MAY reject the createDocument request (by throwing ConstaintViolationException) if any of the Required properties specified in the Document’s Object Type are not set.
-However, iF the repository does NOT reject the createDocument request in this case, the repository MUST leave the newly-created Document in a checked-out state, and MUST ensure that all required properties are set before the Document is checked in.
-
-
-Creates a folder object of the specified type
-
-Inputs:
-
-ID typeId: Folder type
-Collection properties
-ID folderId: Parent folder for this new folder
-
-Outputs:
-
-ID objectId: Id of the created folder object
-
-Notes:
-If the to-be-created Folder’s Object Type is not one of the “Allowed_Child_Object_Types” for the parent Folder, throw ConstraintViolationException.
-Root folder can not be created using this service.
-]]>
-
- /api/node/{store_type}/{store_id}/{id}/descendants
- /api/path/{store_type}/{store_id}/{id}/descendants
- user
-
- CMIS
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.js
deleted file mode 100644
index 1527e32831..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.js
+++ /dev/null
@@ -1,9 +0,0 @@
-script:
-{
- // TODO: Handle direct posting of media
-
- status.code = 400;
- status.message = "Posting of media resource not supported";
- status.redirect = true;
- break script;
-}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.get.desc.xml
index 6a2f11aaf4..fa98fc1f00 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.get.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.get.desc.xml
@@ -26,8 +26,8 @@ PropertyCollection includes changeToken (if applicable to repository)
]]>
- /api/node/{store_type}/{store_id}/{id}?filter={filter?}&returnVersion={returnVersion?}&filter={filter?}&includeAllowableActions={includeAllowableActions?}
- /api/path/{store_type}/{store_id}/{id}?filter={filter?}&returnVersion={returnVersion?}&filter={filter?}&includeAllowableActions={includeAllowableActions?}
+ /api/node/{store_type}/{store_id}/{id}?filter={filter?}&returnVersion={returnVersion?}&includeAllowableActions={includeAllowableActions?}
+ /api/path/{store_type}/{store_id}/{id}?filter={filter?}&returnVersion={returnVersion?}&includeAllowableActions={includeAllowableActions?}
guest
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.patch.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.patch.atom.js
index 5a0a6795c8..643d5f9c38 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.patch.atom.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.patch.atom.js
@@ -1,3 +1,4 @@
+
script:
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.put.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.put.atom.js
index 7554f9db7a..aaecfcd3e3 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.put.atom.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/item.put.atom.js
@@ -1,3 +1,4 @@
+
script:
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomentry.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomentry.ftl
new file mode 100644
index 0000000000..206a9230c2
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomentry.ftl
@@ -0,0 +1,11 @@
+[#ftl]
+[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
+[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
+[#compress]
+
+
+[#assign namespace][@nsLib.entryNS/][/#assign]
+
+[@entryLib.folder node=node propfilter=filter includeallowableactions=includeAllowableActions includerelationships="none" ns=namespace/]
+
+[/#compress]
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomfeed.ftl
deleted file mode 100644
index 8a139e691c..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomfeed.ftl
+++ /dev/null
@@ -1,25 +0,0 @@
-[#ftl]
-[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
-[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
-[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
-[#compress]
-
-
-
-
-
-[@feedLib.node node "parent"/]
-[@parent node.parent returnToRoot/]
-
-
-
-[/#compress]
-
-[#macro parent node recurse=false]
-[#if node?exists && node.isContainer]
- [@entryLib.folder node=node propfilter=filter includeallowableactions=includeAllowableActions includerelationships="none"/]
- [#if recurse && node.id != rootNode.id]
- [@parent node.parent true/]
- [/#if]
-[/#if]
-[/#macro]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.desc.xml
index be630d2193..3314a8ec81 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.desc.xml
@@ -1,35 +1,11 @@
Retrieve Parent Folder (getFolderParent)
-
-
-Inputs:
-
-ID folderId: Source folder to get the parent or ancestors of
-(Optional) String filter: Property filter specifying which properties to return.
-(Optional) Boolean includeAllowableActions: False (default)
-(Optional) Enum includeRelationships: none (default), source, target, both
-(Optional) Bool returnToRoot: If false, return only the immediate parent of the folder. If true, return an ordered list of all ancestor folders from the specified folder to the root folder. Default=False
-
-Outputs:
-
-ResultSet resultSet of folders
-Parent Folder ID + Specified properties
-Can be a list of folders
-
-Notes:
-
-Output is ordered by ancestry, closest to specified folder first. However XML clients may not always respect ordering. For that reason repositories SHOULD always include the parent and the ObjectID property in the filter to allow re-ordering if necessary.
-No parent folder is returned if the specified folder is the root folder.
-If “includeAllowableActions” is TRUE, the repository will return the allowable actions for the current user for each parent or ancestor folder as part of the output.
-"IncludeRelationships" indicates whether relationships are also returned for each returned object. If it is set to "source" or "target", relationships for which the returned object is a source, or respectively a target, will also be returned. If it is set to "both", relationships for which the returned object is either a source or a target will be returned. If it is set to "none", relationships are not returned.
-]]>
- /api/node/{store_type}/{store_id}/{id}/parent?returnToRoot={returnToRoot}&filter={filter?}&includeAllowableActions={includeAllowableActions?}
- /api/path/{store_type}/{store_id}/{id}/parent?returnToRoot={returnToRoot}&filter={filter?}&includeAllowableActions={includeAllowableActions?}
+ /api/node/{store_type}/{store_id}/{id}/parent?filter={filter?}&includeAllowableActions={includeAllowableActions?}
+ /api/path/{store_type}/{store_id}/{id}/parent?filter={filter?}&includeAllowableActions={includeAllowableActions?}
guest
- argument
+ argument
CMIS
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.js
index 2eece2b4c2..4d3da3d26f 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.js
@@ -3,14 +3,24 @@ script:
// locate node
var pathSegments = url.match.split("/");
var reference = [ url.templateArgs.store_type, url.templateArgs.store_id ].concat(url.templateArgs.id.split("/"));
- model.node = cmis.findNode(pathSegments[2], reference);
- if (model.node === null)
+ var node = cmis.findNode(pathSegments[2], reference);
+ if (node === null)
{
status.code = 404;
status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not found";
status.redirect = true;
break script;
}
+
+ // locate parent
+ if (node.id == cmis.defaultRootFolder.id)
+ {
+ status.code = 404;
+ status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " parent not found";
+ status.redirect = true;
+ break script;
+ }
+ model.node = node.parent;
// property filter
model.filter = args[cmis.ARG_FILTER];
@@ -22,9 +32,4 @@ script:
// include allowable actions
var includeAllowableActions = args[cmis.ARG_INCLUDE_ALLOWABLE_ACTIONS];
model.includeAllowableActions = (includeAllowableActions == "true" ? true : false);
-
- // retrieve parent
- var returnToRoot = args[cmis.ARG_RETURN_TO_ROOT];
- model.returnToRoot = returnToRoot == "true" ? true : false;
- model.rootNode = cmis.defaultRootFolder;
}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.atomfeed.ftl
index 5713ff4997..8e855c7174 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.atomfeed.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.atomfeed.ftl
@@ -9,17 +9,11 @@
[@feedLib.node node "parents"/]
-[@parent node.parent returnToRoot/]
+
+[#if parent?? && parent.isContainer]
+ [@entryLib.folder node=parent propfilter=filter includeallowableactions=includeAllowableActions includerelationships="none"/]
+[/#if]
[/#compress]
-
-[#macro parent node recurse=false]
-[#if node?exists && node.isContainer]
- [@entryLib.folder node=node propfilter=filter includeallowableactions=includeAllowableActions includerelationships="none"/]
- [#if recurse && node.id != rootNode.id]
- [@parent node.parent true/]
- [/#if]
-[/#if]
-[/#macro]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.desc.xml
index df4a71e423..6403c55b84 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.desc.xml
@@ -23,7 +23,6 @@ If “includeAllowableActions” is TRUE, the repository will return the allowab
"IncludeRelationships" indicates whether relationships are also returned for each returned object. If it is set to "source" or "target", relationships for which the returned object is a source, or respectively a target, will also be returned. If it is set to "both", relationships for which the returned object is either a source or a target will be returned. If it is set to "none", relationships are not returned.
]]>
-
/api/node/{store_type}/{store_id}/{id}/parents?filter={filter?}&includeAllowableActions={includeAllowableActions?}
/api/path/{store_type}/{store_id}/{id}/parents?filter={filter?}&includeAllowableActions={includeAllowableActions?}
guest
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.js
index 84e7f8226e..d7375179b7 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/parents.get.js
@@ -3,8 +3,8 @@ script:
// locate node
var pathSegments = url.match.split("/");
var reference = [ url.templateArgs.store_type, url.templateArgs.store_id ].concat(url.templateArgs.id.split("/"));
- model.node = cmis.findNode(pathSegments[2], reference);
- if (model.node === null)
+ var node = cmis.findNode(pathSegments[2], reference);
+ if (node === null)
{
status.code = 404;
status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not found";
@@ -12,20 +12,18 @@ script:
break script;
}
+ // locate parent
+ model.node = node;
+ model.parent = node.parent;
+
// property filter
model.filter = args[cmis.ARG_FILTER];
if (model.filter === null)
{
model.filter = "*";
}
-
+
// include allowable actions
var includeAllowableActions = args[cmis.ARG_INCLUDE_ALLOWABLE_ACTIONS];
model.includeAllowableActions = (includeAllowableActions == "true" ? true : false);
-
- // TODO: check returnToRoot is required for getDocumentParents
- // retrieve parent
- var returnToRoot = args[cmis.ARG_RETURN_TO_ROOT];
- model.returnToRoot = returnToRoot == "true" ? true : false;
- model.rootNode = cmis.defaultRootFolder;
}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.patch.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.patch.atom.js
index a747cee700..85ed1908e4 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.patch.atom.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.patch.atom.js
@@ -1,3 +1,4 @@
+
script:
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.put.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.put.atom.js
index 5bffabf360..662d93288c 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.put.atom.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/pwc.put.atom.js
@@ -1,3 +1,4 @@
+
script:
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.delete.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.delete.js
index 41457a1555..978809783a 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.delete.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.delete.js
@@ -1,3 +1,5 @@
+
+
script:
{
// relationship type
@@ -8,7 +10,7 @@ script:
status.setCode(400, "Relationship type " + relType + " unknown");
break script;
}
- if (model.relTypeDef.baseType.typeId != "relationship")
+ if (model.relTypeDef.baseType.typeId != RELATIONSHIP_TYPE_ID)
{
status.setCode(400, "Type + " + relType + " is not a relationship type");
break script;
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.get.js
index 8ccfc14e6d..ab2f8563e3 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.get.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationship.get.js
@@ -1,3 +1,5 @@
+
+
script:
{
// relationship type
@@ -8,7 +10,7 @@ script:
status.setCode(400, "Relationship type " + relType + " unknown");
break script;
}
- if (model.relTypeDef.baseType.typeId != "relationship")
+ if (model.relTypeDef.baseType.typeId != RELATIONSHIP_TYPE_ID)
{
status.setCode(400, "Type + " + relType + " is not a relationship type");
break script;
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationships.post.atom.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationships.post.atom.js
index b2bea9fab1..25cbf66108 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationships.post.atom.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/relationships.post.atom.js
@@ -1,3 +1,4 @@
+
script:
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.desc.xml
new file mode 100644
index 0000000000..21e41b0075
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.desc.xml
@@ -0,0 +1,10 @@
+
+ Delete tree (deleteTree)
+
+
+ /api/node/{store_type}/{store_id}/{id}/tree?continueOnFailure={continueOnFailure?}&unfileMultiFiledDocuments={unfileMultiFiledDocuments}
+ /api/path/{store_type}/{store_id}/{id}/tree?continueOnFailure={continueOnFailure?}&unfileMultiFiledDocuments={unfileMultiFiledDocuments}
+ user
+
+ CMIS
+
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.js
new file mode 100644
index 0000000000..4422fb1862
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.js
@@ -0,0 +1,38 @@
+script:
+{
+ // locate node
+ var pathSegments = url.match.split("/");
+ var reference = [ url.templateArgs.store_type, url.templateArgs.store_id ].concat(url.templateArgs.id.split("/"));
+ var node = cmis.findNode(pathSegments[2], reference);
+ if (node === null)
+ {
+ status.code = 404;
+ status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not found";
+ status.redirect = true;
+ break script;
+ }
+
+ // NOTE: Ignore continueOnDelete as complete tree is deleted in single transaction
+ // TODO: Throw error on invalid unfileMultiFiledDocuments error
+
+ if (!node.hasPermission("Delete"))
+ {
+ status.code = 403;
+ status.message = "Permission to delete is denied";
+ status.redirect = true;
+ break script;
+ }
+
+ // TODO: Checked-out documents - are they automatically cancelled?
+
+ if (!node.remove())
+ {
+ status.code = 500;
+ status.message = "Failed to delete node " + pathSegments[2] + " " + reference.join("/");
+ status.redirect = true;
+ break script;
+ }
+
+ status.code = 204; // Success, but no response content
+ status.redirect = true;
+}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.atomfeed.ftl
new file mode 100644
index 0000000000..8349964ee5
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.atomfeed.ftl
@@ -0,0 +1,20 @@
+[#ftl]
+[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
+[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
+[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
+[#compress]
+
+
+
+
+[@feedLib.node node "tree"/]
+
+[#if depth > 0 || depth == -1]
+[#list cmischildren(node, "folders") as child]
+ [@entryLib.foldertree node=child propfilter=propFilter includeallowableactions=includeAllowableActions includerelationships=false maxdepth=depth/]
+[/#list]
+[/#if]
+
+
+
+[/#compress]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.desc.xml
new file mode 100644
index 0000000000..00a4d11f9c
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.desc.xml
@@ -0,0 +1,11 @@
+
+ Retrieve folder tree (getFolderTree)
+
+
+ /api/node/{store_type}/{store_id}/{id}/tree?filter={filter?}&depth={depth?}&includeAllowableActions={includeAllowableActions?}
+ /api/path/{store_type}/{store_id}/{id}/tree?filter={filter?}&depth={depth?}&includeAllowableActions={includeAllowableActions?}
+ guest
+
+ argument
+ CMIS
+
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.js
new file mode 100644
index 0000000000..1a4fa85236
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.js
@@ -0,0 +1,37 @@
+script:
+{
+ // locate node
+ var pathSegments = url.match.split("/");
+ var reference = [ url.templateArgs.store_type, url.templateArgs.store_id ].concat(url.templateArgs.id.split("/"));
+ model.node = cmis.findNode(pathSegments[2], reference);
+ if (model.node === null)
+ {
+ status.code = 404;
+ status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not found";
+ status.redirect = true;
+ break script;
+ }
+
+ if (model.node.isDocument)
+ {
+ status.code = 404;
+ status.message = "Repository " + pathSegments[2] + " " + reference.join("/") + " not a folder";
+ status.redirect = true;
+ break script;
+ }
+
+ // property filter
+ model.filter = args[cmis.ARG_FILTER];
+ if (model.filter === null)
+ {
+ model.filter = "*";
+ }
+
+ // depth
+ var depth = args[cmis.ARG_DEPTH];
+ model.depth = (depth === null) ? 1 : parseInt(depth);
+
+ // include allowable actions
+ var includeAllowableActions = args[cmis.ARG_INCLUDE_ALLOWABLE_ACTIONS];
+ model.includeAllowableActions = (includeAllowableActions == "true" ? true : false);
+}
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/type.get.atomentry.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/type.get.atomentry.ftl
index 346575b2fd..bc40d88453 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/type.get.atomentry.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/type.get.atomentry.ftl
@@ -5,6 +5,6 @@
[#assign namespace][@nsLib.entryNS/][/#assign]
-[@entryLib.typedef typedef=typedef includeProperties=true includeInheritedProperties=includeInheritedProperties ns=namespace/]
+[@entryLib.typedef typedefn=typedef includeProperties=true includeInheritedProperties=includeInheritedProperties ns=namespace/]
[/#compress]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.atomfeed.ftl
index f1eb3d6dab..3041430ba9 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.atomfeed.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.atomfeed.ftl
@@ -8,12 +8,12 @@
-[@feedLib.generic "urn:uuid:type-${typedef.objectTypeId}-children" "Child types of ${typedef.objectTypeId}" "${person.properties.userName}"]
+[#assign title][#if type = "base"]Base Types[#else]Type ${type}[/#if][/#assign]
+[@feedLib.generic "urn:uuid:types-${type}" "${title}" "${person.properties.userName}"]
[@pagingLib.links cursor/]
[/@feedLib.generic]
[@pagingLib.opensearch cursor/]
-
[#list results as child]
[@entryLib.typedef child returnPropertyDefinitions/]
[/#list]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.desc.xml
index 5f0c5c86dc..649111d86c 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.desc.xml
@@ -2,6 +2,7 @@
Retrieve list of child Types
Retrieve list of all child Types
/api/type/{typeId}/children?includePropertyDefinitions={includePropertyDefinitions?}&skipCount={skipCount?}&maxItems={maxItems?}
+ /api/types?typeId={typeId?}&includePropertyDefinitions={includePropertyDefinitions?}&skipCount={skipCount?}&maxItems={maxItems?}
user
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.js
index 4a6e5ce501..7569eafdf6 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typechildren.get.js
@@ -1,23 +1,37 @@
script:
{
- // query type
- var typeId = url.templateArgs.typeId;
- model.typedef = cmis.queryType(typeId);
- if (model.typedef === null)
- {
- status.code = 404;
- status.message = "Type " + typeId + " not found";
- status.redirect = true;
- break script;
- }
-
- // query type children
var page = paging.createPageOrWindow(args);
- var paged = cmis.queryTypeHierarchy(model.typedef, false, page);
- model.results = paged.results;
- model.cursor = paged.cursor;
+ var typeId = args[cmis.ARG_TYPE_ID];
+ if (typeId === null)
+ {
+ typeId = url.templateArgs[cmis.ARG_TYPE_ID];
+ }
+ if (typeId === null)
+ {
+ // query for base types
+ var paged = cmis.queryTypeChildren(null, page);
+ model.results = paged.results;
+ model.cursor = paged.cursor;
+ model.type = "base";
+ }
+ else
+ {
+ // query a specific type and its children
+ var typedef = cmis.queryType(typeId);
+ if (typedef === null)
+ {
+ status.code = 404;
+ status.message = "Type " + typeId + " not found";
+ status.redirect = true;
+ break script;
+ }
+ var paged = cmis.queryTypeChildren(typedef, page);
+ model.results = paged.results;
+ model.cursor = paged.cursor;
+ model.type = typeId;
+ }
// handle property definitions
var returnPropertyDefinitions = args[cmis.ARG_INCLUDE_PROPERTY_DEFINITIONS];
model.returnPropertyDefinitions = returnPropertyDefinitions == "true" ? true : false;
-}
+}
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.atomfeed.ftl
index 4996cbc742..9c2045b12a 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.atomfeed.ftl
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.atomfeed.ftl
@@ -2,20 +2,26 @@
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
-[#import "/org/alfresco/paging.lib.atom.ftl" as pagingLib/]
[#compress]
-[@feedLib.generic "urn:uuid:type-${typedef.objectTypeId}-descendants" "Descendant types of ${typedef.objectTypeId}" "${person.properties.userName}"]
- [@pagingLib.links cursor/]
-[/@feedLib.generic]
-[@pagingLib.opensearch cursor/]
+[#if depth > 0 || depth == -1]
-[#list results as child]
-[@entryLib.typedef child returnPropertyDefinitions/]
+[#if typedef??]
+[@feedLib.typedef typedefn=typedef kind="descendants" author="${person.properties.userName}"/]
+[#list typedef.getSubTypes(false) as child]
+ [@entryLib.typedef typedefn=child includeProperties=includePropertyDefinitions depth=1 maxdepth=depth/]
[/#list]
+[#else]
+[@feedLib.generic "urn:uuid:types-all" "All Types" "${person.properties.userName}"/]
+[#list basetypes as child]
+ [@entryLib.typedef typedefn=child includeProperties=includePropertyDefinitions depth=1 maxdepth=depth/]
+[/#list]
+[/#if]
+
+[/#if]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.desc.xml
index 31f858d94f..69a73b881b 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.desc.xml
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.desc.xml
@@ -1,7 +1,8 @@
Retrieve list of descendant Types
Retrieve list of all descendant Types
- /api/type/{typeId}/descendants?includePropertyDefinitions={includePropertyDefinitions?}&skipCount={skipCount?}&maxItems={maxItems?}
+ /api/type/{typeId}/descendants?includePropertyDefinitions={includePropertyDefinitions?}&depth={depth?}
+ /api/types/descendants?typeId={typeId?}&includePropertyDefinitions={includePropertyDefinitions?}&depth={depth?}
user
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.js
index 77ae2d34eb..31fd5d3d00 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/typedescendants.get.js
@@ -1,23 +1,37 @@
script:
{
- // query type
- var typeId = url.templateArgs.typeId;
- model.typedef = cmis.queryType(typeId);
- if (model.typedef === null)
+ // extract type
+ var typeId = args[cmis.ARG_TYPE_ID];
+ if (typeId === null)
{
- status.code = 404;
- status.message = "Type " + typeId + " not found";
- status.redirect = true;
- break script;
+ typeId = url.templateArgs[cmis.ARG_TYPE_ID];
+ }
+
+ // descend from root
+ if (typeId === null)
+ {
+ var paged = cmis.queryTypeChildren(null, paging.createUnlimitedPage());
+ model.basetypes = paged.results;
+ }
+ else
+ {
+ // query a specific type
+ var typedef = cmis.queryType(typeId);
+ if (typedef === null)
+ {
+ status.code = 404;
+ status.message = "Type " + typeId + " not found";
+ status.redirect = true;
+ break script;
+ }
+ model.typedef = typedef;
}
- // query type descendants
- var page = paging.createPageOrWindow(args);
- var paged = cmis.queryTypeHierarchy(model.typedef, true, page);
- model.results = paged.results;
- model.cursor = paged.cursor;
+ // depth
+ var depth = args[cmis.ARG_DEPTH];
+ model.depth = (depth === null) ? 1 : parseInt(depth);
// handle property definitions
- var returnPropertyDefinitions = args[cmis.ARG_INCLUDE_PROPERTY_DEFINITIONS];
- model.returnPropertyDefinitions = returnPropertyDefinitions == "true" ? true : false;
-}
+ var includePropertyDefinitions = args[cmis.ARG_INCLUDE_PROPERTY_DEFINITIONS];
+ model.includePropertyDefinitions = includePropertyDefinitions == "true" ? true : false;
+}
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.atomfeed.ftl
deleted file mode 100644
index 6c0f102907..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.atomfeed.ftl
+++ /dev/null
@@ -1,23 +0,0 @@
-[#ftl]
-[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
-[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
-[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
-[#import "/org/alfresco/paging.lib.atom.ftl" as pagingLib/]
-[#compress]
-
-
-
-
-[#assign title][#if type = "all"]All Types[#else]Type ${type}[/#if][/#assign]
-[@feedLib.generic "urn:uuid:types-${type}" "${title}" "${person.properties.userName}"]
- [@pagingLib.links cursor/]
-[/@feedLib.generic]
-[@pagingLib.opensearch cursor/]
-
-[#list results as child]
-[@entryLib.typedef child returnPropertyDefinitions/]
-[/#list]
-
-
-
-[/#compress]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.desc.xml
deleted file mode 100644
index 3e880f5a42..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.desc.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
- Retrieve list of all Types (getTypes)
-
-
-
-Inputs:
-
-(Optional) ID typeId: not set (default)
-(Optional) Bool returnPropertyDefinitions: False (default)
-(Optional) int maxItems: 0 = Repository-default number of items (Default)
-(Optional) int skipCount: 0 = start (Default)
-
-Outputs:
-
-Result Set - List of types
-Boolean hasMoreItems
-The type attributes of each type will be returned
-The property definitions of each type will be returned if returnPropertyDefinitions is TRUE.
-
-Notes:
-
-A repository may support a hierarchy of types but CMIS will return them as a flat list.
-If provided, the input parameter “TypeId” specifies to only return the specific Object Type and its descendants. If not provided, all Object Types are to be returned.
-If no “maxItems” value is provided, then the Repository will determine an appropriate number of items to return. How the Repository determines this value is repository-specific and opaque to CMIS.
-If “returnPropertyDefinitions” is False, then the Repository will return only the “Attributes” of the Object Type Definition as specified in the “Object Type” section of the Data Model. Otherwise, property definitions will also be returned for each object type.
-]]>
-
- /api/types?type={type?}&includePropertyDefinitions={includePropertyDefinitions?}&skipCount={skipCount?}&maxItems={maxItems?}
- user
-
-
- CMIS
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.js
deleted file mode 100644
index d8af28258a..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.js
+++ /dev/null
@@ -1,36 +0,0 @@
-script:
-{
- // process paging
- var page = paging.createPageOrWindow(args);
-
- // query types
- var typeId = args[cmis.ARG_TYPE];
- if (typeId === null)
- {
- // query all types
- var paged = cmis.queryTypes(page);
- model.results = paged.results;
- model.cursor = paged.cursor;
- model.type = "all";
- }
- else
- {
- // query a specific type and its descendants
- var typedef = cmis.queryType(typeId);
- if (typedef === null)
- {
- status.code = 404;
- status.message = "Type " + typeId + " not found";
- status.redirect = true;
- break script;
- }
- var paged = cmis.queryTypeHierarchy(typedef, true, page);
- model.results = paged.results;
- model.cursor = paged.cursor;
- model.type = typeId;
- }
-
- // handle property definitions
- var returnPropertyDefinitions = args[cmis.ARG_INCLUDE_PROPERTY_DEFINITIONS];
- model.returnPropertyDefinitions = (returnPropertyDefinitions == "true" ? true : false);
-}
diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml
index 2966ff5f00..0647510c21 100644
--- a/config/alfresco/web-scripts-application-context.xml
+++ b/config/alfresco/web-scripts-application-context.xml
@@ -102,6 +102,9 @@