From c9facc3e783b52ca891de341eb0e88b500b64f75 Mon Sep 17 00:00:00 2001 From: David Caruana Date: Thu, 29 Oct 2009 16:19:15 +0000 Subject: [PATCH] Merged CMIS063 to HEAD 15242: 0.62c update: Abdera extension / AtomPub tests passing (except query) 15277: 0.62c upgrade: AtomPub resources/links refactor 15290: 0.62c Upgrade: AtomPub resource/link compliance. Updated Test client / Custom Type test client / Abdera extension. 15293: 0.62 final Upgrade: Introduce schemas and examples 15318: 0.62 final upgrade: AtomPub server and tests updated 15321: Fixes for CMIS custom model tests. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17229 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/cmis/atomentry.lib.atom.ftl | 377 ++++++++----- .../org/alfresco/cmis/atomentry.lib.js | 41 +- .../org/alfresco/cmis/atomfeed.lib.atom.ftl | 22 +- .../org/alfresco/cmis/constants.lib.js | 14 + .../org/alfresco/cmis/ns.lib.atom.ftl | 6 +- .../repository/repository.get.atom.ftl | 31 +- ...owableactions.get.cmisallowableactions.ftl | 5 +- .../store/allowableactions.get.desc.xml | 4 +- .../store/checkedout.post.atomentry.js | 2 +- .../repository/store/children.post.atom.js | 1 + .../repository/store/descendants.post.atom.js | 40 -- .../store/descendants.post.atomentry.201.ftl | 16 - .../store/descendants.post.desc.xml | 49 -- .../repository/store/descendants.post.js | 9 - .../repository/store/item.get.desc.xml | 4 +- .../repository/store/item.patch.atom.js | 1 + .../repository/store/item.put.atom.js | 1 + .../repository/store/parent.get.atomentry.ftl | 11 + .../repository/store/parent.get.atomfeed.ftl | 25 - .../repository/store/parent.get.desc.xml | 30 +- .../alfresco/repository/store/parent.get.js | 19 +- .../repository/store/parents.get.atomfeed.ftl | 14 +- .../repository/store/parents.get.desc.xml | 1 - .../alfresco/repository/store/parents.get.js | 16 +- .../repository/store/pwc.patch.atom.js | 1 + .../alfresco/repository/store/pwc.put.atom.js | 1 + .../repository/store/relationship.delete.js | 4 +- .../repository/store/relationship.get.js | 4 +- .../store/relationships.post.atom.js | 1 + .../repository/store/tree.delete.desc.xml | 10 + .../alfresco/repository/store/tree.delete.js | 38 ++ .../repository/store/tree.get.atomfeed.ftl | 20 + .../repository/store/tree.get.desc.xml | 11 + .../org/alfresco/repository/store/tree.get.js | 37 ++ .../repository/store/type.get.atomentry.ftl | 2 +- .../store/typechildren.get.atomfeed.ftl | 4 +- .../store/typechildren.get.desc.xml | 1 + .../repository/store/typechildren.get.js | 46 +- .../store/typedescendants.get.atomfeed.ftl | 20 +- .../store/typedescendants.get.desc.xml | 3 +- .../repository/store/typedescendants.get.js | 46 +- .../repository/store/types.get.atomfeed.ftl | 23 - .../repository/store/types.get.desc.xml | 34 -- .../alfresco/repository/store/types.get.js | 36 -- .../web-scripts-application-context.xml | 3 + .../repo/cmis/rest/CMISConstantsFactory.java | 70 +++ .../alfresco/repo/cmis/rest/CMISScript.java | 62 +-- .../cmis/rest/CMISTypeDefinitionMethod.java | 5 +- .../cmis/rest/test/BaseCMISWebScriptTest.java | 75 ++- .../cmis/rest/test/BulkCreateSystemTest.java | 10 +- .../cmis/rest/test/CMISCustomTypeTest.java | 64 +-- .../repo/cmis/rest/test/CMISTest.java | 317 ++++++----- .../checkinandupdatedocument.atomentry.xml | 4 +- .../rest/test/checkindocument.atomentry.xml | 2 +- .../test/createcustomdocument.atomentry.xml | 12 +- .../test/createcustomfolder.atomentry.xml | 10 +- .../rest/test/createdocument.atomentry.xml | 8 +- .../rest/test/createdocument2.atomentry.xml | 10 +- .../test/createdocumentBase64.atomentry.xml | 8 +- .../createdocumentNoContent.atomentry.xml | 8 +- .../cmis/rest/test/createfolder.atomentry.xml | 8 +- .../test/createrelationship.atomentry.xml | 10 +- .../rest/test/updateatomentry.atomentry.xml | 72 --- .../test/updatecustomdocument.atomentry.xml | 10 +- .../rest/test/updatedocument.atomentry.xml | 2 +- .../org/alfresco/repo/cmis/rest/xsd/APP.xsd | 4 +- .../org/alfresco/repo/cmis/rest/xsd/ATOM.xsd | 89 ++-- .../alfresco/repo/cmis/rest/xsd/CMIS-Core.xsd | 501 +++++++++--------- .../repo/cmis/rest/xsd/CMIS-RestAtom.xsd | 143 ++++- .../rest/xsd/examples/AllowableActions.xml | 2 +- .../repo/cmis/rest/xsd/examples/ChangeLog.xml | 268 +++++----- .../cmis/rest/xsd/examples/DocumentEntry.xml | 80 +-- .../rest/xsd/examples/DocumentEntryPWC.xml | 88 +-- .../xsd/examples/DocumentEntryWithChanges.xml | 82 +-- .../cmis/rest/xsd/examples/FolderChildren.xml | 260 ++++----- .../rest/xsd/examples/FolderDescendants.xml | 380 ++++++------- .../cmis/rest/xsd/examples/FolderEntry.xml | 58 +- .../cmis/rest/xsd/examples/PolicyEntry.xml | 50 +- .../repo/cmis/rest/xsd/examples/Query.xml | 1 + .../rest/xsd/examples/RelationshipEntry.xml | 50 +- .../repo/cmis/rest/xsd/examples/Service.xml | 8 +- .../rest/xsd/examples/TypeDocumentWith.xml | 325 +++++++----- .../rest/xsd/examples/TypeDocumentWithout.xml | 10 +- .../cmis/rest/xsd/examples/TypeFolderWith.xml | 80 +-- .../rest/xsd/examples/TypeFolderWithout.xml | 12 +- .../xsd/examples/TypeRelationshipWith.xml | 62 ++- .../xsd/examples/TypeRelationshipWithout.xml | 12 +- .../test-resources/cmis/cmis-api-context.xml | 2 +- 88 files changed, 2398 insertions(+), 2020 deletions(-) delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atom.js delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.atomentry.201.ftl delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.desc.xml delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/descendants.post.js create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomentry.ftl delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/parent.get.atomfeed.ftl create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.desc.xml create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.delete.js create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.atomfeed.ftl create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.desc.xml create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/tree.get.js delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.atomfeed.ftl delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.desc.xml delete mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/store/types.get.js create mode 100644 source/java/org/alfresco/repo/cmis/rest/CMISConstantsFactory.java delete mode 100644 source/java/org/alfresco/repo/cmis/rest/test/updateatomentry.atomentry.xml 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 @@ + + + diff --git a/source/java/org/alfresco/repo/cmis/rest/CMISConstantsFactory.java b/source/java/org/alfresco/repo/cmis/rest/CMISConstantsFactory.java new file mode 100644 index 0000000000..4b421078c1 --- /dev/null +++ b/source/java/org/alfresco/repo/cmis/rest/CMISConstantsFactory.java @@ -0,0 +1,70 @@ +/* + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * Copyright (C) 2005-2008 Alfresco Software Limited. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.repo.cmis.rest; + +import org.alfresco.abdera.ext.cmis.CMISConstants; +import org.springframework.beans.factory.FactoryBean; + +import freemarker.ext.beans.BeansWrapper; +import freemarker.template.TemplateHashModel; + + +/** + * CMISConstants factory for allowing use of constants in Freemarker + */ +public class CMISConstantsFactory implements FactoryBean +{ + + /* + * (non-Javadoc) + * @see org.springframework.beans.factory.FactoryBean#getObject() + */ + public Object getObject() + throws Exception + { + BeansWrapper wrapper = BeansWrapper.getDefaultInstance(); + TemplateHashModel staticModels = wrapper.getStaticModels(); + return staticModels.get(CMISConstants.class.getName()); + } + + /* + * (non-Javadoc) + * @see org.springframework.beans.factory.FactoryBean#getObjectType() + */ + public Class getObjectType() + { + return TemplateHashModel.class; + } + + /* + * (non-Javadoc) + * @see org.springframework.beans.factory.FactoryBean#isSingleton() + */ + public boolean isSingleton() + { + return true; + } + +} diff --git a/source/java/org/alfresco/repo/cmis/rest/CMISScript.java b/source/java/org/alfresco/repo/cmis/rest/CMISScript.java index d5b85a029b..dae6f1cfaf 100644 --- a/source/java/org/alfresco/repo/cmis/rest/CMISScript.java +++ b/source/java/org/alfresco/repo/cmis/rest/CMISScript.java @@ -87,7 +87,6 @@ public class CMISScript extends BaseScopableProcessorExtension public static final String ARG_REMOVE_FROM = "removeFrom"; public static final String ARG_RELATIONSHIP_TYPE = "relationshipType"; public static final String ARG_REPOSITORY_ID = "repositoryId"; - public static final String ARG_RETURN_TO_ROOT = "returnToRoot"; public static final String ARG_RETURN_VERSION = "returnVersion"; public static final String ARG_SKIP_COUNT = "skipCount"; public static final String ARG_THIS_VERSION = "thisVersion"; @@ -390,20 +389,21 @@ public class CMISScript extends BaseScopableProcessorExtension PagedResults results = paging.createPagedResults(nodes, cursor); return results; } - + /** - * Query for all Type Definitions + * Query for child types (of a given type), or the base types (if no type given) * + * @param typeDef * @param page - * @return paged result set of types + * @return */ - public PagedResults queryTypes(Page page) + public PagedResults queryTypeChildren(CMISTypeDefinition typeDef, Page page) { - Collection typeDefs = cmisDictionaryService.getAllTypes(); - Cursor cursor = paging.createCursor(typeDefs.size(), page); + Collection children = (typeDef == null) ? cmisDictionaryService.getBaseTypes() : typeDef.getSubTypes(false); + Cursor cursor = paging.createCursor(children.size(), page); // skip - Iterator iterTypeDefs = typeDefs.iterator(); + Iterator iterTypeDefs = children.iterator(); for (int i = 0; i < cursor.getStartRow(); i++) { iterTypeDefs.next(); @@ -419,35 +419,35 @@ public class CMISScript extends BaseScopableProcessorExtension PagedResults results = paging.createPagedResults(types, cursor); return results; } - + /** * Query for all Type Definitions in a type hierarchy * * @param page * @return paged result set of types */ - public PagedResults queryTypeHierarchy(CMISTypeDefinition typeDef, boolean descendants, Page page) - { - Collection subTypes = typeDef.getSubTypes(descendants); - Cursor cursor = paging.createCursor(subTypes.size(), page); - - // skip - Iterator iterSubTypes = subTypes.iterator(); - for (int i = 0; i < cursor.getStartRow(); i++) - { - iterSubTypes.next(); - } - - // get types for page - CMISTypeDefinition[] types = new CMISTypeDefinition[cursor.getRowCount()]; - for (int i = cursor.getStartRow(); i <= cursor.getEndRow(); i++) - { - types[i - cursor.getStartRow()] = iterSubTypes.next(); - } - - PagedResults results = paging.createPagedResults(types, cursor); - return results; - } +// public PagedResults queryTypeHierarchy(CMISTypeDefinition typeDef, boolean descendants, Page page) +// { +// Collection subTypes = typeDef.getSubTypes(descendants); +// Cursor cursor = paging.createCursor(subTypes.size(), page); +// +// // skip +// Iterator iterSubTypes = subTypes.iterator(); +// for (int i = 0; i < cursor.getStartRow(); i++) +// { +// iterSubTypes.next(); +// } +// +// // get types for page +// CMISTypeDefinition[] types = new CMISTypeDefinition[cursor.getRowCount()]; +// for (int i = cursor.getStartRow(); i <= cursor.getEndRow(); i++) +// { +// types[i - cursor.getStartRow()] = iterSubTypes.next(); +// } +// +// PagedResults results = paging.createPagedResults(types, cursor); +// return results; +// } /** * Query for a Type Definition given a CMIS Type Id diff --git a/source/java/org/alfresco/repo/cmis/rest/CMISTypeDefinitionMethod.java b/source/java/org/alfresco/repo/cmis/rest/CMISTypeDefinitionMethod.java index 1188907da9..cfdd91fed7 100644 --- a/source/java/org/alfresco/repo/cmis/rest/CMISTypeDefinitionMethod.java +++ b/source/java/org/alfresco/repo/cmis/rest/CMISTypeDefinitionMethod.java @@ -29,7 +29,6 @@ import java.util.List; import org.alfresco.cmis.CMISDictionaryService; import org.alfresco.cmis.CMISScope; import org.alfresco.cmis.CMISTypeDefinition; -import org.alfresco.cmis.mapping.CMISMapping; import org.alfresco.repo.template.TemplateAssociation; import org.alfresco.repo.template.TemplateNode; import org.alfresco.service.namespace.QName; @@ -94,6 +93,10 @@ public class CMISTypeDefinitionMethod implements TemplateMethodModelEx { nodeType = (QName)wrapped; } + else if (wrapped instanceof CMISTypeDefinition) + { + result = ((CMISTypeDefinition)wrapped).getBaseType(); + } } // convert to CMIS type diff --git a/source/java/org/alfresco/repo/cmis/rest/test/BaseCMISWebScriptTest.java b/source/java/org/alfresco/repo/cmis/rest/test/BaseCMISWebScriptTest.java index f0b02d1d96..3ffa0d39f5 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/BaseCMISWebScriptTest.java +++ b/source/java/org/alfresco/repo/cmis/rest/test/BaseCMISWebScriptTest.java @@ -34,6 +34,7 @@ import java.util.List; import java.util.Map; import javax.activation.MimeType; +import javax.activation.MimeTypeParseException; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.dom.DOMSource; import javax.xml.validation.Validator; @@ -444,6 +445,70 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest return rootHREF; } + protected Link getLink(Entry entry, String rel, String... matchesMimetypes) + { + List links = entry.getLinks(rel); + if (links != null) + { + for (Link link : links) + { + MimeType mimetype = link.getMimeType(); + if (matchesMimetypes.length == 0) + { + if (links.size() == 1) + { + // take the single link regardless of type + return link; + } + else if (mimetype == null) + { + // take the link if it doesn't have a type + return link; + } + } + for (String matchesMimetype : matchesMimetypes) + { + try + { + if (mimetype != null && mimetype.match(matchesMimetype)) + { + return link; + } + } + catch (MimeTypeParseException e) + { + // note: not a match + } + } + } + } + return null; + } + + protected Link getChildrenLink(Entry entry) + { + return getLink(entry, CMISConstants.REL_DOWN, CMISConstants.MIMETYPE_FEED); + } + + protected Link getDescendantsLink(Entry entry) + { + return getLink(entry, CMISConstants.REL_DOWN, CMISConstants.MIMETYPE_CMISTREE); + } + + protected Link getFolderTreeLink(Entry entry) + { + return getLink(entry, CMISConstants.REL_FOLDER_TREE, CMISConstants.MIMETYPE_CMISTREE); + } + + protected Link getObjectParentsLink(Entry entry) + { + return getLink(entry, CMISConstants.REL_UP, CMISConstants.MIMETYPE_FEED); + } + + protected Link getFolderParentLink(Entry entry) + { + return getLink(entry, CMISConstants.REL_UP, CMISConstants.MIMETYPE_ENTRY); + } protected Entry createFolder(IRI parent, String name) throws Exception @@ -464,7 +529,7 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest assertEquals(name, entry.getTitle()); //assertEquals(name + " (summary)", entry.getSummary()); CMISObject object = entry.getExtension(CMISConstants.OBJECT); - assertEquals("folder", object.getBaseType().getStringValue()); + assertEquals(CMISConstants.TYPE_FOLDER, object.getBaseTypeId().getStringValue()); String testFolderHREF = (String)res.getHeader("Location"); assertNotNull(testFolderHREF); return entry; @@ -495,7 +560,7 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest //assertEquals(name + " (summary)", entry.getSummary()); assertNotNull(entry.getContentSrc()); CMISObject object = entry.getExtension(CMISConstants.OBJECT); - assertEquals("document", object.getBaseType().getStringValue()); + assertEquals(CMISConstants.TYPE_DOCUMENT, object.getBaseTypeId().getStringValue()); String testFileHREF = (String)res.getHeader("Location"); assertNotNull(testFileHREF); return entry; @@ -519,7 +584,7 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest Entry entry = abdera.parseEntry(new StringReader(xml), null); assertNotNull(entry); CMISObject object = entry.getExtension(CMISConstants.OBJECT); - assertEquals("relationship", object.getBaseType().getStringValue()); + assertEquals(CMISConstants.TYPE_RELATIONSHIP, object.getBaseTypeId().getStringValue()); assertEquals(targetId, object.getTargetId().getStringValue()); String testFileHREF = (String)res.getHeader("Location"); assertNotNull(testFileHREF); @@ -574,7 +639,7 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest throws Exception { Entry testRootFolder = getTestRootFolder(); - Link testsChildrenLink = testRootFolder.getLink(CMISConstants.REL_CHILDREN); + Link testsChildrenLink = getChildrenLink(testRootFolder); return createFolder(testsChildrenLink.getHref(), "Test Run " + System.currentTimeMillis()); } @@ -582,7 +647,7 @@ public class BaseCMISWebScriptTest extends BaseWebScriptTest throws Exception { Entry testRunFolder = getTestRunFolder(); - Link childrenLink = testRunFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testRunFolder); assertNotNull(childrenLink); Entry testFolder = createFolder(childrenLink.getHref(), name + " " + System.currentTimeMillis()); return testFolder; diff --git a/source/java/org/alfresco/repo/cmis/rest/test/BulkCreateSystemTest.java b/source/java/org/alfresco/repo/cmis/rest/test/BulkCreateSystemTest.java index bf3a61aa4e..bd5cb865f4 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/BulkCreateSystemTest.java +++ b/source/java/org/alfresco/repo/cmis/rest/test/BulkCreateSystemTest.java @@ -79,10 +79,10 @@ public class BulkCreateSystemTest CMISObject cmisObject = entry.addExtension(CMISConstants.OBJECT); CMISProperties properties = cmisObject.addExtension(CMISConstants.PROPERTIES); - CMISProperty property = properties.addExtension(CMISConstants.PROPERTY_STRING); - property.setAttributeValue(CMISConstants.PROPERTY_NAME, CMISConstants.PROP_OBJECT_TYPE_ID); + CMISProperty property = properties.addExtension(CMISConstants.ID_PROPERTY); + property.setAttributeValue(CMISConstants.PROPERTY_ID, CMISConstants.PROP_OBJECT_TYPE_ID); Element value = property.addExtension(CMISConstants.PROPERTY_VALUE); - value.setText("folder"); + value.setText("cmis:Folder"); ClientResponse resp = client.post(parent, entry); @@ -116,8 +116,8 @@ public class BulkCreateSystemTest CMISObject cmisObject = entry.addExtension(CMISConstants.OBJECT); CMISProperties properties = cmisObject.addExtension(CMISConstants.PROPERTIES); - CMISProperty property = properties.addExtension(CMISConstants.PROPERTY_STRING); - property.setAttributeValue(CMISConstants.PROPERTY_NAME, CMISConstants.PROP_OBJECT_TYPE_ID); + CMISProperty property = properties.addExtension(CMISConstants.ID_PROPERTY); + property.setAttributeValue(CMISConstants.PROPERTY_ID, CMISConstants.PROP_OBJECT_TYPE_ID); Element value = property.addExtension(CMISConstants.PROPERTY_VALUE); value.setText("document"); diff --git a/source/java/org/alfresco/repo/cmis/rest/test/CMISCustomTypeTest.java b/source/java/org/alfresco/repo/cmis/rest/test/CMISCustomTypeTest.java index 70f0210c5c..f28af386fe 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/CMISCustomTypeTest.java +++ b/source/java/org/alfresco/repo/cmis/rest/test/CMISCustomTypeTest.java @@ -82,7 +82,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testCreateCustomFolder"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -93,8 +93,8 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(entriesBefore +1, entriesAfter); Entry entry = feedFolderAfter.getEntry(folder.getId().toString()); CMISObject object = entry.getExtension(CMISConstants.OBJECT); - assertEquals("F/cmiscustom_folder", object.getObjectTypeId().getStringValue()); - CMISProperty customProp = object.getProperties().find("cmiscustom_folderprop_string"); + assertEquals("F/cmiscustom:folder", object.getObjectTypeId().getStringValue()); + CMISProperty customProp = object.getProperties().find("cmiscustom:folderprop_string"); assertNotNull(customProp); assertEquals("custom string", customProp.getStringValue()); } @@ -103,7 +103,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testCreateCustomDocument"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -114,11 +114,11 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(entriesBefore +1, entriesAfter); Entry entry = feedFolderAfter.getEntry(document.getId().toString()); CMISObject object = entry.getExtension(CMISConstants.OBJECT); - assertEquals("D/cmiscustom_document", object.getObjectTypeId().getStringValue()); - CMISProperty customProp = object.getProperties().find("cmiscustom_docprop_string"); + assertEquals("D/cmiscustom:document", object.getObjectTypeId().getStringValue()); + CMISProperty customProp = object.getProperties().find("cmiscustom:docprop_string"); assertNotNull(customProp); assertEquals("custom string", customProp.getStringValue()); - CMISProperty multiProp = object.getProperties().find("cmiscustom_docprop_boolean_multi"); + CMISProperty multiProp = object.getProperties().find("cmiscustom:docprop_boolean_multi"); assertNotNull(multiProp); List multiValues = multiProp.getNativeValues(); assertNotNull(multiValues); @@ -132,7 +132,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest { // retrieve test folder for update Entry testFolder = createTestFolder("testUpdatePatchCustomDocument"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for update Entry document = createDocument(childrenLink.getHref(), "testUpdatePatchCustomDocument", "/org/alfresco/repo/cmis/rest/test/createcustomdocument.atomentry.xml"); @@ -151,11 +151,11 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(document.getPublished(), updated.getPublished()); assertEquals("Updated Title " + guid, updated.getTitle()); CMISObject object = updated.getExtension(CMISConstants.OBJECT); - assertEquals("D/cmiscustom_document", object.getObjectTypeId().getStringValue()); - CMISProperty customProp = object.getProperties().find("cmiscustom_docprop_string"); + assertEquals("D/cmiscustom:document", object.getObjectTypeId().getStringValue()); + CMISProperty customProp = object.getProperties().find("cmiscustom:docprop_string"); assertNotNull(customProp); assertEquals("custom " + guid, customProp.getStringValue()); - CMISProperty multiProp = object.getProperties().find("cmiscustom_docprop_boolean_multi"); + CMISProperty multiProp = object.getProperties().find("cmiscustom:docprop_boolean_multi"); assertNotNull(multiProp); List multiValues = multiProp.getNativeValues(); assertNotNull(multiValues); @@ -169,7 +169,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest { // retrieve test folder for update Entry testFolder = createTestFolder("testUpdatePutCustomDocument"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for update Entry document = createDocument(childrenLink.getHref(), "testUpdatePutCustomDocument", "/org/alfresco/repo/cmis/rest/test/createcustomdocument.atomentry.xml"); @@ -188,11 +188,11 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(document.getPublished(), updated.getPublished()); assertEquals("Updated Title " + guid, updated.getTitle()); CMISObject object = updated.getExtension(CMISConstants.OBJECT); - assertEquals("D/cmiscustom_document", object.getObjectTypeId().getStringValue()); - CMISProperty customProp = object.getProperties().find("cmiscustom_docprop_string"); + assertEquals("D/cmiscustom:document", object.getObjectTypeId().getStringValue()); + CMISProperty customProp = object.getProperties().find("cmiscustom:docprop_string"); assertNotNull(customProp); assertEquals("custom " + guid, customProp.getStringValue()); - CMISProperty multiProp = object.getProperties().find("cmiscustom_docprop_boolean_multi"); + CMISProperty multiProp = object.getProperties().find("cmiscustom:docprop_boolean_multi"); assertNotNull(multiProp); List multiValues = multiProp.getNativeValues(); assertNotNull(multiValues); @@ -206,7 +206,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest { // retrieve test folder for deletes Entry testFolder = createTestFolder("testDeleteCustom"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); Feed children = getFeed(childrenLink.getHref()); int entriesBefore = children.getEntries().size(); @@ -241,7 +241,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest // retrieve test folder for query Entry testFolder = createTestFolder("testQueryCustom"); CMISObject testFolderObject = testFolder.getExtension(CMISConstants.OBJECT); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create documents to query // Standard root document @@ -287,10 +287,10 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(document2Object.getObjectTypeId().getStringValue(), result1.getObjectTypeId().getStringValue()); CMISProperties result1properties = result1.getProperties(); assertNotNull(result1properties); - CMISProperty result1property = result1properties.find("cmiscustom_docprop_string"); + CMISProperty result1property = result1properties.find("cmiscustom:docprop_string"); assertNotNull(result1property); assertEquals("custom string", result1property.getStringValue()); - CMISProperty result1multiproperty = result1properties.find("cmiscustom_docprop_boolean_multi"); + CMISProperty result1multiproperty = result1properties.find("cmiscustom:docprop_boolean_multi"); assertNotNull(result1multiproperty); List result1multiValues = result1multiproperty.getNativeValues(); assertNotNull(result1multiValues); @@ -306,10 +306,10 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(document3Object.getObjectTypeId().getStringValue(), result2.getObjectTypeId().getStringValue()); CMISProperties result2properties = result2.getProperties(); assertNotNull(result2properties); - CMISProperty result2property = result2properties.find("cmiscustom_docprop_string"); + CMISProperty result2property = result2properties.find("cmiscustom:docprop_string"); assertNotNull(result2property); assertEquals("custom string", result2property.getStringValue()); - CMISProperty result2multiproperty = result1properties.find("cmiscustom_docprop_boolean_multi"); + CMISProperty result2multiproperty = result1properties.find("cmiscustom:docprop_boolean_multi"); assertNotNull(result2multiproperty); List result2multiValues = result2multiproperty.getNativeValues(); assertNotNull(result2multiValues); @@ -323,7 +323,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testCreateCustomRelationship"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -344,7 +344,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertNotNull(targetObject); String targetId = targetObject.getObjectId().getStringValue(); assertNotNull(targetId); - Entry rel = createRelationship(relsLink.getHref(), "R/cmiscustom_assoc", targetId); + Entry rel = createRelationship(relsLink.getHref(), "R/cmiscustom:assoc", targetId); assertNotNull(rel); // check created relationship @@ -354,11 +354,11 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertNotNull(sourceId); CMISObject relObject = rel.getExtension(CMISConstants.OBJECT); assertNotNull(relObject); - assertEquals("R/cmiscustom_assoc", relObject.getObjectTypeId().getStringValue()); + assertEquals("R/cmiscustom:assoc", relObject.getObjectTypeId().getStringValue()); assertEquals(sourceId, relObject.getSourceId().getStringValue()); assertEquals(targetId, relObject.getTargetId().getStringValue()); - assertEquals(source.getSelfLink().getHref(), rel.getLink(CMISConstants.REL_SOURCE).getHref()); - assertEquals(target.getSelfLink().getHref(), rel.getLink(CMISConstants.REL_TARGET).getHref()); + assertEquals(source.getSelfLink().getHref(), rel.getLink(CMISConstants.REL_ASSOC_SOURCE).getHref()); + assertEquals(target.getSelfLink().getHref(), rel.getLink(CMISConstants.REL_ASSOC_TARGET).getHref()); // check relationships for created item Map args = new HashMap(); @@ -372,7 +372,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testGetCustomRelationship"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -390,7 +390,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertNotNull(targetObject); String targetId = targetObject.getObjectId().getStringValue(); assertNotNull(targetId); - Entry rel = createRelationship(relsLink.getHref(), "R/cmiscustom_assoc", targetId); + Entry rel = createRelationship(relsLink.getHref(), "R/cmiscustom:assoc", targetId); assertNotNull(rel); // get created relationship @@ -401,15 +401,15 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertEquals(relObject.getObjectTypeId().getStringValue(), relEntryObject.getObjectTypeId().getStringValue()); assertEquals(relObject.getSourceId().getStringValue(), relEntryObject.getSourceId().getStringValue()); assertEquals(relObject.getTargetId().getStringValue(), relEntryObject.getTargetId().getStringValue()); - assertEquals(source.getSelfLink().getHref(), relEntry.getLink(CMISConstants.REL_SOURCE).getHref()); - assertEquals(target.getSelfLink().getHref(), relEntry.getLink(CMISConstants.REL_TARGET).getHref()); + assertEquals(source.getSelfLink().getHref(), relEntry.getLink(CMISConstants.REL_ASSOC_SOURCE).getHref()); + assertEquals(target.getSelfLink().getHref(), relEntry.getLink(CMISConstants.REL_ASSOC_TARGET).getHref()); } public void testDeleteRelationship() throws Exception { Entry testFolder = createTestFolder("testDeleteCustomRelationship"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -430,7 +430,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest assertNotNull(targetObject); String targetId = targetObject.getObjectId().getStringValue(); assertNotNull(targetId); - Entry rel = createRelationship(relsLink.getHref(), "R/cmiscustom_assoc", targetId); + Entry rel = createRelationship(relsLink.getHref(), "R/cmiscustom:assoc", targetId); assertNotNull(rel); // check relationships for created item diff --git a/source/java/org/alfresco/repo/cmis/rest/test/CMISTest.java b/source/java/org/alfresco/repo/cmis/rest/test/CMISTest.java index 9ffd70c894..3db840aad3 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/CMISTest.java +++ b/source/java/org/alfresco/repo/cmis/rest/test/CMISTest.java @@ -25,6 +25,7 @@ package org.alfresco.repo.cmis.rest.test; import java.io.StringReader; +import java.io.StringWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -34,6 +35,7 @@ import java.util.Set; import org.alfresco.abdera.ext.cmis.CMISAllowableAction; import org.alfresco.abdera.ext.cmis.CMISAllowableActions; +import org.alfresco.abdera.ext.cmis.CMISChildren; import org.alfresco.abdera.ext.cmis.CMISConstants; import org.alfresco.abdera.ext.cmis.CMISObject; import org.alfresco.util.GUID; @@ -90,7 +92,7 @@ public class CMISTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testCreateDocument"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -110,7 +112,7 @@ public class CMISTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testCreateAtomEntry"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -130,7 +132,7 @@ public class CMISTest extends BaseCMISWebScriptTest throws Exception { Entry testFolder = createTestFolder("testCreateFolder"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Feed children = getFeed(childrenLink.getHref()); assertNotNull(children); @@ -143,26 +145,6 @@ public class CMISTest extends BaseCMISWebScriptTest assertNotNull(entry); } - public void testCreateDocumentViaDescendants() - throws Exception - { - Entry testFolder = createTestFolder("testCreateDocumentViaDescendants"); - Link descendantsLink = testFolder.getLink(CMISConstants.REL_DESCENDANTS); - assertNotNull(descendantsLink); - Feed descendants = getFeed(descendantsLink.getHref()); - assertNotNull(descendants); - int entriesBefore = descendants.getEntries().size(); - Entry document = createDocument(descendants.getSelfLink().getHref(), "testCreateDocumentViaDescendants"); - Response documentContentRes = sendRequest(new GetRequest(document.getContentSrc().toString()), 200); - String resContent = documentContentRes.getContentAsString(); - assertEquals(document.getTitle(), resContent); - Feed feedFolderAfter = getFeed(descendantsLink.getHref()); - int entriesAfter = feedFolderAfter.getEntries().size(); - assertEquals(entriesBefore +1, entriesAfter); - Entry entry = feedFolderAfter.getEntry(document.getId().toString()); - assertNotNull(entry); - } - public void testGet() throws Exception { @@ -175,7 +157,7 @@ public class CMISTest extends BaseCMISWebScriptTest assertEquals(testFolder.getSummary(), testFolderFromGet.getSummary()); // get document - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry testDocument = createDocument(childrenLink.getHref(), "testGet"); assertNotNull(testDocument); @@ -194,7 +176,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // create multiple children Entry testFolder = createTestFolder("testGetChildren"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry document1 = createDocument(childrenLink.getHref(), "testGetChildren1"); assertNotNull(document1); @@ -229,7 +211,7 @@ public class CMISTest extends BaseCMISWebScriptTest // create multiple children Set docIds = new HashSet(); Entry testFolder = createTestFolder("testGetChildrenPaging"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); for (int i = 0; i < 15; i++) { @@ -273,7 +255,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // create multiple children Entry testFolder = createTestFolder("testChildrenTypeFilter"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry document = createDocument(childrenLink.getHref(), "testChildren1"); assertNotNull(document); @@ -318,7 +300,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // create children Entry testFolder = createTestFolder("testGetChildrenPropertyFilter"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry document1 = createDocument(childrenLink.getHref(), "testGetChildrenPropertyFilter1"); assertNotNull(document1); @@ -337,7 +319,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // get children with object_id only Map args = new HashMap(); - args.put("filter", "ObjectId"); + args.put("filter", CMISConstants.PROP_OBJECT_ID); Feed children = getFeed(childrenLink.getHref(), args); for (Entry entry : children.getEntries()) { @@ -353,13 +335,13 @@ public class CMISTest extends BaseCMISWebScriptTest { // create multiple nested children Entry testFolder = createTestFolder("testGetDescendants"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry document1 = createDocument(childrenLink.getHref(), "testGetDescendants1"); assertNotNull(document1); Entry folder2 = createFolder(childrenLink.getHref(), "testGetDescendants2"); assertNotNull(folder2); - Link childrenLink2 = folder2.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink2 = getChildrenLink(folder2); assertNotNull(childrenLink2); Entry document3 = createDocument(childrenLink2.getHref(), "testGetDescendants3"); assertNotNull(document3); @@ -368,7 +350,9 @@ public class CMISTest extends BaseCMISWebScriptTest // get descendants (depth = 1, equivalent to getChildren) Map args = new HashMap(); args.put("depth", "1"); - Link descendantsLink = testFolder.getLink(CMISConstants.REL_DESCENDANTS); + Link descendantsLink = getDescendantsLink(testFolder); + assertNotNull(descendantsLink); + Feed descendants = getFeed(descendantsLink.getHref(), args); assertNotNull(descendants); assertEquals(2, descendants.getEntries().size()); @@ -376,101 +360,119 @@ public class CMISTest extends BaseCMISWebScriptTest assertNotNull(descendants.getEntry(folder2.getId().toString())); Entry getFolder2 = descendants.getEntry(folder2.getId().toString()); - Entry getFolder2Child = getFolder2.getFirstChild(CMISConstants.NESTED_ENTRY); - assertNull(getFolder2Child); + CMISChildren folder2Children = getFolder2.getFirstChild(CMISConstants.CHILDREN); + assertNull(folder2Children); } { // get nested children Map args = new HashMap(); args.put("depth", "2"); - Link descendantsLink = testFolder.getLink(CMISConstants.REL_DESCENDANTS); + Link descendantsLink = getDescendantsLink(testFolder); Feed descendants = getFeed(descendantsLink.getHref(), args); assertNotNull(descendants); assertEquals(2, descendants.getEntries().size()); assertNotNull(descendants.getEntry(document1.getId().toString())); assertNotNull(descendants.getEntry(folder2.getId().toString())); - Entry getFolder2 = descendants.getEntry(folder2.getId().toString()); - List getFolder2Children = getFolder2.getExtensions(CMISConstants.NESTED_ENTRY); - assertNotNull(getFolder2Children); - assertEquals(1, getFolder2Children.size()); - Entry getFolder2Child = getFolder2Children.get(0); + CMISChildren folder2Children = getFolder2.getFirstChild(CMISConstants.CHILDREN); + assertNotNull(folder2Children); + assertEquals(1, folder2Children.size()); + Entry getFolder2Child = folder2Children.getEntries().get(0); assertEquals(document3.getId(), getFolder2Child.getId()); assertEquals(document3.getEditLink().getHref().toString(), getFolder2Child.getEditLink().getHref().toString()); } } + + public void testGetFolderTree() + throws Exception + { + // create multiple nested children + Entry testFolder = createTestFolder("testGetFolderTree"); + Link childrenLink = getChildrenLink(testFolder); + assertNotNull(childrenLink); + Entry document1 = createDocument(childrenLink.getHref(), "testGetFolderTree1"); + assertNotNull(document1); + Entry folder2 = createFolder(childrenLink.getHref(), "testGetFolderTree2"); + assertNotNull(folder2); + Link childrenLink2 = getChildrenLink(folder2); + assertNotNull(childrenLink2); + Entry folder3 = createFolder(childrenLink2.getHref(), "testGetFolderTree2"); + assertNotNull(folder3); + Entry document4 = createDocument(childrenLink2.getHref(), "testGetFolderTree3"); + assertNotNull(document4); + + { + // get tree (depth = 1, equivalent to getChildren) + Map args = new HashMap(); + args.put("depth", "1"); + Link treeLink = getFolderTreeLink(testFolder); + assertNotNull(treeLink); + + Feed tree = getFeed(treeLink.getHref(), args); + assertNotNull(tree); + assertEquals(1, tree.getEntries().size()); + assertNotNull(tree.getEntry(folder2.getId().toString())); + assertNull(tree.getEntry(document1.getId().toString())); + + Entry getFolder2 = tree.getEntry(folder2.getId().toString()); + CMISChildren folder2Children = getFolder2.getFirstChild(CMISConstants.CHILDREN); + assertNull(folder2Children); + } + + { + // get full tree + Map args = new HashMap(); + args.put("depth", "-1"); + Link treeLink = getFolderTreeLink(testFolder); + Feed tree = getFeed(treeLink.getHref(), args); + assertNotNull(treeLink); + assertEquals(1, tree.getEntries().size()); + assertNotNull(tree.getEntry(folder2.getId().toString())); + assertNull(tree.getEntry(document1.getId().toString())); + + Entry getFolder2 = tree.getEntry(folder2.getId().toString()); + CMISChildren folder2Children = getFolder2.getFirstChild(CMISConstants.CHILDREN); + assertNotNull(folder2Children); + assertEquals(1, folder2Children.size()); + assertNotNull(folder2Children.getEntry(folder3.getId().toString())); + assertNull(folder2Children.getEntry(document4.getId().toString())); + } + } public void testGetParent() throws Exception { Entry testFolder = createTestFolder("testParent"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry childFolder = createFolder(childrenLink.getHref(), "testParentChild"); assertNotNull(childFolder); - Link parentLink = childFolder.getLink(CMISConstants.REL_PARENTS); + Link parentLink = getFolderParentLink(childFolder); assertNotNull(parentLink); // ensure there is parent 'testParent' - Feed parent = getFeed(parentLink.getHref()); + Entry parent = getEntry(parentLink.getHref()); assertNotNull(parent); - assertEquals(1, parent.getEntries().size()); - assertEquals(testFolder.getId(), parent.getEntries().get(0).getId()); - - // TODO: compare identity using OBJECT_ID property, not atom:id - - // ensure there are ancestors 'testParent', "test run folder", "tests folder" and "root folder" - Map args = new HashMap(); - args.put("returnToRoot", "true"); - Feed parentsToRoot = getFeed(new IRI(parentLink.getHref().toString()), args); - assertNotNull(parentsToRoot); - assertEquals(4, parentsToRoot.getEntries().size()); - assertEquals(testFolder.getId(), parentsToRoot.getEntries().get(0).getId()); - assertNotNull(parentsToRoot.getEntries().get(0).getLink(CMISConstants.REL_PARENTS)); - assertEquals(getTestRunFolder().getId(), parentsToRoot.getEntries().get(1).getId()); - assertNotNull(parentsToRoot.getEntries().get(1).getLink(CMISConstants.REL_PARENTS)); - assertEquals(getTestRootFolder().getId(), parentsToRoot.getEntries().get(2).getId()); - assertNotNull(parentsToRoot.getEntries().get(2).getLink(CMISConstants.REL_PARENTS)); - Feed root = getFeed(getRootCollection(getWorkspace(getRepository()))); - Entry rootEntry = getEntry(root.getLink(CMISConstants.REL_SOURCE).getHref()); - assertEquals(rootEntry.getId(), parentsToRoot.getEntries().get(3).getId()); - assertNull(parentsToRoot.getEntries().get(3).getLink(CMISConstants.REL_PARENTS)); + assertEquals(testFolder.getId(), parent.getId()); } public void testGetParents() throws Exception { Entry testFolder = createTestFolder("testParents"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); Entry childDocs = createDocument(childrenLink.getHref(), "testParentsChild"); assertNotNull(childDocs); - Link parentLink = childDocs.getLink(CMISConstants.REL_PARENTS); - assertNotNull(parentLink); + Link parentsLink = getObjectParentsLink(childDocs); + assertNotNull(parentsLink); // ensure there is parent 'testParent' - Feed parent = getFeed(parentLink.getHref()); + Feed parent = getFeed(parentsLink.getHref()); assertNotNull(parent); assertEquals(1, parent.getEntries().size()); assertEquals(testFolder.getId(), parent.getEntries().get(0).getId()); - - // ensure there are ancestors 'testParent', "test run folder" and "root folder" - Map args = new HashMap(); - args.put("returnToRoot", "true"); - Feed parentsToRoot = getFeed(new IRI(parentLink.getHref().toString()), args); - assertNotNull(parentsToRoot); - assertEquals(4, parentsToRoot.getEntries().size()); - assertEquals(testFolder.getId(), parentsToRoot.getEntries().get(0).getId()); - //assertNotNull(parentsToRoot.getEntries().get(0).getLink(CMISConstants.REL_PARENT)); - assertEquals(getTestRunFolder().getId(), parentsToRoot.getEntries().get(1).getId()); - //assertNotNull(parentsToRoot.getEntries().get(1).getLink(CMISConstants.REL_PARENT)); - assertEquals(getTestRootFolder().getId(), parentsToRoot.getEntries().get(2).getId()); - //assertNotNull(parentsToRoot.getEntries().get(2).getLink(CMISConstants.REL_PARENT)); - Feed root = getFeed(getRootCollection(getWorkspace(getRepository()))); - Entry rootEntry = getEntry(root.getLink(CMISConstants.REL_SOURCE).getHref()); - assertEquals(rootEntry.getId(), parentsToRoot.getEntries().get(3).getId()); - assertNull(parentsToRoot.getEntries().get(3).getLink(CMISConstants.REL_PARENTS)); } public void testDelete() @@ -478,7 +480,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for deletes Entry testFolder = createTestFolder("testDelete"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); Feed children = getFeed(childrenLink.getHref()); int entriesBefore = children.getEntries().size(); @@ -504,12 +506,78 @@ public class CMISTest extends BaseCMISWebScriptTest assertEquals(entriesBefore, entriesAfterDelete); } + public void testDeleteDescendants() + throws Exception + { + // create multiple nested children + Entry testFolder = createTestFolder("testDeleteDescendants"); + Link childrenLink = getChildrenLink(testFolder); + assertNotNull(childrenLink); + Entry document1 = createDocument(childrenLink.getHref(), "testDeleteDescendants1"); + assertNotNull(document1); + Entry folder2 = createFolder(childrenLink.getHref(), "testDeleteDescendants2"); + assertNotNull(folder2); + Link childrenLink2 = getChildrenLink(folder2); + assertNotNull(childrenLink2); + Entry document3 = createDocument(childrenLink2.getHref(), "testDeleteDescendants3"); + assertNotNull(document3); + + // delete on root of created tree + Link descendantsLink = getDescendantsLink(testFolder); + assertNotNull(descendantsLink); + Response deleteRes = sendRequest(new DeleteRequest(descendantsLink.getHref().toString()), 204); + assertNotNull(deleteRes); + + // ensure all have been deleted + Response getRes1 = sendRequest(new GetRequest(testFolder.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes1); + Response getRes2 = sendRequest(new GetRequest(document1.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes2); + Response getRes3 = sendRequest(new GetRequest(folder2.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes3); + Response getRes4 = sendRequest(new GetRequest(document3.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes4); + } + + public void testDeleteFolderTree() + throws Exception + { + // create multiple nested children + Entry testFolder = createTestFolder("testDeleteFolderTree"); + Link childrenLink = getChildrenLink(testFolder); + assertNotNull(childrenLink); + Entry document1 = createDocument(childrenLink.getHref(), "testDeleteDescendants1"); + assertNotNull(document1); + Entry folder2 = createFolder(childrenLink.getHref(), "testDeleteDescendants2"); + assertNotNull(folder2); + Link childrenLink2 = getChildrenLink(folder2); + assertNotNull(childrenLink2); + Entry document3 = createDocument(childrenLink2.getHref(), "testDeleteDescendants3"); + assertNotNull(document3); + + // delete on root of created tree + Link treeLink = getFolderTreeLink(testFolder); + assertNotNull(treeLink); + Response deleteRes = sendRequest(new DeleteRequest(treeLink.getHref().toString()), 204); + assertNotNull(deleteRes); + + // ensure all have been deleted + Response getRes1 = sendRequest(new GetRequest(testFolder.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes1); + Response getRes2 = sendRequest(new GetRequest(document1.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes2); + Response getRes3 = sendRequest(new GetRequest(folder2.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes3); + Response getRes4 = sendRequest(new GetRequest(document3.getSelfLink().getHref().toString()), 404); + assertNotNull(getRes4); + } + public void testUpdatePatch() throws Exception { // retrieve test folder for update Entry testFolder = createTestFolder("testUpdatePatch"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for update Entry document = createDocument(childrenLink.getHref(), "testUpdatePatch"); @@ -546,7 +614,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for update Entry testFolder = createTestFolder("testUpdatePut"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for update Entry document = createDocument(childrenLink.getHref(), "testUpdatePut"); @@ -583,18 +651,23 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for update Entry testFolder = createTestFolder("testUpdatePutAtomEntry"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for update Entry document = createDocument(childrenLink.getHref(), "testUpdatePutAtomEntry"); assertNotNull(document); - - // update - String updateFile = loadString("/org/alfresco/repo/cmis/rest/test/updateatomentry.atomentry.xml"); - Response res = sendRequest(new PutRequest(document.getSelfLink().getHref().toString(), updateFile, Format.ATOMENTRY.mimetype()), 200, getAtomValidator()); + + // edit title + String updatedTitle = "Iñtërnâtiônàlizætiøn - 2"; + document.setTitle(updatedTitle); + StringWriter writer = new StringWriter(); + document.writeTo(writer); + + // put document + Response res = sendRequest(new PutRequest(document.getSelfLink().getHref().toString(), writer.toString(), Format.ATOMENTRY.mimetype()), 200, getAtomValidator()); assertNotNull(res); Entry updated = getAbdera().parseEntry(new StringReader(res.getContentAsString()), null); - assertEquals("Iñtërnâtiônàlizætiøn - 2", updated.getTitle()); + assertEquals(updatedTitle, updated.getTitle()); } public void testContentStreamEmpty() @@ -602,7 +675,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for content stream tests Entry testFolder = createTestFolder("testContentStreamEmpty"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for setting / getting content Entry document = createDocument(childrenLink.getHref(), "testContent", "createdocumentNoContent.atomentry.xml"); @@ -616,7 +689,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for content stream tests Entry testFolder = createTestFolder("testContentStream"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for setting / getting content Entry document = createDocument(childrenLink.getHref(), "testContent"); @@ -644,7 +717,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for content stream tests Entry testFolder = createTestFolder("testContentStreamEmpty"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for setting / getting content Entry document = createDocument(childrenLink.getHref(), "testContent"); @@ -669,14 +742,14 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for allowable actions Entry testFolder = createTestFolder("testAllowableActions"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); // test allowable actions for folder { Entry child = createFolder(childrenLink.getHref(), "testFolderAllowableActions"); assertNotNull(child); - Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLEACTIONS); + Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLE_ACTIONS); Response allowableActionsRes = sendRequest(new GetRequest(allowableActionsLink.getHref().toString()), 200, getAtomValidator()); assertNotNull(allowableActionsRes); Element allowableActions = getAbdera().parse(new StringReader(allowableActionsRes.getContentAsString()), null); @@ -684,9 +757,7 @@ public class CMISTest extends BaseCMISWebScriptTest assertTrue(allowableActions instanceof CMISAllowableActions); CMISObject childObject = child.getExtension(CMISConstants.OBJECT); assertNotNull(childObject); - assertEquals(((CMISAllowableActions)allowableActions).getParentUrl(), child.getSelfLink().getHref().toString()); - assertEquals(((CMISAllowableActions)allowableActions).getParentId(), childObject.getObjectId().getStringValue()); - CMISAllowableActions objectAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions objectAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); assertNotNull(objectAllowableActions); compareAllowableActions((CMISAllowableActions)allowableActions, objectAllowableActions); @@ -697,7 +768,7 @@ public class CMISTest extends BaseCMISWebScriptTest assertNotNull(properties); CMISObject propObject = properties.getExtension(CMISConstants.OBJECT); assertNotNull(propObject); - CMISAllowableActions propAllowableActions = propObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions propAllowableActions = propObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); assertNotNull(propAllowableActions); compareAllowableActions((CMISAllowableActions)allowableActions, propAllowableActions); } @@ -706,7 +777,7 @@ public class CMISTest extends BaseCMISWebScriptTest { Entry child = createDocument(childrenLink.getHref(), "testDocumentAllowableActions"); assertNotNull(child); - Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLEACTIONS); + Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLE_ACTIONS); Response allowableActionsRes = sendRequest(new GetRequest(allowableActionsLink.getHref().toString()), 200, getAtomValidator()); assertNotNull(allowableActionsRes); Element allowableActions = getAbdera().parse(new StringReader(allowableActionsRes.getContentAsString()), null); @@ -714,9 +785,7 @@ public class CMISTest extends BaseCMISWebScriptTest assertTrue(allowableActions instanceof CMISAllowableActions); CMISObject childObject = child.getExtension(CMISConstants.OBJECT); assertNotNull(childObject); - assertEquals(((CMISAllowableActions)allowableActions).getParentUrl(), child.getSelfLink().getHref().toString()); - assertEquals(((CMISAllowableActions)allowableActions).getParentId(), childObject.getObjectId().getStringValue()); - CMISAllowableActions objectAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions objectAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); assertNotNull(objectAllowableActions); compareAllowableActions((CMISAllowableActions)allowableActions, objectAllowableActions); @@ -727,7 +796,7 @@ public class CMISTest extends BaseCMISWebScriptTest assertNotNull(properties); CMISObject propObject = properties.getExtension(CMISConstants.OBJECT); assertNotNull(propObject); - CMISAllowableActions propAllowableActions = propObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions propAllowableActions = propObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); assertNotNull(propAllowableActions); compareAllowableActions((CMISAllowableActions)allowableActions, propAllowableActions); } @@ -743,11 +812,11 @@ public class CMISTest extends BaseCMISWebScriptTest // extract allowable actions from child CMISObject childObject = child.getExtension(CMISConstants.OBJECT); assertNotNull(childObject); - CMISAllowableActions objectAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions objectAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); assertNotNull(objectAllowableActions); // retrieve allowable actions from link - Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLEACTIONS); + Link allowableActionsLink = child.getLink(CMISConstants.REL_ALLOWABLE_ACTIONS); Response allowableActionsRes = sendRequest(new GetRequest(allowableActionsLink.getHref().toString()), 200, getAtomValidator()); assertNotNull(allowableActionsRes); Element allowableActions = getAbdera().parse(new StringReader(allowableActionsRes.getContentAsString()), null); @@ -755,8 +824,6 @@ public class CMISTest extends BaseCMISWebScriptTest assertTrue(allowableActions instanceof CMISAllowableActions); // compare the two - assertEquals(((CMISAllowableActions)allowableActions).getParentUrl(), child.getSelfLink().getHref().toString()); - assertEquals(((CMISAllowableActions)allowableActions).getParentId(), childObject.getObjectId().getStringValue()); compareAllowableActions((CMISAllowableActions)allowableActions, objectAllowableActions); } } @@ -787,7 +854,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for checkouts Entry testFolder = createTestFolder("testCheckout"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for checkout Entry document = createDocument(childrenLink.getHref(), "testCheckout"); @@ -840,7 +907,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for checkouts Entry testFolder = createTestFolder("testCancelCheckout"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for checkout Entry document = createDocument(childrenLink.getHref(), "testCancelCheckout"); @@ -885,7 +952,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for checkins Entry testFolder = createTestFolder("testCheckIn"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for checkout Entry document = createDocument(childrenLink.getHref(), "testCheckin"); @@ -978,7 +1045,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for checkins Entry testFolder = createTestFolder("testUpdateOnCheckIn"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for checkout Entry document = createDocument(childrenLink.getHref(), "testUpdateOnCheckIn"); @@ -1041,7 +1108,7 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for checkins Entry testFolder = createTestFolder("testGetAllVersions"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document for checkout Entry document = createDocument(childrenLink.getHref(), "testGetAllVersions"); @@ -1075,7 +1142,7 @@ public class CMISTest extends BaseCMISWebScriptTest } // get all versions - Link allVersionsLink = document.getLink(CMISConstants.REL_ALLVERSIONS); + Link allVersionsLink = document.getLink(CMISConstants.REL_VERSION_HISTORY); assertNotNull(allVersionsLink); Feed allVersions = getFeed(allVersionsLink.getHref()); assertNotNull(allVersions); @@ -1145,7 +1212,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for type definitions Entry testFolder = createTestFolder("testGetEntryTypeDefinition"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create document Entry document = createDocument(childrenLink.getHref(), "testGetEntryTypeDefinitionDoc"); @@ -1162,7 +1229,7 @@ public class CMISTest extends BaseCMISWebScriptTest for (Entry entry : children.getEntries()) { // get type definition - Link typeLink = entry.getLink(CMISConstants.REL_TYPE); + Link typeLink = entry.getLink(CMISConstants.REL_DESCRIBED_BY); assertNotNull(typeLink); Entry type = getEntry(typeLink.getHref()); assertNotNull(type); @@ -1185,7 +1252,7 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for query Entry testFolder = createTestFolder("testQuery"); CMISObject testFolderObject = testFolder.getExtension(CMISConstants.OBJECT); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create documents to query Entry document1 = createDocument(childrenLink.getHref(), "apple1"); @@ -1306,7 +1373,7 @@ public class CMISTest extends BaseCMISWebScriptTest // create multiple children Set docIds = new HashSet(); Entry testFolder = createTestFolder("testQueryPaging"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); assertNotNull(childrenLink); for (int i = 0; i < 15; i++) { @@ -1357,7 +1424,7 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for query Entry testFolder = createTestFolder("testQueryAllowableAcrtions"); CMISObject testFolderObject = testFolder.getExtension(CMISConstants.OBJECT); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); + Link childrenLink = getChildrenLink(testFolder); // create documents to query Entry document1 = createDocument(childrenLink.getHref(), "apple1"); @@ -1396,7 +1463,7 @@ public class CMISTest extends BaseCMISWebScriptTest // extract allowable actions from child CMISObject childObject = child.getExtension(CMISConstants.OBJECT); assertNotNull(childObject); - CMISAllowableActions childAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions childAllowableActions = childObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); assertNotNull(childAllowableActions); // retrieve allowable actions from link @@ -1405,7 +1472,7 @@ public class CMISTest extends BaseCMISWebScriptTest Entry entry = getEntry(child.getSelfLink().getHref(), args); CMISObject entryObject = entry.getExtension(CMISConstants.OBJECT); assertNotNull(entryObject); - CMISAllowableActions entryAllowableActions = entryObject.getExtension(CMISConstants.ALLOWABLEACTIONS); + CMISAllowableActions entryAllowableActions = entryObject.getExtension(CMISConstants.ALLOWABLE_ACTIONS); // compare the two compareAllowableActions(childAllowableActions, entryAllowableActions); diff --git a/source/java/org/alfresco/repo/cmis/rest/test/checkinandupdatedocument.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/checkinandupdatedocument.atomentry.xml index 033588b8c3..852e297dc0 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/checkinandupdatedocument.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/checkinandupdatedocument.atomentry.xml @@ -1,5 +1,5 @@ - + Updated Title ${NAME} - updated content ${NAME} + updated content ${NAME} diff --git a/source/java/org/alfresco/repo/cmis/rest/test/checkindocument.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/checkindocument.atomentry.xml index 2086450c06..ba99e2fbbd 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/checkindocument.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/checkindocument.atomentry.xml @@ -1,2 +1,2 @@ - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createcustomdocument.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createcustomdocument.atomentry.xml index 3ab6303c08..dc12d60046 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createcustomdocument.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createcustomdocument.atomentry.xml @@ -1,13 +1,13 @@ - + ${NAME} ${NAME} (summary) ${CONTENT} - + - D/cmiscustom_document - custom string - truefalse + D/cmiscustom:document + custom string + truefalse - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createcustomfolder.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createcustomfolder.atomentry.xml index 027407a194..49e71806ad 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createcustomfolder.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createcustomfolder.atomentry.xml @@ -1,11 +1,11 @@ - + ${NAME} ${NAME} (summary) - + - F/cmiscustom_folder - custom string + F/cmiscustom:folder + custom string - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createdocument.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createdocument.atomentry.xml index ded8931397..f42e04113d 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createdocument.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createdocument.atomentry.xml @@ -1,11 +1,11 @@ - + ${NAME} ${NAME} (summary) ${CONTENT} - + - document + cmis:document - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createdocument2.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createdocument2.atomentry.xml index d7b9e810ea..7cfec11980 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createdocument2.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createdocument2.atomentry.xml @@ -1,10 +1,10 @@ - + onesentence.txt MQ== - + - document - onesentence.txt + document + onesentence.txt - + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createdocumentBase64.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createdocumentBase64.atomentry.xml index 525f3042fc..7b85da1fd5 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createdocumentBase64.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createdocumentBase64.atomentry.xml @@ -1,5 +1,5 @@ - + ${NAME} ${NAME} (summary) @@ -13,9 +13,9 @@ ZCBmb2xkZXIuICBJZiB0aGUgY29udGVudCBzdHJlYW0gaXMgc3BlY2lmaWVkIG9uIGNyZWF0ZSwg aXQgc2hvdWxkIGJlIGJhc2U2NCBlbmNvZGVkIGluIHRoZSBhdG9tIGVudHJ5Lg== - + - document + cmis:document - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createdocumentNoContent.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createdocumentNoContent.atomentry.xml index 00f00392d1..74260983fa 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createdocumentNoContent.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createdocumentNoContent.atomentry.xml @@ -1,10 +1,10 @@ - + ${NAME} ${NAME} (summary) - + - document + cmis:document - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createfolder.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createfolder.atomentry.xml index 7a2dda39e3..c4e8fa04f6 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createfolder.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createfolder.atomentry.xml @@ -1,10 +1,10 @@ - + ${NAME} ${NAME} (summary) - + - folder + cmis:folder - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/createrelationship.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/createrelationship.atomentry.xml index 1d474bf87b..4ee946313f 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/createrelationship.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/createrelationship.atomentry.xml @@ -1,9 +1,9 @@ - - + + - ${RELTYPE} - ${TARGETID} + ${RELTYPE} + ${TARGETID} - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/updateatomentry.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/updateatomentry.atomentry.xml deleted file mode 100644 index af0fc340c3..0000000000 --- a/source/java/org/alfresco/repo/cmis/rest/test/updateatomentry.atomentry.xml +++ /dev/null @@ -1,72 +0,0 @@ - - -admin -sdsds urn:uuid:87067d6a-e471-4b21-83bd-125e44dc9d75 - - - - - - - - -2009-04-07T20:38:29.737+01:00 -Iñtërnâtiônàlizætiøn - 2 -Iñtërnâtiônàlizætiøn - 2 -2009-04-07T20:38:29.784+01:00 - - -document - - -ALLOWED -false -true - -false - -2009-04-07T20:38:29.784+01:00 -2009-04-07T20:38:29.737+01:00 -http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/87067d6a-e471-4b21-83bd-125e44dc9d75/content -admin -68 -workspace://SpacesStore/87067d6a-e471-4b21-83bd-125e44dc9d75 - -false -Iñtërnâtiônàlizætiøn - 2 -text/xhtml -Iñtërnâtiônàlizætiøn - 2 -document - -false -admin -workspace://SpacesStore/87067d6a-e471-4b21-83bd-125e44dc9d75 - - -true -true -true -true -true -true -true -true -true -false -false -true -true -true -true -true -false -false -false -true - - - -2009-04-07T20:38:29.784+01:00 -http://localhost:8080/alfresco/images/filetypes/_default.gif -workspace://SpacesStore/87067d6a-e471-4b21-83bd-125e44dc9d75 - \ No newline at end of file diff --git a/source/java/org/alfresco/repo/cmis/rest/test/updatecustomdocument.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/updatecustomdocument.atomentry.xml index 71800c3bd1..04ab325f78 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/updatecustomdocument.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/updatecustomdocument.atomentry.xml @@ -1,10 +1,10 @@ - + Updated Title ${NAME} - + - custom ${NAME} - falsetrue + custom ${NAME} + falsetrue - + diff --git a/source/java/org/alfresco/repo/cmis/rest/test/updatedocument.atomentry.xml b/source/java/org/alfresco/repo/cmis/rest/test/updatedocument.atomentry.xml index 8c7196ed1f..852e297dc0 100644 --- a/source/java/org/alfresco/repo/cmis/rest/test/updatedocument.atomentry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/test/updatedocument.atomentry.xml @@ -1,5 +1,5 @@ - + Updated Title ${NAME} updated content ${NAME} diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd b/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd index 438b000773..2226b21bc8 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd @@ -8,7 +8,7 @@ xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisc="http://docs.oasis-open.org/ns/cmis/core/200901" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200901" - version="0.62a"> + version="0.62d"> - + + jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.1" version="0.62d"> @@ -89,27 +89,31 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - @@ -117,26 +121,30 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - + + + @@ -392,8 +400,8 @@ - - + + @@ -411,8 +419,11 @@ - - + + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-Core.xsd b/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-Core.xsd index a0fca20eb9..344186d729 100755 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-Core.xsd +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-Core.xsd @@ -7,7 +7,7 @@ xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.1" - xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901" version="0.61c"> + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901" version="0.62f"> @@ -55,10 +55,10 @@ - - - - + + + + @@ -159,7 +159,7 @@ - + @@ -200,13 +200,21 @@ + + + + This holds the children objects of this folder. This is used only in + the Web Service binding. In the REST/AtomPub binding, an atom + extension element is used. + + + + - - @@ -223,16 +231,7 @@ - - - - - - - - - + - - - - - - - - - - - - - @@ -303,8 +282,8 @@ - - + + @@ -429,11 +408,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -684,24 +639,6 @@ - - - - - - - - - - - - - - - - - - @@ -717,8 +654,10 @@ - + + @@ -727,8 +666,11 @@ - + + + @@ -737,12 +679,15 @@ - + + + @@ -751,8 +696,11 @@ - + + + @@ -761,14 +709,17 @@ - + + + @@ -777,8 +728,11 @@ - + + + @@ -787,8 +741,11 @@ - + + + @@ -797,10 +754,13 @@ - + + + @@ -809,8 +769,11 @@ - + + + @@ -819,10 +782,13 @@ - + + + @@ -889,7 +855,6 @@ - @@ -943,7 +908,6 @@ - - + - + - - + @@ -1019,10 +982,11 @@ - - + + - @@ -1102,10 +1066,10 @@ - - - - + + + + @@ -1120,8 +1084,8 @@ - - + + @@ -1174,7 +1138,7 @@ - + @@ -1184,14 +1148,15 @@ - + - + @@ -1206,10 +1171,6 @@ - - - - @@ -1220,7 +1181,7 @@ - + @@ -1240,5 +1201,29 @@ + + + + + This is the root tag for a CMIS AllowableActions + Document Type + + + + + + + + This is the root tag for a CMIS Query Document Type + + + + + + + This is the root tag for a CMIS ACL Document Type + + + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-RestAtom.xsd b/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-RestAtom.xsd index 39965315a8..12ab9c7416 100755 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-RestAtom.xsd +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-RestAtom.xsd @@ -9,7 +9,7 @@ jaxb:extensionBindingPrefixes="xjc" jaxb:version="2.1" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200901" - version="0.62a"> + version="0.62f"> - + + + + This is the AtomPub extension element that will be + used to contain CMIS repository information + inside an AtomPub + workspace element inside an AtomPub Service document + + + - - + + + + This is the Atom extension element that will be + used to contain a type definition (document, folder, relationship, + or policy) inside an atom entry element. + + + + + + + + + This is the Atom extension element that will be + used to contain a feed inside an atom entry element. + + + @@ -59,7 +85,23 @@ maxOccurs="unbounded" /> - + + + + This is the AtomPub extension element that will be + used to contain CMIS URI Templates inside an AtomPub + workspace + element inside an AtomPub Service document + + + + + + This is the AtomPub extension element that will be + used to contain a CMIS object instance inside an Atom entry element. + + + @@ -84,31 +126,102 @@ + value="http://docs.oasis-open.org/ns/cmis/link/200901/allowableactions"> + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/relationships"> + + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/source"> + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/target"> + + + + + + + - + value="http://docs.oasis-open.org/ns/cmis/link/200901/policies"> + + + + + + + + + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/changes"> + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/foldertree"> + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/typesdescendants"> + + + + + + + + value="http://docs.oasis-open.org/ns/cmis/link/200901/rootdescendants"> + + + + + + + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/AllowableActions.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/AllowableActions.xml index e98c8937a8..e9579b94f7 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/AllowableActions.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/AllowableActions.xml @@ -1,6 +1,6 @@ - true + true true true true diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/ChangeLog.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/ChangeLog.xml index a833f22240..7aaa0e760d 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/ChangeLog.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/ChangeLog.xml @@ -1,19 +1,19 @@ + changelog feed Al Brown http://www.ibm.com/ albertcbrown@us.ibm.com - urn:uuid:4b03b2ae-a615-4c04-97d5-19be766de71a + 2009-07-17T09:13:33.109-07:00 + urn:uuid:bbf11f9e-0534-43f4-b5a3-436c7d1cf74a diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntry.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntry.xml index c14d57d442..e10726eade 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntry.xml @@ -5,77 +5,77 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:7b667d77-bf53-4176-b233-91aa7d26c127 - - - - - - - - - - - - 2009-07-13T22:50:03.796-07:00 - HTML summary of Entry 7b667d77-bf53-4176-b233-91aa7d26c127 + + urn:uuid:d6ea99e2-ef5e-4bbb-97fa-feeae20d0f94 + + + + + 2009-07-17T09:13:32.890-07:00 + HTML summary of Entry d6ea99e2-ef5e-4bbb-97fa-feeae20d0f94 CMIS Example Document - 2009-07-13T22:50:03.812-07:00 - + 2009-07-17T09:13:32.906-07:00 + + + + + + + + - + false - - 2009-07-13T22:50:03.812-07:00 + + 2009-07-17T09:13:32.906-07:00 - - 2009-07-13T22:50:03.812-07:00 + + 2009-07-17T09:13:32.906-07:00 - - 7b667d77-bf53-4176-b233-91aa7d26c127 + + d6ea99e2-ef5e-4bbb-97fa-feeae20d0f94 - + invoice - + cmis:document - + Al Brown - + Al Brown - + true - + false - + false - + false - + Checkin comment - + 0.1 - + text/plain - + text.txt - + 4234 - + document example sample @@ -83,7 +83,7 @@ - true + true true true true @@ -103,5 +103,5 @@ true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryPWC.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryPWC.xml index 63dba35085..75c4bf6645 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryPWC.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryPWC.xml @@ -5,92 +5,92 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:feec8a83-7a8f-495c-9a41-d8f4c8b2dd4b - - - - - - - - - - - - - 2009-07-13T22:50:03.828-07:00 - HTML summary of Entry feec8a83-7a8f-495c-9a41-d8f4c8b2dd4b + + urn:uuid:24f3aad1-485c-468e-a9a7-aff29fdbeafb + + + + + 2009-07-17T09:13:32.921-07:00 + HTML summary of Entry 24f3aad1-485c-468e-a9a7-aff29fdbeafb CMIS Example Document for PWC - 2009-07-13T22:50:03.828-07:00 - + 2009-07-17T09:13:32.937-07:00 + + + + + + + + + - + false - - 2009-07-13T22:50:03.843-07:00 + + 2009-07-17T09:13:32.937-07:00 - - 2009-07-13T22:50:03.843-07:00 + + 2009-07-17T09:13:32.937-07:00 - - feec8a83-7a8f-495c-9a41-d8f4c8b2dd4b + + 24f3aad1-485c-468e-a9a7-aff29fdbeafb - + invoice - + cmis:document - + Al Brown - + Al Brown - + true - + true - + false - + false - + Checkin comment - + 0.1 - + text/plain - + text.txt - + 4234 - + document example sample cmis - - vs-feec8a83-7a8f-495c-9a41-d8f4c8b2dd4b + + vs-24f3aad1-485c-468e-a9a7-aff29fdbeafb - + Al Brown - true + true true true true @@ -110,5 +110,5 @@ true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryWithChanges.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryWithChanges.xml index de1d6a821d..7662c4e7d7 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryWithChanges.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/DocumentEntryWithChanges.xml @@ -5,77 +5,77 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:ba01e3b4-498e-4c37-a9ce-ce49afac7ce3 - - - - - - - - - - - - 2009-07-13T22:50:03.984-07:00 - HTML summary of Entry ba01e3b4-498e-4c37-a9ce-ce49afac7ce3 + + urn:uuid:fb7b8894-bf63-4f61-bcb6-8678d3af7b64 + + + + + 2009-07-17T09:13:33.156-07:00 + HTML summary of Entry fb7b8894-bf63-4f61-bcb6-8678d3af7b64 CMIS Example Document - Loan - 2009-07-13T22:50:03.984-07:00 - + 2009-07-17T09:13:33.156-07:00 + + + + + + + + - + false - - 2009-07-13T22:50:03.984-07:00 + + 2009-07-17T09:13:33.156-07:00 - - 2009-07-13T22:50:03.984-07:00 + + 2009-07-17T09:13:33.156-07:00 - - ba01e3b4-498e-4c37-a9ce-ce49afac7ce3 + + fb7b8894-bf63-4f61-bcb6-8678d3af7b64 - + loan - + cmis:document - + Al Brown - + Al Brown - + true - + false - + false - + false - + Checkin comment - + 0.1 - + text/plain - + text.txt - + 4234 - + document example sample @@ -83,7 +83,7 @@ - true + true true true true @@ -105,7 +105,7 @@ updated - 2009-07-13T22:50:03.984-07:00 + 2009-07-17T09:13:33.156-07:00 - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderChildren.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderChildren.xml index 68146ff19f..f514b396b4 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderChildren.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderChildren.xml @@ -1,19 +1,19 @@ + Feed for folder1 Al Brown http://www.ibm.com/ albertcbrown@us.ibm.com - urn:uuid:e926653d-d02a-420b-87ba-94533ede656b + 2009-07-17T09:13:33.000-07:00 + urn:uuid:55638aa8-d558-4e59-b9b4-0bf9aba14bb3 diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderDescendants.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderDescendants.xml index d8cc3c224b..59e30291ed 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderDescendants.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderDescendants.xml @@ -1,16 +1,16 @@ + Feed for folder1 Al Brown http://www.ibm.com/ albertcbrown@us.ibm.com - urn:uuid:6612a226-06d3-4c60-8a31-dbcbfa1fd542 - - - Feed for folder1 - 2009-07-13T22:50:03.921-07:00 - + 2009-07-17T09:13:33.046-07:00 + urn:uuid:93474b3f-9ca1-440a-8856-af51e5197e05 + + + Feed for folder1 application/atom+xml;type=entry application/atom+xml @@ -22,52 +22,52 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:4de5c2fe-7e85-4ae1-a2ff-dad62807a21f - - - - - - - - - 2009-07-13T22:50:03.921-07:00 - HTML summary of Entry 4de5c2fe-7e85-4ae1-a2ff-dad62807a21f + + urn:uuid:50f79725-6aa4-4206-838e-03c90a045b17 + + + + + 2009-07-17T09:13:33.046-07:00 + HTML summary of Entry 50f79725-6aa4-4206-838e-03c90a045b17 CMIS Example Folder as Customer type - 2009-07-13T22:50:03.921-07:00 - + 2009-07-17T09:13:33.046-07:00 + + + + + - + false - - 2009-07-13T22:50:03.921-07:00 + + 2009-07-17T09:13:33.046-07:00 - - 2009-07-13T22:50:03.921-07:00 + + 2009-07-17T09:13:33.046-07:00 - - 4de5c2fe-7e85-4ae1-a2ff-dad62807a21f + + 50f79725-6aa4-4206-838e-03c90a045b17 - + customer - + cmis:folder - + Al Brown - + Al Brown - - 4de5c2fe-7e85-4ae1-a2ff-dad62807a21fup + + 50f79725-6aa4-4206-838e-03c90a045b17up - true + true true true true @@ -83,19 +83,19 @@ true true - + + CMIS Example Folder as Customer type Al Brown http://www.ibm.com/ albertcbrown@us.ibm.com - urn:uuid:0d85ac29-9cf0-4e39-836c-9befb14eed42 - - - CMIS Example Folder as Customer type - 2009-07-13T22:50:03.921-07:00 - + 2009-07-17T09:13:33.046-07:00 + urn:uuid:40c0b703-758c-4102-8739-18d19e11109c + + + CMIS Example Folder as Customer type application/atom+xml;type=entry application/atom+xml @@ -107,77 +107,77 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:23787998-7b17-45e3-bd0d-09ccab9e51d2 - - - - - - - - - - - - 2009-07-13T22:50:03.921-07:00 - HTML summary of Entry 23787998-7b17-45e3-bd0d-09ccab9e51d2 + + urn:uuid:ba61c32c-da45-43cf-8fe7-399cae307ccc + + + + + 2009-07-17T09:13:33.046-07:00 + HTML summary of Entry ba61c32c-da45-43cf-8fe7-399cae307ccc CMIS Example Doc as Invoice type - 2009-07-13T22:50:03.921-07:00 - + 2009-07-17T09:13:33.046-07:00 + + + + + + + + - + false - - 2009-07-13T22:50:03.921-07:00 + + 2009-07-17T09:13:33.046-07:00 - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.046-07:00 - - 23787998-7b17-45e3-bd0d-09ccab9e51d2 + + ba61c32c-da45-43cf-8fe7-399cae307ccc - + invoice - + cmis:document - + Al Brown - + Al Brown - + true - + false - + false - + false - + Checkin comment - + 0.1 - + text/plain - + text.txt - + 4234 - + document example sample @@ -185,7 +185,7 @@ - true + true true true true @@ -205,7 +205,7 @@ true true - + @@ -213,77 +213,77 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:0016826e-481b-49ea-874d-eed3dd469c93 - - - - - - - - - - - - 2009-07-13T22:50:03.937-07:00 - HTML summary of Entry 0016826e-481b-49ea-874d-eed3dd469c93 + + urn:uuid:8d712ae5-18fe-469b-b4c4-caa0ea3ab348 + + + + + 2009-07-17T09:13:33.062-07:00 + HTML summary of Entry 8d712ae5-18fe-469b-b4c4-caa0ea3ab348 CMIS Example Doc as Invoice type - 2009-07-13T22:50:03.937-07:00 - + 2009-07-17T09:13:33.062-07:00 + + + + + + + + - + false - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.062-07:00 - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.062-07:00 - - 0016826e-481b-49ea-874d-eed3dd469c93 + + 8d712ae5-18fe-469b-b4c4-caa0ea3ab348 - + invoice - + cmis:document - + Al Brown - + Al Brown - + true - + false - + false - + false - + Checkin comment - + 0.1 - + text/plain - + text.txt - + 4234 - + document example sample @@ -291,7 +291,7 @@ - true + true true true true @@ -311,7 +311,7 @@ true true - + @@ -321,52 +321,52 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:14e2a592-fcf6-4eda-a8d7-db2b93b205bf - - - - - - - - - 2009-07-13T22:50:03.937-07:00 - HTML summary of Entry 14e2a592-fcf6-4eda-a8d7-db2b93b205bf + + urn:uuid:56b10c11-dbe1-4bd8-a5e4-8dc3dcd58204 + + + + + 2009-07-17T09:13:33.062-07:00 + HTML summary of Entry 56b10c11-dbe1-4bd8-a5e4-8dc3dcd58204 CMIS Example Folder as Customer type - 2009-07-13T22:50:03.937-07:00 - + 2009-07-17T09:13:33.062-07:00 + + + + + - + false - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.062-07:00 - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.062-07:00 - - 14e2a592-fcf6-4eda-a8d7-db2b93b205bf + + 56b10c11-dbe1-4bd8-a5e4-8dc3dcd58204 - + customer - + cmis:folder - + Al Brown - + Al Brown - - 14e2a592-fcf6-4eda-a8d7-db2b93b205bfup + + 56b10c11-dbe1-4bd8-a5e4-8dc3dcd58204up - true + true true true true @@ -382,7 +382,7 @@ true true - + @@ -390,77 +390,77 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:74e02f11-1e2a-4226-9a3c-c85af8f16b55 - - - - - - - - - - - - 2009-07-13T22:50:03.937-07:00 - HTML summary of Entry 74e02f11-1e2a-4226-9a3c-c85af8f16b55 + + urn:uuid:400d5852-f94a-4734-802d-0de3b6aa6004 + + + + + 2009-07-17T09:13:33.062-07:00 + HTML summary of Entry 400d5852-f94a-4734-802d-0de3b6aa6004 CMIS Example Doc as Invoice type - 2009-07-13T22:50:03.937-07:00 - + 2009-07-17T09:13:33.078-07:00 + + + + + + + + - + false - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.078-07:00 - - 2009-07-13T22:50:03.937-07:00 + + 2009-07-17T09:13:33.078-07:00 - - 74e02f11-1e2a-4226-9a3c-c85af8f16b55 + + 400d5852-f94a-4734-802d-0de3b6aa6004 - + invoice - + cmis:document - + Al Brown - + Al Brown - + true - + false - + false - + false - + Checkin comment - + 0.1 - + text/plain - + text.txt - + 4234 - + document example sample @@ -468,7 +468,7 @@ - true + true true true true @@ -488,6 +488,6 @@ true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderEntry.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderEntry.xml index 2af9725cf8..01be82862d 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderEntry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/FolderEntry.xml @@ -5,52 +5,52 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:af5102cb-4f0b-42e1-b97c-c3b614074fb2 - - - - - - - - - 2009-07-13T22:50:03.843-07:00 - HTML summary of Entry af5102cb-4f0b-42e1-b97c-c3b614074fb2 + + urn:uuid:86b91347-4039-4363-9171-1b50b2a20f6c + + + + + 2009-07-17T09:13:32.937-07:00 + HTML summary of Entry 86b91347-4039-4363-9171-1b50b2a20f6c CMIS Example Folder as Customer type - 2009-07-13T22:50:03.843-07:00 - + 2009-07-17T09:13:32.937-07:00 + + + + + - + false - - 2009-07-13T22:50:03.843-07:00 + + 2009-07-17T09:13:32.937-07:00 - - 2009-07-13T22:50:03.843-07:00 + + 2009-07-17T09:13:32.937-07:00 - - af5102cb-4f0b-42e1-b97c-c3b614074fb2 + + 86b91347-4039-4363-9171-1b50b2a20f6c - + customer - + cmis:folder - + Al Brown - + Al Brown - - af5102cb-4f0b-42e1-b97c-c3b614074fb2up + + 86b91347-4039-4363-9171-1b50b2a20f6cup - true + true true true true @@ -66,5 +66,5 @@ true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/PolicyEntry.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/PolicyEntry.xml index 832516022c..400a18e3f4 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/PolicyEntry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/PolicyEntry.xml @@ -5,47 +5,47 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:169251b0-40b4-4c83-b0b8-4d4d77f7199e - - - - - - - 2009-07-13T22:50:03.859-07:00 - HTML summary of Entry 169251b0-40b4-4c83-b0b8-4d4d77f7199e + + urn:uuid:7910ee91-6201-4868-bcd9-1c72edf6161f + + + + + 2009-07-17T09:13:32.953-07:00 + HTML summary of Entry 7910ee91-6201-4868-bcd9-1c72edf6161f CMIS Example Policy - 2009-07-13T22:50:03.859-07:00 - + 2009-07-17T09:13:32.968-07:00 + + + - + false - - 2009-07-13T22:50:03.859-07:00 + + 2009-07-17T09:13:32.968-07:00 - - 2009-07-13T22:50:03.859-07:00 + + 2009-07-17T09:13:32.968-07:00 - - 169251b0-40b4-4c83-b0b8-4d4d77f7199e + + 7910ee91-6201-4868-bcd9-1c72edf6161f - + policy - + cmis:policy - + Al Brown - + Al Brown - true + true true true true @@ -57,5 +57,5 @@ true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Query.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Query.xml index bbfa34750e..1809b16d59 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Query.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Query.xml @@ -4,4 +4,5 @@ true 50 0 + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/RelationshipEntry.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/RelationshipEntry.xml index 66bb69e00b..110fbbc00a 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/RelationshipEntry.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/RelationshipEntry.xml @@ -5,47 +5,47 @@ http://www.ibm.com/ albertcbrown@us.ibm.com - - urn:uuid:b86561c5-33ca-4852-918a-a4814160f974 - - - - - - - 2009-07-13T22:50:03.875-07:00 - HTML summary of Entry b86561c5-33ca-4852-918a-a4814160f974 + + urn:uuid:bfe1e986-a166-4abf-b2a2-e164ca954738 + + + + + 2009-07-17T09:13:32.984-07:00 + HTML summary of Entry bfe1e986-a166-4abf-b2a2-e164ca954738 CMIS Example Relationship as Compound Document type - 2009-07-13T22:50:03.875-07:00 - + 2009-07-17T09:13:32.984-07:00 + + + - + false - - 2009-07-13T22:50:03.875-07:00 + + 2009-07-17T09:13:32.984-07:00 - - 2009-07-13T22:50:03.875-07:00 + + 2009-07-17T09:13:32.984-07:00 - - b86561c5-33ca-4852-918a-a4814160f974 + + bfe1e986-a166-4abf-b2a2-e164ca954738 - + compounddocument - + cmis:relationship - + Al Brown - + Al Brown - true + true true true true @@ -57,5 +57,5 @@ true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Service.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Service.xml index fd95a4009f..f481f254d6 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Service.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/Service.xml @@ -23,6 +23,7 @@ changes collection + repid1 @@ -33,19 +34,20 @@ CMIS Prototype for VendorX 0.62 rootfolder - + token-Fri Jul 17 09:13:33 PDT 2009 manage true all cmis:document cmis:folder - anytime + anytime + true true true true bothcombined - false + read true true innerandouter diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWith.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWith.xml index 7bb797ad38..71a7a7f21a 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWith.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWith.xml @@ -13,12 +13,12 @@ - 2009-07-13T22:50:04.000-07:00 + 2009-07-17T09:13:33.171-07:00 HTML summary of Type Definition document-invoice Type Definition - document-invoice - 2009-07-13T22:50:04.000-07:00 - 2009-07-13T22:50:04.000-07:00 - + 2009-07-17T09:13:33.171-07:00 + 2009-07-17T09:13:33.171-07:00 + dtdocument-invoice myrepname-document-invoice document-invoice @@ -33,9 +33,155 @@ true true true + + cmis:BaseTypeId + rep-cmis:BaseTypeId + cmis:BaseTypeId + Description for cmis:BaseTypeId + id + single + readonly + true + false + true + true + false + + + cmis:Name + rep-cmis:Name + cmis:Name + Description for cmis:Name + string + single + readwrite + true + false + true + true + false + 128 + + + cmis:ObjectId + rep-cmis:ObjectId + cmis:ObjectId + Description for cmis:ObjectId + id + single + readonly + true + false + true + true + false + + + cmis:ObjectTypeId + rep-cmis:ObjectTypeId + cmis:ObjectTypeId + Description for cmis:ObjectTypeId + string + single + readonly + true + false + true + true + false + 128 + + + cmis:BaseTypeId + rep-cmis:BaseTypeId + cmis:BaseTypeId + Description for cmis:BaseTypeId + string + single + readonly + true + false + true + true + false + 128 + + + cmis:CreatedBy + rep-cmis:CreatedBy + cmis:CreatedBy + Description for cmis:CreatedBy + string + single + readonly + true + false + true + true + false + 128 + + + cmis:CreationDate + rep-cmis:CreationDate + cmis:CreationDate + Description for cmis:CreationDate + datetime + single + readonly + true + false + true + true + false + + + cmis:LastModifiedBy + rep-cmis:LastModifiedBy + cmis:LastModifiedBy + Description for cmis:LastModifiedBy + string + single + readonly + true + false + true + true + false + 128 + + + cmis:LastModificationDate + rep-cmis:LastModificationDate + cmis:LastModificationDate + Description for cmis:LastModificationDate + datetime + single + readonly + true + false + true + true + false + + + cmis:ChangeToken + rep-cmis:ChangeToken + cmis:ChangeToken + Description for cmis:ChangeToken + string + single + readonly + true + false + true + true + false + 128 + cmis:IsImmutable - cmis:IsImmutable + rep-cmis:IsImmutable cmis:IsImmutable Description for cmis:IsImmutable boolean @@ -49,7 +195,7 @@ cmis:IsLatestVersion - cmis:IsLatestVersion + rep-cmis:IsLatestVersion cmis:IsLatestVersion Description for cmis:IsLatestVersion boolean @@ -63,7 +209,7 @@ cmis:IsMajorVersion - cmis:IsMajorVersion + rep-cmis:IsMajorVersion cmis:IsMajorVersion Description for cmis:IsMajorVersion boolean @@ -77,7 +223,7 @@ cmis:IsLatestMajorVersion - cmis:IsLatestMajorVersion + rep-cmis:IsLatestMajorVersion cmis:IsLatestMajorVersion Description for cmis:IsLatestMajorVersion boolean @@ -91,7 +237,7 @@ cmis:VersionLabel - cmis:VersionLabel + rep-cmis:VersionLabel cmis:VersionLabel Description for cmis:VersionLabel string @@ -106,7 +252,7 @@ cmis:VersionSeriesId - cmis:VersionSeriesId + rep-cmis:VersionSeriesId cmis:VersionSeriesId Description for cmis:VersionSeriesId id @@ -120,7 +266,7 @@ cmis:IsVersionSeriesCheckedOut - cmis:IsVersionSeriesCheckedOut + rep-cmis:IsVersionSeriesCheckedOut cmis:IsVersionSeriesCheckedOut Description for cmis:IsVersionSeriesCheckedOut boolean @@ -134,7 +280,7 @@ cmis:VersionSeriesCheckedOutBy - cmis:VersionSeriesCheckedOutBy + rep-cmis:VersionSeriesCheckedOutBy cmis:VersionSeriesCheckedOutBy Description for cmis:VersionSeriesCheckedOutBy string @@ -149,7 +295,7 @@ cmis:VersionSeriesCheckedOutId - cmis:VersionSeriesCheckedOutId + rep-cmis:VersionSeriesCheckedOutId cmis:VersionSeriesCheckedOutId Description for cmis:VersionSeriesCheckedOutId id @@ -163,7 +309,7 @@ cmis:CheckinComment - cmis:CheckinComment + rep-cmis:CheckinComment cmis:CheckinComment Description for cmis:CheckinComment string @@ -178,7 +324,7 @@ cmis:ContentStreamLength - cmis:ContentStreamLength + rep-cmis:ContentStreamLength cmis:ContentStreamLength Description for cmis:ContentStreamLength datetime @@ -194,7 +340,7 @@ cmis:ContentStreamMimeType - cmis:ContentStreamMimeType + rep-cmis:ContentStreamMimeType cmis:ContentStreamMimeType Description for cmis:ContentStreamMimeType string @@ -208,10 +354,10 @@ 128 - cmis:ContentStreamFilename - cmis:ContentStreamFilename - cmis:ContentStreamFilename - Description for cmis:ContentStreamFilename + cmis:ContentStreamFileName + rep-cmis:ContentStreamFileName + cmis:ContentStreamFileName + Description for cmis:ContentStreamFileName string single readonly @@ -223,10 +369,10 @@ 128 - cmis:Name - cmis:Name - cmis:Name - Description for cmis:Name + custom-customertype + rep-custom-customertype + custom-customertype + Description for custom-customertype string single readwrite @@ -235,126 +381,21 @@ true true false + + defaultvalue for custom-customertype + 128 - - - cmis:ObjectId - cmis:ObjectId - cmis:ObjectId - Description for cmis:ObjectId - id - single - readonly - true - false - true - true - false - - - cmis:ObjectTypeId - cmis:ObjectTypeId - cmis:ObjectTypeId - Description for cmis:ObjectTypeId - string - single - readonly - true - false - true - true - false - 128 - - - cmis:BaseTypeId - cmis:BaseTypeId - cmis:BaseTypeId - Description for cmis:BaseTypeId - string - single - readonly - true - false - true - true - false - 128 - - - cmis:CreatedBy - cmis:CreatedBy - cmis:CreatedBy - Description for cmis:CreatedBy - string - single - readonly - true - false - true - true - false - 128 - - - cmis:CreationDate - cmis:CreationDate - cmis:CreationDate - Description for cmis:CreationDate - datetime - single - readonly - true - false - true - true - false - - - cmis:LastModifiedBy - cmis:LastModifiedBy - cmis:LastModifiedBy - Description for cmis:LastModifiedBy - string - single - readonly - true - false - true - true - false - 128 - - - cmis:LastModificationDate - cmis:LastModificationDate - cmis:LastModificationDate - Description for cmis:LastModificationDate - datetime - single - readonly - true - false - true - true - false - - - cmis:ChangeToken - cmis:ChangeToken - cmis:ChangeToken - Description for cmis:ChangeToken - string - single - readonly - true - false - true - true - false - 128 + + choice1value + + + choice2value + + + choice3value + true allowed - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWithout.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWithout.xml index cfe00ba1fb..3d95ee1bab 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWithout.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeDocumentWithout.xml @@ -13,12 +13,12 @@ - 2009-07-13T22:50:04.000-07:00 + 2009-07-17T09:13:33.156-07:00 HTML summary of Type Definition document-invoice Type Definition - document-invoice - 2009-07-13T22:50:04.000-07:00 - 2009-07-13T22:50:04.000-07:00 - + 2009-07-17T09:13:33.156-07:00 + 2009-07-17T09:13:33.156-07:00 + dtdocument-invoice myrepname-document-invoice document-invoice @@ -35,5 +35,5 @@ true true allowed - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWith.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWith.xml index 40dbf469ca..fbb90cb8df 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWith.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWith.xml @@ -13,18 +13,18 @@ - 2009-07-13T22:50:04.031-07:00 + 2009-07-17T09:13:33.187-07:00 HTML summary of Type Definition folder-invoice Type Definition - folder-invoice - 2009-07-13T22:50:04.031-07:00 - 2009-07-13T22:50:04.031-07:00 - + 2009-07-17T09:13:33.187-07:00 + 2009-07-17T09:13:33.187-07:00 + dtfolder-invoice myrepname-folder-invoice folder-invoice folder-invoice Description for type definition folder-invoice - cmis:folder + cmis:document parent true true @@ -34,10 +34,10 @@ true true - cmis:ParentId - cmis:ParentId - cmis:ParentId - Description for cmis:ParentId + cmis:BaseTypeId + rep-cmis:BaseTypeId + cmis:BaseTypeId + Description for cmis:BaseTypeId id single readonly @@ -47,23 +47,9 @@ true false - - cmis:AllowedChildObjectTypeNames - cmis:AllowedChildObjectTypeNames - cmis:AllowedChildObjectTypeNames - Description for cmis:AllowedChildObjectTypeNames - id - multi - readwrite - true - false - true - true - false - cmis:Name - cmis:Name + rep-cmis:Name cmis:Name Description for cmis:Name string @@ -78,7 +64,7 @@ cmis:ObjectId - cmis:ObjectId + rep-cmis:ObjectId cmis:ObjectId Description for cmis:ObjectId id @@ -92,7 +78,7 @@ cmis:ObjectTypeId - cmis:ObjectTypeId + rep-cmis:ObjectTypeId cmis:ObjectTypeId Description for cmis:ObjectTypeId string @@ -107,7 +93,7 @@ cmis:BaseTypeId - cmis:BaseTypeId + rep-cmis:BaseTypeId cmis:BaseTypeId Description for cmis:BaseTypeId string @@ -122,7 +108,7 @@ cmis:CreatedBy - cmis:CreatedBy + rep-cmis:CreatedBy cmis:CreatedBy Description for cmis:CreatedBy string @@ -137,7 +123,7 @@ cmis:CreationDate - cmis:CreationDate + rep-cmis:CreationDate cmis:CreationDate Description for cmis:CreationDate datetime @@ -151,7 +137,7 @@ cmis:LastModifiedBy - cmis:LastModifiedBy + rep-cmis:LastModifiedBy cmis:LastModifiedBy Description for cmis:LastModifiedBy string @@ -166,7 +152,7 @@ cmis:LastModificationDate - cmis:LastModificationDate + rep-cmis:LastModificationDate cmis:LastModificationDate Description for cmis:LastModificationDate datetime @@ -180,7 +166,7 @@ cmis:ChangeToken - cmis:ChangeToken + rep-cmis:ChangeToken cmis:ChangeToken Description for cmis:ChangeToken string @@ -193,5 +179,33 @@ false 128 - + + cmis:ParentId + rep-cmis:ParentId + cmis:ParentId + Description for cmis:ParentId + id + single + readonly + true + false + true + true + false + + + cmis:AllowedChildObjectTypeNames + rep-cmis:AllowedChildObjectTypeNames + cmis:AllowedChildObjectTypeNames + Description for cmis:AllowedChildObjectTypeNames + id + multi + readwrite + true + false + true + true + false + + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWithout.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWithout.xml index 4ebb1e4789..b38227be64 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWithout.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeFolderWithout.xml @@ -13,18 +13,18 @@ - 2009-07-13T22:50:04.015-07:00 + 2009-07-17T09:13:33.187-07:00 HTML summary of Type Definition folder-invoice Type Definition - folder-invoice - 2009-07-13T22:50:04.015-07:00 - 2009-07-13T22:50:04.015-07:00 - + 2009-07-17T09:13:33.187-07:00 + 2009-07-17T09:13:33.187-07:00 + dtfolder-invoice myrepname-folder-invoice folder-invoice folder-invoice Description for type definition folder-invoice - cmis:folder + cmis:document parent true true @@ -33,5 +33,5 @@ true true true - + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWith.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWith.xml index 26298d32f9..6ace8bfce3 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWith.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWith.xml @@ -13,18 +13,18 @@ - 2009-07-13T22:50:04.062-07:00 + 2009-07-17T09:13:33.234-07:00 HTML summary of Type Definition security-policy Type Definition - security-policy - 2009-07-13T22:50:04.062-07:00 - 2009-07-13T22:50:04.062-07:00 - + 2009-07-17T09:13:33.234-07:00 + 2009-07-17T09:13:33.234-07:00 + dtsecurity-policy myrepname-security-policy security-policy security-policy Description for type definition security-policy - cmis:relationship + cmis:document parent true false @@ -33,24 +33,23 @@ true true true - - cmis:PolicyText - cmis:PolicyText - cmis:PolicyText - Description for cmis:PolicyText - string + + cmis:BaseTypeId + rep-cmis:BaseTypeId + cmis:BaseTypeId + Description for cmis:BaseTypeId + id single - readwrite + readonly true false true true false - 128 - + cmis:Name - cmis:Name + rep-cmis:Name cmis:Name Description for cmis:Name string @@ -65,7 +64,7 @@ cmis:ObjectId - cmis:ObjectId + rep-cmis:ObjectId cmis:ObjectId Description for cmis:ObjectId id @@ -79,7 +78,7 @@ cmis:ObjectTypeId - cmis:ObjectTypeId + rep-cmis:ObjectTypeId cmis:ObjectTypeId Description for cmis:ObjectTypeId string @@ -94,7 +93,7 @@ cmis:BaseTypeId - cmis:BaseTypeId + rep-cmis:BaseTypeId cmis:BaseTypeId Description for cmis:BaseTypeId string @@ -109,7 +108,7 @@ cmis:CreatedBy - cmis:CreatedBy + rep-cmis:CreatedBy cmis:CreatedBy Description for cmis:CreatedBy string @@ -124,7 +123,7 @@ cmis:CreationDate - cmis:CreationDate + rep-cmis:CreationDate cmis:CreationDate Description for cmis:CreationDate datetime @@ -138,7 +137,7 @@ cmis:LastModifiedBy - cmis:LastModifiedBy + rep-cmis:LastModifiedBy cmis:LastModifiedBy Description for cmis:LastModifiedBy string @@ -153,7 +152,7 @@ cmis:LastModificationDate - cmis:LastModificationDate + rep-cmis:LastModificationDate cmis:LastModificationDate Description for cmis:LastModificationDate datetime @@ -167,7 +166,7 @@ cmis:ChangeToken - cmis:ChangeToken + rep-cmis:ChangeToken cmis:ChangeToken Description for cmis:ChangeToken string @@ -180,5 +179,20 @@ false 128 - + + cmis:PolicyText + rep-cmis:PolicyText + cmis:PolicyText + Description for cmis:PolicyText + string + single + readwrite + true + false + true + true + false + 128 + + diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWithout.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWithout.xml index 555c70aa60..fce8e306cd 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWithout.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/examples/TypeRelationshipWithout.xml @@ -13,18 +13,18 @@ - 2009-07-13T22:50:04.046-07:00 + 2009-07-17T09:13:33.218-07:00 HTML summary of Type Definition security-policy Type Definition - security-policy - 2009-07-13T22:50:04.046-07:00 - 2009-07-13T22:50:04.062-07:00 - + 2009-07-17T09:13:33.218-07:00 + 2009-07-17T09:13:33.218-07:00 + dtsecurity-policy myrepname-security-policy security-policy security-policy Description for type definition security-policy - cmis:relationship + cmis:document parent true false @@ -33,5 +33,5 @@ true true true - + diff --git a/source/test-resources/cmis/cmis-api-context.xml b/source/test-resources/cmis/cmis-api-context.xml index f77def96d3..278888bfb7 100755 --- a/source/test-resources/cmis/cmis-api-context.xml +++ b/source/test-resources/cmis/cmis-api-context.xml @@ -10,7 +10,7 @@ - 0.61 + 0.62 workspace/SpacesStore/Company Home