mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged CMIS063 to HEAD
15327: 0.62 final update: Add feed links as per spec 15334: 0.62 final update: queries working again. 15350: 0.62 final update: query via GET 15362: 0.62 final update: query uri template and query result set feed as per 0.62 15434: Fix decoding issue retrieving query string of request. 15441: 0.62 final updates: fixes to allow CMIS Fileshare browsing git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
[#assign typedef = cmistype(object)]
|
||||
|
||||
[#list typedef.propertyDefinitions?values as propdef]
|
||||
[@filter propfilter propdef.propertyId.id][@prop propdef.propertyId.id object propdef.dataType/][/@filter]
|
||||
[@filter propfilter propdef.propertyId.id][@prop propdef.propertyId.id object propdef.dataType.label/][/@filter]
|
||||
[/#list]
|
||||
</cmis:properties>
|
||||
[/#macro]
|
||||
@@ -30,10 +30,10 @@
|
||||
<author><name>${node.properties.creator!""}</name></author>
|
||||
[@contentstream node/]
|
||||
<id>urn:uuid:${node.id}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[@linkstream node "enclosure"/]
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[@linkstream node "edit-media"/]
|
||||
[@linksLib.linknodeself node/]
|
||||
[@linksLib.linkstream node "enclosure"/]
|
||||
[@linksLib.linknodeedit node/]
|
||||
[@linksLib.linkstream node "edit-media"/]
|
||||
[@documentCMISLinks node=node/]
|
||||
<published>${xmldate(node.properties.created)}</published>
|
||||
<summary>[@contentsummary node/]</summary>
|
||||
@@ -49,12 +49,12 @@
|
||||
[/#macro]
|
||||
|
||||
[#macro documentCMISLinks node]
|
||||
[@linkallowableactions node/]
|
||||
[@linkrelationships node/]
|
||||
[@linkparents node/]
|
||||
[@linkversions node/]
|
||||
[@linktype node/]
|
||||
[@linkservice/]
|
||||
[@linksLib.linkallowableactions node/]
|
||||
[@linksLib.linkrelationships node/]
|
||||
[@linksLib.linkparents node/]
|
||||
[@linksLib.linkversions node/]
|
||||
[@linksLib.linktype node/]
|
||||
[@linksLib.linkservice/]
|
||||
[/#macro]
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<author><name>${node.properties.creator}</name></author>
|
||||
[@contentstream node/]
|
||||
<id>urn:uuid:${node.id}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[@linkstream node "enclosure"/]
|
||||
[@linksLib.linknodeself node/]
|
||||
[@linksLib.linkstream node "enclosure"/]
|
||||
[@documentCMISLinks node=node/]
|
||||
<published>${xmldate(node.properties.created)}</published>
|
||||
<summary>[@contentsummary node/]</summary>
|
||||
@@ -92,17 +92,17 @@
|
||||
<author><name>${node.properties.creator}</name></author>
|
||||
[@contentstream node/]
|
||||
<id>urn:uuid:${node.id}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}/api/pwc/[@noderef node/]"/>
|
||||
[@linkstream node "enclosure"/]
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[@linkstream node "edit-media"/]
|
||||
[#assign pwcuri]/api/pwc/[@linksLib.noderef node/][/#assign]
|
||||
[@linksLib.linkself href="${pwcuri}"/]
|
||||
[@linksLib.linkstream node "enclosure"/]
|
||||
[@linksLib.linknodeedit node/]
|
||||
[@linksLib.linkstream node "edit-media"/]
|
||||
[@documentCMISLinks node=node/]
|
||||
<published>${xmldate(node.properties.created)}</published>
|
||||
<summary>[@contentsummary node/]</summary>
|
||||
<title>${node.name}</title>
|
||||
<updated>${xmldate(node.properties.modified)}</updated>
|
||||
<app:edited>${xmldate(node.properties.modified)}</app:edited>
|
||||
[#-- TODO: the edit link refers to the updatable node resource, allowing updates on PWCs without checkin --]
|
||||
<alf:icon>${absurl(url.context)}${node.icon16}</alf:icon>
|
||||
<cmisra:object>
|
||||
[@objectCMISProps node propfilter/]
|
||||
@@ -125,8 +125,8 @@
|
||||
<author><name>${node.properties.creator}</name></author>
|
||||
<content>${node.id}</content> [#-- TODO --]
|
||||
<id>urn:uuid:${node.id}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[@linksLib.linknodeself node/]
|
||||
[@linksLib.linknodeedit node/]
|
||||
[@folderCMISLinks node/]
|
||||
<published>${xmldate(node.properties.created)}</published>
|
||||
<summary>${node.properties.description!node.properties.title!""}</summary> [#-- TODO --]
|
||||
@@ -143,7 +143,9 @@
|
||||
[#assign nested = cmischildren(node, typesfilter)/]
|
||||
[#if nested?size > 0]
|
||||
<cmisra:children>
|
||||
[@feedLib.node node "${nestedkind}"/]
|
||||
[@feedLib.node node "${nestedkind}"]
|
||||
[#if nestedkind == "tree"][@linksLib.linktree node "self"/][#else][@linksLib.linkdescendants node "self"/][/#if]
|
||||
[/@feedLib.node]
|
||||
[#list nested as child]
|
||||
[#if child.isDocument]
|
||||
[@document child propfilter includeallowableactions includerelationships/]
|
||||
@@ -158,16 +160,16 @@
|
||||
[/#macro]
|
||||
|
||||
[#macro folderCMISLinks node]
|
||||
[@linkallowableactions node/]
|
||||
[@linkrelationships node/]
|
||||
[@linksLib.linkallowableactions node/]
|
||||
[@linksLib.linkrelationships node/]
|
||||
[#if cmisproperty(node, cmisconstants.PROP_PARENT_ID)?is_string]
|
||||
[@linkparent node/]
|
||||
[@linksLib.linkparent node/]
|
||||
[/#if]
|
||||
[@linkchildren node/]
|
||||
[@linkdescendants node/]
|
||||
[@linktree node/]
|
||||
[@linktype node/]
|
||||
[@linkservice/]
|
||||
[@linksLib.linkchildren node/]
|
||||
[@linksLib.linkdescendants node/]
|
||||
[@linksLib.linktree node/]
|
||||
[@linksLib.linktype node/]
|
||||
[@linksLib.linkservice/]
|
||||
[/#macro]
|
||||
|
||||
|
||||
@@ -180,8 +182,8 @@
|
||||
<author><name>${xmldate(date)}</name></author> [#-- TODO: [@namedvalue cmisconstants.PROP_CREATED_BY assoc cmisconstants.DATATYPE_STRING/] --]
|
||||
<content>[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/]</content> [#-- TODO: spec id, how to map? --]
|
||||
<id>[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/]</id> [#-- TODO: id compliant --]
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@assocuri assoc/]"/>
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@assocuri assoc/]"/>
|
||||
[@linksLib.linkassocself assoc/]
|
||||
[@linksLib.linkassocedit assoc/]
|
||||
[@assocCMISLinks assoc=assoc/]
|
||||
<published>${xmldate(date)}</published> [#-- TODO: [@namedvalue cmisconstants.PROP_CREATION_DATE assoc cmisconstants.DATATYPE_DATETIME/] --]
|
||||
<summary>[@namedvalue cmisconstants.PROP_OBJECT_ID assoc cmisconstants.DATATYPE_ID/]</summary> [#-- TODO: spec id, how to map? --]
|
||||
@@ -197,10 +199,10 @@
|
||||
|
||||
[#macro assocCMISLinks assoc]
|
||||
[#-- TODO: <link rel="allowableactions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/permissions"/> --]
|
||||
[@linktype assoc/]
|
||||
[@linktosource assoc.source/]
|
||||
[@linktotarget assoc.target/]
|
||||
[@linkservice/]
|
||||
[@linksLib.linktype assoc/]
|
||||
[@linksLib.linktosource assoc.source/]
|
||||
[@linksLib.linktotarget assoc.target/]
|
||||
[@linksLib.linkservice/]
|
||||
[/#macro]
|
||||
|
||||
|
||||
@@ -211,23 +213,22 @@
|
||||
[#-- TODO: spec issue 47 --]
|
||||
[#macro row row includeallowableactions=false]
|
||||
[@entry]
|
||||
[#if row.nodes??]
|
||||
[#assign node = row.nodes?first]
|
||||
[#-- TODO: calculate multiNodeResultSet from result set --]
|
||||
[#if row.nodes?? && row.nodes?size == 1][#assign node = row.nodes?first/][/#if]
|
||||
[#if node??]
|
||||
<author><name>${node.properties.creator!""}</name></author>
|
||||
|
||||
[#-- TODO: review if consistent with ATOM --]
|
||||
[#if node.isDocument]
|
||||
[@contentstream node/]
|
||||
[#else]
|
||||
<content>${node.id}</content> [#-- TODO --]
|
||||
[/#if]
|
||||
|
||||
<id>urn:uuid:${node.id}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[@linksLib.linknodeself node/]
|
||||
[@linksLib.linknodeedit node/]
|
||||
[#if node.isDocument]
|
||||
[@linkstream node "enclosure"/]
|
||||
[@linkstream node "edit-media"/]
|
||||
[@linksLib.linkstream node "enclosure"/]
|
||||
[@linksLib.linkstream node "edit-media"/]
|
||||
[@documentCMISLinks node=node/]
|
||||
[#else]
|
||||
[@folderCMISLinks node=node/]
|
||||
@@ -235,10 +236,14 @@
|
||||
<title>${node.name}</title>
|
||||
<updated>${xmldate(node.properties.modified)}</updated>
|
||||
<alf:icon>${absurl(url.context)}${node.icon16}</alf:icon>
|
||||
[#else]
|
||||
<author><name>${person.properties.userName}</name></author>
|
||||
<id>urn:uuid:row-${row.index?c}</id>
|
||||
<title>Row ${row.index?c}</title>
|
||||
<updated>${xmldate(now)}</updated>
|
||||
[/#if]
|
||||
<cmisra:object>
|
||||
<cmis:properties>
|
||||
|
||||
[#assign rowvalues = row.values]
|
||||
[#list rowvalues?keys as colname]
|
||||
[#assign coltype = row.getColumnType(colname)]
|
||||
@@ -249,7 +254,7 @@
|
||||
[/#if]
|
||||
[/#list]
|
||||
</cmis:properties>
|
||||
[#if row.nodes?? && includeallowableactions][@allowableactions node/][/#if]
|
||||
[#if node?? && includeallowableactions][@allowableactions node/][/#if]
|
||||
</cmisra:object>
|
||||
[/@entry]
|
||||
[/#macro]
|
||||
@@ -273,39 +278,39 @@
|
||||
[/#macro]
|
||||
|
||||
[#macro propvalue name value type]
|
||||
[#if type.label == cmisconstants.DATATYPE_STRING]
|
||||
[#if type == cmisconstants.DATATYPE_STRING]
|
||||
<cmis:propertyString pdid="${name}">[@values value;v]<cmis:value>[@stringvalue v/]</cmis:value>[/@values]</cmis:propertyString>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_INTEGER]
|
||||
[#elseif type == cmisconstants.DATATYPE_INTEGER]
|
||||
<cmis:propertyInteger pdid="${name}">[@values value;v]<cmis:value>[@integervalue v/]</cmis:value>[/@values]</cmis:propertyInteger>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_DECIMAL]
|
||||
[#elseif type == cmisconstants.DATATYPE_DECIMAL]
|
||||
<cmis:propertyDecimal pdid="${name}">[@values value;v]<cmis:value>[@decimalvalue v/]</cmis:value>[/@values]</cmis:propertyDecimal>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_BOOLEAN]
|
||||
[#elseif type == cmisconstants.DATATYPE_BOOLEAN]
|
||||
<cmis:propertyBoolean pdid="${name}">[@values value;v]<cmis:value>[@booleanvalue v/]</cmis:value>[/@values]</cmis:propertyBoolean>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_DATETIME]
|
||||
[#elseif type == cmisconstants.DATATYPE_DATETIME]
|
||||
<cmis:propertyDateTime pdid="${name}">[@values value;v]<cmis:value>[@datetimevalue v/]</cmis:value>[/@values]</cmis:propertyDateTime>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_URI]
|
||||
[#elseif type == cmisconstants.DATATYPE_URI]
|
||||
[#-- TODO: check validity of abs url prefix --]
|
||||
<cmis:propertyUri pdid="${name}">[@values value;v]<cmis:value>[@urivalue absurl(url.serviceContext) + v/]</cmis:value>[/@values]</cmis:propertyUri>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_ID]
|
||||
[#elseif type == cmisconstants.DATATYPE_ID]
|
||||
<cmis:propertyId pdid="${name}">[@values value;v]<cmis:value>[@idvalue v/]</cmis:value>[/@values]</cmis:propertyId>
|
||||
[#-- TODO: remaining property types --]
|
||||
[/#if]
|
||||
[/#macro]
|
||||
|
||||
[#macro propnull name type]
|
||||
[#if type.label == cmisconstants.DATATYPE_STRING]
|
||||
[#if type == cmisconstants.DATATYPE_STRING]
|
||||
<cmis:propertyString pdid="${name}"/>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_INTEGER]
|
||||
[#elseif type == cmisconstants.DATATYPE_INTEGER]
|
||||
<cmis:propertyInteger pdid="${name}"/>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_DECIMAL]
|
||||
[#elseif type == cmisconstants.DATATYPE_DECIMAL]
|
||||
<cmis:propertyDecimal pdid="${name}"/>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_BOOLEAN]
|
||||
[#elseif type == cmisconstants.DATATYPE_BOOLEAN]
|
||||
<cmis:propertyBoolean pdid="${name}"/>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_DATETIME]
|
||||
[#elseif type == cmisconstants.DATATYPE_DATETIME]
|
||||
<cmis:propertyDateTime pdid="${name}"/>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_URI]
|
||||
[#elseif type == cmisconstants.DATATYPE_URI]
|
||||
<cmis:propertyUri pdid="${name}"/>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_ID]
|
||||
[#elseif type == cmisconstants.DATATYPE_ID]
|
||||
<cmis:propertyId pdid="${name}"/>
|
||||
[#-- TODO: remaining property types --]
|
||||
[/#if]
|
||||
@@ -380,7 +385,7 @@
|
||||
<author><name>${person.properties.userName}</name></author>
|
||||
<content>${typedefn.typeId.id}</content> [#-- TODO --]
|
||||
<id>urn:uuid:type-${typedefn.typeId.id}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}/api/type/${typedefn.typeId.id}"/>
|
||||
[@linksLib.linktypeself typedefn/]
|
||||
[@typedefCMISLinks typedefn/]
|
||||
<summary>[#if typedefn.description??]${typedefn.description?xml}[#else]${typedefn.displayName?xml}[/#if]</summary>
|
||||
<title>${typedefn.displayName}</title>
|
||||
@@ -391,7 +396,9 @@
|
||||
[#assign nested = typedefn.getSubTypes(false)/]
|
||||
[#if nested?size > 1]
|
||||
<cmisra:children>
|
||||
[@feedLib.typedef typedefn=typedefn kind="descendants" author="${person.properties.userName}"/]
|
||||
[@feedLib.generic "urn:uuid:type-${typedefn.typeId.id}-descendants" "Type ${typedefn.displayName} Descendants" "${person.properties.userName}"]
|
||||
[@linksLib.linktypedescendants typedefn "self"/]
|
||||
[/@feedLib.generic]
|
||||
[#list nested as child]
|
||||
[@typedef child includeProperties includeInheritedProperties ns depth+1 maxdepth/]
|
||||
[/#list]
|
||||
@@ -402,13 +409,13 @@
|
||||
[/#macro]
|
||||
|
||||
[#macro typedefCMISLinks typedef]
|
||||
[@linktype typedef/]
|
||||
[@linksLib.linktype typedef/]
|
||||
[#if typedef.parentType??]
|
||||
[@linktypeparent typedef/]
|
||||
[@linksLib.linktypeparent typedef/]
|
||||
[/#if]
|
||||
[@linktypechildren typedef/]
|
||||
[@linktypedescendants typedef/]
|
||||
[@linkservice/]
|
||||
[@linksLib.linktypechildren typedef/]
|
||||
[@linksLib.linktypedescendants typedef/]
|
||||
[@linksLib.linkservice/]
|
||||
[/#macro]
|
||||
|
||||
[#macro typedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
|
||||
@@ -424,30 +431,30 @@
|
||||
[/#macro]
|
||||
|
||||
[#macro documenttypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
|
||||
<cmisra:documentType>
|
||||
<cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cmis:cmisTypeDocumentDefinitionType">
|
||||
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
|
||||
<cmis:versionable>${typedef.versionable?string}</cmis:versionable>
|
||||
<cmis:contentStreamAllowed>${typedef.contentStreamAllowed.label}</cmis:contentStreamAllowed>
|
||||
</cmisra:documentType>
|
||||
</cmisra:type>
|
||||
[/#macro]
|
||||
|
||||
[#macro foldertypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
|
||||
<cmisra:folderType>
|
||||
<cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cmis:cmisTypeFolderDefinitionType">
|
||||
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
|
||||
</cmisra:folderType>
|
||||
</cmisra:type>
|
||||
[/#macro]
|
||||
|
||||
[#macro relationshiptypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
|
||||
<cmisra:relationshipType>
|
||||
<cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cmis:cmisTypeRelationshipDefinitionType">
|
||||
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
|
||||
[#-- TODO: source and target types --]
|
||||
</cmisra:relationshipType>
|
||||
</cmisra:type>
|
||||
[/#macro]
|
||||
|
||||
[#macro policytypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
|
||||
<cmisra:policyType>
|
||||
<cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cmis:cmisTypePolicyDefinitionType">
|
||||
[@objecttypedefCMISProps typedef includeProperties includeInheritedProperties/]
|
||||
</cmisra:policyType>
|
||||
</cmisra:type>
|
||||
[/#macro]
|
||||
|
||||
[#macro objecttypedefCMISProps typedef includeProperties=true includeInheritedProperties=true]
|
||||
@@ -576,7 +583,7 @@
|
||||
<cmis:required>${propdef.required?string}</cmis:required>
|
||||
<cmis:queryable>${propdef.queryable?string}</cmis:queryable>
|
||||
<cmis:orderable>${propdef.orderable?string}</cmis:orderable>
|
||||
[@cmisChoices propdef.choices propdef.dataType/]
|
||||
[@cmisChoices propdef.choices propdef.dataType.label/]
|
||||
<cmis:openChoice>${propdef.openChoice?string}</cmis:openChoice>
|
||||
[#if propdef.defaultValue??]
|
||||
[#-- TODO: defaults for HTML and XML property types --]
|
||||
@@ -587,37 +594,37 @@
|
||||
[#macro cmisChoices choices type]
|
||||
[#if choices?exists]
|
||||
[#list choices as choice]
|
||||
[#if type.label == cmisconstants.DATATYPE_STRING]
|
||||
[#if type == cmisconstants.DATATYPE_STRING]
|
||||
<cmis:choiceString cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
</cmis:choiceString>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_INTEGER]
|
||||
[#elseif type == cmisconstants.DATATYPE_INTEGER]
|
||||
<cmis:choiceInteger cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
</cmis:choiceInteger>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_DECIMAL]
|
||||
[#elseif type == cmisconstants.DATATYPE_DECIMAL]
|
||||
<cmis:choiceDecimal cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
</cmis:choiceDecimal>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_BOOLEAN]
|
||||
[#elseif type == cmisconstants.DATATYPE_BOOLEAN]
|
||||
<cmis:choiceBoolean cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
</cmis:choiceBoolean>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_DATETIME]
|
||||
[#elseif type == cmisconstants.DATATYPE_DATETIME]
|
||||
<cmis:choiceDateTime cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
</cmis:choiceDateTime>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_URI]
|
||||
[#elseif type == cmisconstants.DATATYPE_URI]
|
||||
<cmis:choiceUri cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
</cmis:choiceUri>
|
||||
[#elseif type.label == cmisconstants.DATATYPE_ID]
|
||||
[#elseif type == cmisconstants.DATATYPE_ID]
|
||||
<cmis:choiceId cmis:key="${choice.name}">
|
||||
[@cmisChoices choice.children type/]
|
||||
<cmis:value>[@stringvalue choice.value/]</cmis:value>
|
||||
@@ -629,91 +636,6 @@
|
||||
[/#macro]
|
||||
|
||||
|
||||
[#-- --]
|
||||
[#-- Link Relations --]
|
||||
[#-- --]
|
||||
|
||||
[#-- Link to repository service document --]
|
||||
[#macro linkservice]
|
||||
<link rel="${cmisconstants.REL_SERVICE}" href="${absurl(url.serviceContext)}/api/repository"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node allowable actions --]
|
||||
[#macro linkallowableactions node]
|
||||
<link rel="${cmisconstants.REL_ALLOWABLE_ACTIONS}" href="${absurl(url.serviceContext)}[@nodeuri node/]/allowableactions"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node relationships --]
|
||||
[#macro linkrelationships node]
|
||||
<link rel="${cmisconstants.REL_RELATIONSHIPS}" href="${absurl(url.serviceContext)}[@nodeuri node/]/rels"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node parents --]
|
||||
[#macro linkparents node]
|
||||
<link rel="${cmisconstants.REL_UP}" type="application/atom+xml;type=feed" href="${absurl(url.serviceContext)}[@nodeuri node/]/parents"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to folder parent --]
|
||||
[#macro linkparent node]
|
||||
<link rel="${cmisconstants.REL_UP}" type="application/atom+xml;type=entry" href="${absurl(url.serviceContext)}[@nodeuri node.parent/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node children --]
|
||||
[#macro linkchildren node]
|
||||
<link rel="${cmisconstants.REL_DOWN}" type="application/atom+xml;type=feed" href="${absurl(url.serviceContext)}[@nodeuri node/]/children"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node descendants --]
|
||||
[#macro linkdescendants node]
|
||||
<link rel="${cmisconstants.REL_DOWN}" type="application/cmistree+xml" href="${absurl(url.serviceContext)}[@nodeuri node/]/descendants"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node tree --]
|
||||
[#macro linktree node]
|
||||
<link rel="${cmisconstants.REL_FOLDER_TREE}" type="application/cmistree+xml" href="${absurl(url.serviceContext)}[@nodeuri node/]/tree"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node versions --]
|
||||
[#macro linkversions node]
|
||||
<link rel="${cmisconstants.REL_VERSION_HISTORY}" href="${absurl(url.serviceContext)}[@nodeuri node/]/versions"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to source node --]
|
||||
[#macro linktosource node]
|
||||
<link rel="${cmisconstants.REL_ASSOC_SOURCE}" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to target node --]
|
||||
[#macro linktotarget node]
|
||||
<link rel="${cmisconstants.REL_ASSOC_TARGET}" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to content stream --]
|
||||
[#macro linkstream node rel=""]
|
||||
<link[#if rel !=""] rel="${rel}"[/#if][#if node.mimetype??] type="${node.mimetype}"[/#if] href="[@contenturi node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node type --]
|
||||
[#macro linktype object]
|
||||
<link rel="${cmisconstants.REL_DESCRIBED_BY}" href="${absurl(url.serviceContext)}[@typeuri cmistype(object)/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to type parent --]
|
||||
[#macro linktypeparent typedef]
|
||||
<link rel="${cmisconstants.REL_UP}" type="application/atom+xml;type=entry" href="${absurl(url.serviceContext)}[@typeuri typedef.parentType/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to type children --]
|
||||
[#macro linktypechildren typedef]
|
||||
<link rel="${cmisconstants.REL_DOWN}" type="application/atom+xml;type=feed" href="${absurl(url.serviceContext)}[@typeuri typedef/]/children"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to type descendants --]
|
||||
[#macro linktypedescendants typedef]
|
||||
<link rel="${cmisconstants.REL_DOWN}" type="application/cmistree+xml" href="${absurl(url.serviceContext)}[@typeuri typedef/]/descendants"/>
|
||||
[/#macro]
|
||||
|
||||
|
||||
[#-- --]
|
||||
[#-- General Utils --]
|
||||
[#-- --]
|
||||
@@ -725,22 +647,4 @@
|
||||
[#macro contenttype type][#if type == "text/html"]text[#elseif type == "text/xhtml"]xhtml[#elseif type == "text/plain"]text<#else>${type}[/#if][/#macro]
|
||||
|
||||
[#-- Helper to render atom content element --]
|
||||
[#macro contentstream node]<content[#if node.mimetype??] type="${node.mimetype}"[/#if] src="[@contenturi node/]"/>[/#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]
|
||||
|
||||
[#-- Helper to render Alfresco service document uri --]
|
||||
[#macro serviceuri]${absurl(url.serviceContext)}/api/repository[/#macro]
|
||||
|
||||
[#-- Helper to render Node Ref --]
|
||||
[#macro noderef node]${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}[/#macro]
|
||||
|
||||
[#-- Helper to render Alfresco Node uri --]
|
||||
[#macro nodeuri node]/api/node/[@noderef node/][/#macro]
|
||||
|
||||
[#-- 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]
|
||||
[#macro contentstream node]<content[#if node.mimetype??] type="${node.mimetype}"[/#if] src="[@linksLib.contenturi node/]"/>[/#macro]
|
||||
|
@@ -20,7 +20,6 @@
|
||||
<generator version="${server.version}">Alfresco (${server.edition})</generator>
|
||||
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
|
||||
<id>${id}</id>
|
||||
<link rel="self" href="${absurl(encodeuri(url.full))?xml}"/>
|
||||
[#nested] [#-- NOTE: Custom links --]
|
||||
<title>${title}</title>
|
||||
<updated>${xmldate(date)}</updated>
|
||||
@@ -36,25 +35,7 @@
|
||||
<generator version="${server.version}">Alfresco (${server.edition})</generator>
|
||||
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
|
||||
<id>urn:uuid:${node.id}[#if kind != ""]-${kind}[/#if]</id>
|
||||
<link rel="self" href="${absurl(encodeuri(url.full))?xml}"/>
|
||||
<link rel="source" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}"/>
|
||||
[#nested] [#-- NOTE: Custom links --]
|
||||
<title>${node.name}[#if kind != ""] ${kind?capitalize}[/#if]</title>
|
||||
<updated>${xmldate(node.properties.modified)}</updated>
|
||||
[/#macro]
|
||||
|
||||
|
||||
[#-- --]
|
||||
[#-- ATOM Feed for Type Container --]
|
||||
[#-- --]
|
||||
|
||||
[#macro typedef typedefn kind="children" author="System"]
|
||||
<author><name>${author}</name></author>
|
||||
<generator version="${server.version}">Alfresco (${server.edition})</generator>
|
||||
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
|
||||
<id>urn:uuid:type-${typedefn.typeId.id}-${kind}</id>
|
||||
<link rel="self" href="${absurl(url.serviceContext)}/api/type/${typedefn.typeId.id}/${kind}"/>
|
||||
[#nested] [#-- NOTE: Custom links --]
|
||||
<title>${typedefn.displayName} ${kind?capitalize}</title>
|
||||
<updated>${xmldate(date)}</updated>
|
||||
[/#macro]
|
||||
|
@@ -0,0 +1,143 @@
|
||||
[#ftl]
|
||||
|
||||
[#-- --]
|
||||
[#-- Link Relations --]
|
||||
[#-- --]
|
||||
|
||||
[#-- Link to repository service document --]
|
||||
[#macro linkservice]
|
||||
<link rel="${cmisconstants.REL_SERVICE}" href="${absurl(url.serviceContext)}/api/repository"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node allowable actions --]
|
||||
[#macro linkallowableactions node]
|
||||
<link rel="${cmisconstants.REL_ALLOWABLE_ACTIONS}" href="${absurl(url.serviceContext)}[@nodeuri node/]/allowableactions"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node relationships --]
|
||||
[#macro linkrelationships node]
|
||||
<link rel="${cmisconstants.REL_RELATIONSHIPS}" href="${absurl(url.serviceContext)}[@nodeuri node/]/rels"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node parents --]
|
||||
[#macro linkparents node]
|
||||
<link rel="${cmisconstants.REL_UP}" href="${absurl(url.serviceContext)}[@nodeuri node/]/parents" type="${cmisconstants.MIMETYPE_FEED}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to folder parent --]
|
||||
[#macro linkparent node]
|
||||
<link rel="${cmisconstants.REL_UP}" href="${absurl(url.serviceContext)}[@nodeuri node.parent/]" type="${cmisconstants.MIMETYPE_ENTRY}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node children --]
|
||||
[#macro linkchildren node rel=""]
|
||||
<link rel="[#if rel == ""]${cmisconstants.REL_DOWN}[#else]${rel}[/#if]" href="${absurl(url.serviceContext)}[@nodeuri node/]/children" type="${cmisconstants.MIMETYPE_FEED}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node descendants --]
|
||||
[#macro linkdescendants node rel=""]
|
||||
<link rel="[#if rel == ""]${cmisconstants.REL_DOWN}[#else]${rel}[/#if]" href="${absurl(url.serviceContext)}[@nodeuri node/]/descendants" type="${cmisconstants.MIMETYPE_CMISTREE}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node tree --]
|
||||
[#macro linktree node rel=""]
|
||||
<link rel="[#if rel == ""]${cmisconstants.REL_FOLDER_TREE}[#else]${rel}[/#if]" href="${absurl(url.serviceContext)}[@nodeuri node/]/tree" type="${cmisconstants.MIMETYPE_CMISTREE}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node versions --]
|
||||
[#macro linkversions node]
|
||||
<link rel="${cmisconstants.REL_VERSION_HISTORY}" href="${absurl(url.serviceContext)}[@nodeuri node/]/versions"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to source node --]
|
||||
[#macro linktosource node]
|
||||
<link rel="${cmisconstants.REL_ASSOC_SOURCE}" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to target node --]
|
||||
[#macro linktotarget node]
|
||||
<link rel="${cmisconstants.REL_ASSOC_TARGET}" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to content stream --]
|
||||
[#macro linkstream node rel=""]
|
||||
<link[#if rel != ""] rel="${rel}"[/#if] href="[@contenturi node/]"[#if node.mimetype??] type="${node.mimetype}"[/#if]/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to node type --]
|
||||
[#macro linktype object]
|
||||
<link rel="${cmisconstants.REL_DESCRIBED_BY}" href="${absurl(url.serviceContext)}[@typeuri cmistype(object)/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to type parent --]
|
||||
[#macro linktypeparent typedef]
|
||||
<link rel="${cmisconstants.REL_UP}" href="${absurl(url.serviceContext)}[@typeuri typedef.parentType/]" type="${cmisconstants.MIMETYPE_ENTRY}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to type children --]
|
||||
[#macro linktypechildren typedef]
|
||||
<link rel="${cmisconstants.REL_DOWN}" href="${absurl(url.serviceContext)}[@typeuri typedef/]/children" type="${cmisconstants.MIMETYPE_FEED}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to type descendants --]
|
||||
[#macro linktypedescendants typedef rel=""]
|
||||
<link rel="[#if rel == ""]${cmisconstants.REL_DOWN}[#else]${rel}[/#if]" href="${absurl(url.serviceContext)}[@typeuri typedef/]/descendants" type="${cmisconstants.MIMETYPE_CMISTREE}"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to self --]
|
||||
[#macro linkself href="" type=""]
|
||||
<link rel="self" href="[#if href == ""]${absurl(encodeuri(url.full))?xml}[#else]${absurl(url.serviceContext)}${href}[/#if]"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#macro]
|
||||
|
||||
[#macro linknodeself node]
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#macro linkassocself assoc]
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@assocuri assoc/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#macro linktypeself typedef]
|
||||
<link rel="self" href="${absurl(url.serviceContext)}[@typeuri typedef/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to edit --]
|
||||
[#macro linkedit href="" type=""]
|
||||
<link rel="edit" href="[#if href == ""]${absurl(encodeuri(url.full))?xml}[#else]${absurl(url.serviceContext)}${href}[/#if]"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#macro]
|
||||
|
||||
[#macro linknodeedit node]
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#macro linkassocedit assoc]
|
||||
<link rel="edit" href="${absurl(url.serviceContext)}[@nodeuri node/]"/>
|
||||
[/#macro]
|
||||
|
||||
[#-- Link to via --]
|
||||
[#macro linkvia href="" type=""]
|
||||
<link rel="via" href="${absurl(url.serviceContext)}${href}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#macro]
|
||||
|
||||
|
||||
[#-- --]
|
||||
[#-- URLs --]
|
||||
[#-- --]
|
||||
|
||||
[#-- Helper to render Alfresco service document uri --]
|
||||
[#macro serviceuri]${absurl(url.serviceContext)}/api/repository[/#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]
|
||||
|
||||
[#-- Helper to render Node Ref --]
|
||||
[#macro noderef node]${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}[/#macro]
|
||||
|
||||
[#-- Helper to render Alfresco Node uri --]
|
||||
[#macro nodeuri node]/api/node/[@noderef node/][/#macro]
|
||||
|
||||
[#-- 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]
|
@@ -30,6 +30,36 @@
|
||||
[/#if]
|
||||
[/#macro]
|
||||
|
||||
[#macro linksredirect cursor serviceUrl urlargs="" type="" pageNo="pageNo" pageSize="pageSize" skipCount="skipCount" maxItems="maxItems"]
|
||||
[#if cursor.pageType = "PAGE"]
|
||||
[#if cursor.hasFirstPage]
|
||||
<link rel="first" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, pageNo, cursor.firstPage, pageSize, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#if cursor.hasLastPage]
|
||||
<link rel="last" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, pageNo, cursor.lastPage, pageSize, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#if cursor.hasPrevPage]
|
||||
<link rel="prev" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, pageNo, cursor.prevPage, pageSize, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#if cursor.hasNextPage]
|
||||
<link rel="next" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, pageNo, cursor.nextPage, pageSize, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#else]
|
||||
[#if cursor.hasFirstPage]
|
||||
<link rel="first" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, skipCount, cursor.firstPage, maxItems, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#if cursor.hasLastPage]
|
||||
<link rel="last" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, skipCount, cursor.lastPage, maxItems, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#if cursor.hasPrevPage]
|
||||
<link rel="prev" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, skipCount, cursor.prevPage, maxItems, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[#if cursor.hasNextPage]
|
||||
<link rel="next" href="${absurl(encodeuri(url.serviceContext + serviceUrl + "?" + argreplace(urlargs, skipCount, cursor.nextPage, maxItems, cursor.pageSize)))?xml}"[#if type != ""] type="${type}"[/#if]/>
|
||||
[/#if]
|
||||
[/#if]
|
||||
[/#macro]
|
||||
|
||||
[#macro opensearch cursor]
|
||||
[#-- NOTE: this macro requires the definition of xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" in --]
|
||||
[#-- the enclosing document --]
|
||||
|
@@ -1,11 +1,12 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service [@nsLib.serviceNS/]>
|
||||
<workspace cmis:id="${server.id}" cmis:repositoryRelationship="self">
|
||||
<atom:title>${server.name}</atom:title>
|
||||
|
||||
<collection href="${absurl(url.serviceContext)}/api/path/${encodeuri(defaultRootFolderPath)}/children" cmisra:collectionType="root">
|
||||
<collection href="${absurl(url.serviceContext)}[@linksLib.nodeuri defaultRootFolder/]/children" cmisra:collectionType="root">
|
||||
<atom:title>root collection</atom:title>
|
||||
</collection>
|
||||
<collection href="${absurl(url.serviceContext)}/api/types" cmisra:collectionType="types">
|
||||
@@ -13,20 +14,20 @@
|
||||
</collection>
|
||||
<collection href="${absurl(url.serviceContext)}/api/checkedout" cmisra:collectionType="checkedout">
|
||||
<atom:title>checkedout collection</atom:title>
|
||||
<accept>application/atom+xml;type=entry</accept>
|
||||
<accept>${cmisconstants.MIMETYPE_ENTRY}</accept>
|
||||
</collection>
|
||||
<collection href="${absurl(url.serviceContext)}/api/unfiled" cmisra:collectionType="unfiled">
|
||||
<atom:title>unfiled collection</atom:title>
|
||||
<accept>application/atom+xml;type=entry</accept>
|
||||
<accept>${cmisconstants.MIMETYPE_ENTRY}</accept>
|
||||
</collection>
|
||||
<collection href="${absurl(url.serviceContext)}/api/query" cmisra:collectionType="query">
|
||||
<collection href="${absurl(url.serviceContext)}/api/queries" cmisra:collectionType="query">
|
||||
<atom:title>query collection</atom:title>
|
||||
<accept>application/cmisquery+xml</accept>
|
||||
<accept>${cmisconstants.MIMETYPE_CMIS_QUERY}</accept>
|
||||
</collection>
|
||||
|
||||
<atom:link title="root folder tree" type="application/atom+xml;type=feed" rel="http://docs.oasis-open.org/ns/cmis/link/200901/foldertree" href="${absurl(url.serviceContext)}/api/path/${encodeuri(defaultRootFolderPath)}/tree"/>
|
||||
<atom:link title="root descendants" type="application/atom+xml;type=feed" rel="http://docs.oasis-open.org/ns/cmis/link/200901/rootdescendants" href="${absurl(url.serviceContext)}/api/path/${encodeuri(defaultRootFolderPath)}/descendants"/>
|
||||
<atom:link title="type descendants" type="application/atom+xml;type=feed" rel="http://docs.oasis-open.org/ns/cmis/link/200901/typesdescendants" href="${absurl(url.serviceContext)}/api/types/descendants"/>
|
||||
<atom:link title="root folder tree" type="${cmisconstants.MIMETYPE_CMISTREE}" rel="http://docs.oasis-open.org/ns/cmis/link/200901/foldertree" href="${absurl(url.serviceContext)}[@linksLib.nodeuri defaultRootFolder/]/tree"/>
|
||||
<atom:link title="root descendants" type="${cmisconstants.MIMETYPE_CMISTREE}" rel="http://docs.oasis-open.org/ns/cmis/link/200901/rootdescendants" href="${absurl(url.serviceContext)}[@linksLib.nodeuri defaultRootFolder/]/descendants"/>
|
||||
<atom:link title="type descendants" type="${cmisconstants.MIMETYPE_CMISTREE}" rel="http://docs.oasis-open.org/ns/cmis/link/200901/typesdescendants" href="${absurl(url.serviceContext)}/api/types/descendants"/>
|
||||
|
||||
<cmisra:repositoryInfo>
|
||||
<cmis:repositoryId>${server.id}</cmis:repositoryId>
|
||||
@@ -36,7 +37,7 @@
|
||||
<cmis:vendorName>Alfresco</cmis:vendorName>
|
||||
<cmis:productName>Alfresco Repository (${server.edition})</cmis:productName>
|
||||
<cmis:productVersion>${server.version}</cmis:productVersion>
|
||||
<cmis:rootFolderId>${absurl(url.serviceContext)}/api/path/${encodeuri(defaultRootFolderPath)}</cmis:rootFolderId>
|
||||
<cmis:rootFolderId>${absurl(url.serviceContext)}[@linksLib.nodeuri defaultRootFolder/]</cmis:rootFolderId>
|
||||
[#-- TODO: implement change log --]
|
||||
<cmis:latestChangeToken></cmis:latestChangeToken>
|
||||
<cmis:capabilities>
|
||||
@@ -64,7 +65,12 @@
|
||||
<cmisra:uritemplate>
|
||||
<cmisra:template>${absurl(url.serviceContext)}/api/node/{id}?filter={filter}&includeAllowableActions={includeAllowableActions}&includeRelationships={includeRelationships}</cmisra:template>
|
||||
<cmisra:type>entrybyid</cmisra:type>
|
||||
<cmisra:mediatype>application/atom+xml;type=entry</cmisra:mediatype>
|
||||
<cmisra:mediatype>${cmisconstants.MIMETYPE_ENTRY}</cmisra:mediatype>
|
||||
</cmisra:uritemplate>
|
||||
<cmisra:uritemplate>
|
||||
<cmisra:template>${absurl(url.serviceContext)}/api/query?q={q}&includeAllowableActions={includeAllowableActions?}&searchAllVersions={searchAllVersions?}&skipCount={skipCount?}&maxItems={maxItems?}</cmisra:template>
|
||||
<cmisra:type>query</cmisra:type>
|
||||
<cmisra:mediatype>${cmisconstants.MIMETYPE_FEED}</cmisra:mediatype>
|
||||
</cmisra:uritemplate>
|
||||
|
||||
</workspace>
|
@@ -33,7 +33,7 @@ Enum capabilityFulltext: nofulltext, fulltextonly, fulltextandstructured<br>
|
||||
</description>
|
||||
<url>/api/repository</url>
|
||||
<url>/api/cmis</url>
|
||||
<format default="atom"/>
|
||||
<format default="atomsvc"/>
|
||||
<authentication>user</authentication>
|
||||
<family>CMIS</family>
|
||||
</webscript>
|
@@ -0,0 +1,27 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#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]
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[#-- TODO: uuid --]
|
||||
[@feedLib.generic "urn:uuid:resultset" "Result set for ${statement}" "${person.properties.userName}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[@pagingLib.linksredirect cursor "${queryUri}" "${queryArgs}" "${cmisconstants.MIMETYPE_FEED}"/]
|
||||
[/@feedLib.generic]
|
||||
[@pagingLib.opensearch cursor/]
|
||||
|
||||
[#assign rs = cmisresultset(resultset)]
|
||||
[#list rs.rows as row]
|
||||
[@entryLib.row row=row includeallowableactions=includeAllowableActions/]
|
||||
[/#list]
|
||||
|
||||
</feed>
|
||||
|
||||
[/#compress]
|
@@ -1,14 +1,14 @@
|
||||
script:
|
||||
{
|
||||
// process query statement
|
||||
// <?xml version="1.0"?>
|
||||
// <query xmlns="http://docs.oasis-open.org/ns/cmis/core/200901">
|
||||
// <statement>SELECT name FROM DOCUMENT_OBJECT_TYPE</statement>
|
||||
// <searchAllVersions>false</searchAllVersions>
|
||||
// <pageSize>0</pageSize>
|
||||
// <skipCount>0</skipCount>
|
||||
// <returnAllowableActions>false</returnAllowableActions>
|
||||
// </query>
|
||||
// <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
// <cmis:query xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901">
|
||||
// <cmis:statement>SELECT * FROM Document</cmis:statement>
|
||||
// <cmis:searchAllVersions>true</cmis:searchAllVersions>
|
||||
// <cmis:maxItems>50</cmis:maxItems>
|
||||
// <cmis:skipCount>0</cmis:skipCount>
|
||||
// </cmis:query>
|
||||
|
||||
|
||||
// TODO: XML parsing need to be moved to Java
|
||||
|
||||
@@ -43,18 +43,35 @@ script:
|
||||
break script;
|
||||
}
|
||||
|
||||
// TODO: CMIS-124
|
||||
// include allowable actions
|
||||
var includeAllowableActions = cmisQuery.returnAllowableActions.toString();
|
||||
var includeAllowableActions = cmisQuery.includeAllowableActions.toString();
|
||||
model.includeAllowableActions = (includeAllowableActions == null || includeAllowableActions == "true" ? true : false);
|
||||
|
||||
// process paging
|
||||
var skipCount = parseInt(cmisQuery.skipCount);
|
||||
var pageSize = parseInt(cmisQuery.pageSize);
|
||||
var page = paging.createPageOrWindow(null, null, isNaN(skipCount) ? null : skipCount, isNaN(pageSize) ? null : pageSize);
|
||||
var maxItems = parseInt(cmisQuery.maxItems);
|
||||
var page = paging.createPageOrWindow(null, null, isNaN(skipCount) ? null : skipCount, isNaN(maxItems) ? null : maxItems);
|
||||
|
||||
// perform query
|
||||
var paged = cmis.query(model.statement, page);
|
||||
model.resultset = paged.result;
|
||||
model.cursor = paged.cursor;
|
||||
|
||||
// check includeFlags are valid for query
|
||||
var multiNodeResultSet = false; // todo: calculate from result set (for now, don't support joins)
|
||||
if (multiNodeResultSet && (model.includeAllowableActions))
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "Can't includeAllowableActions for multi-selector column result sets");
|
||||
break script;
|
||||
}
|
||||
|
||||
// construct query uri
|
||||
model.queryUri = "/api/query";
|
||||
model.queryArgs = cmis.ARG_QUERY_STATEMENT + "=" + model.statement;
|
||||
if (model.includeAllowableActions) model.queryArgs += "&" + cmis.ARG_INCLUDE_ALLOWABLE_ACTIONS + "=true";
|
||||
model.queryArgs += "&" + cmis.ARG_SKIP_COUNT + "=" + page.number;
|
||||
model.queryArgs += "&" + cmis.ARG_MAX_ITEMS + "=" + page.size;
|
||||
|
||||
// TODO: set Content-Location
|
||||
status.location = url.server + url.serviceContext + model.queryUri + "?" + model.queryArgs;
|
||||
}
|
@@ -29,7 +29,7 @@ It is recommended that “includeAllowableActions” be used with query statemen
|
||||
"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.<br>
|
||||
]]>
|
||||
</description>
|
||||
<url>/api/query</url>
|
||||
<url>/api/queries</url>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readonly"/>
|
||||
<format default="atomfeed"/>
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#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/]
|
||||
@@ -10,6 +11,8 @@
|
||||
|
||||
[#-- TODO: uuid --]
|
||||
[@feedLib.generic "urn:uuid:resultset" "Result set for ${statement}" "${person.properties.userName}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[@pagingLib.links cursor/]
|
||||
[/@feedLib.generic]
|
||||
[@pagingLib.opensearch cursor/]
|
@@ -0,0 +1,37 @@
|
||||
<webscript>
|
||||
<shortname>Issue ad-hoc query (query)</shortname>
|
||||
<description>
|
||||
<![CDATA[
|
||||
Queries the repository for queryable object based on properties or an optional full-text string. Relationship objects are not queryable. Content-streams are not returned as part of query.<br>
|
||||
<br>
|
||||
Inputs:<br>
|
||||
<br>
|
||||
String statement: Query statement<br>
|
||||
(Optional) Bool searchAllVersions: False (Default)<br>
|
||||
(Optional) Boolean includeAllowableActions: False (default)<br>
|
||||
(Optional) Enum includeRelationships: none (default), source, target, both<br>
|
||||
(Optional) int maxItems: 0 = Repository-default number of items (Default)<br>
|
||||
(Optional) int skipCount: 0 = Start at first position (Default)<br>
|
||||
<br>
|
||||
Outputs:<br>
|
||||
<br>
|
||||
Collection objectCollection - this collection represents a result table produced by the query statement. Typically each row of this table corresponds to an object, and each column corresponds to a property or a computed value as specified by the SELECT clause of the query statement. A CMIS SQL 1.0 query without JOIN always produces one object per row.<br>
|
||||
Bool hasMoreItems<br>
|
||||
<br>
|
||||
Notes:<br>
|
||||
<br>
|
||||
If SearchAllVersions is True, and CONTAINS() is used in the query, OperationNotSupported will be thrown if full-text search is not supported or if the repository does not have previous versions in the full-text index.<br>
|
||||
Returns set of objects from (skipCount, maxItems+skipCount)<br>
|
||||
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.<br>
|
||||
If “includeAllowableActions” is TRUE, the repository will return the allowable actions for the current user for each result object in the output table as an additional multi-valued column containing computed values of type string, provided that each row in the output table indeed corresponds to one object (which is true for a CMIS SQL 1.0 query without JOIN).<br>
|
||||
If each row in the output table does not correspond to a specific object and “includeAllowableActions” is TRUE, then InvalidArgumentException will be thrown.<br>
|
||||
It is recommended that “includeAllowableActions” be used with query statements without JOIN, and that the Object ID property or “*” be included in the SELECT list.<br>
|
||||
"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.<br>
|
||||
]]>
|
||||
</description>
|
||||
<url>/api/query?q={q}&includeAllowableActions={includeAllowableActions?}&searchAllVersions={searchAllVersions?}&skipCount={skipCount?}&maxItems={maxItems?}</url>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readonly"/>
|
||||
<format default="atomfeed"/>
|
||||
<family>CMIS</family>
|
||||
</webscript>
|
@@ -0,0 +1,46 @@
|
||||
script:
|
||||
{
|
||||
// process query statement
|
||||
// <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
// <cmis:query xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901">
|
||||
// <cmis:statement>SELECT * FROM Document</cmis:statement>
|
||||
// <cmis:searchAllVersions>true</cmis:searchAllVersions>
|
||||
// <cmis:maxItems>50</cmis:maxItems>
|
||||
// <cmis:skipCount>0</cmis:skipCount>
|
||||
// </cmis:query>
|
||||
|
||||
|
||||
// extract query statement
|
||||
model.statement = args.q;
|
||||
if (model.statement == null || model.statement.length == 0)
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "Query statement must be provided");
|
||||
break script;
|
||||
}
|
||||
|
||||
// process search all versions (NOTE: not supported)
|
||||
var searchAllVersions = args.searchAllVersions;
|
||||
if (searchAllVersions != null && searchAllVersions === "true")
|
||||
{
|
||||
status.setCode(status.STATUS_INTERNAL_SERVER_ERROR, "Search all versions not supported");
|
||||
break script;
|
||||
}
|
||||
|
||||
// include allowable actions
|
||||
var includeAllowableActions = args[cmis.ARG_INCLUDE_ALLOWABLE_ACTIONS];
|
||||
model.includeAllowableActions = (includeAllowableActions == "true" ? true : false);
|
||||
|
||||
// perform query
|
||||
var page = paging.createPageOrWindow(args);
|
||||
var paged = cmis.query(model.statement, page);
|
||||
model.resultset = paged.result;
|
||||
model.cursor = paged.cursor;
|
||||
|
||||
// check includeFlags are valid for query
|
||||
var multiNodeResultSet = false; // TODO: calculate from result set (for now, don't support joins)
|
||||
if (!multiNodeResultSet && (model.includeAllowableActions))
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "Can't includeAllowableActions for multi-selector column result sets");
|
||||
break script;
|
||||
}
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#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/]
|
||||
@@ -9,6 +10,8 @@
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.generic "urn:uuid:checkedout" "Checked out Documents" "${person.properties.userName}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[@pagingLib.links cursor/]
|
||||
[/@feedLib.generic]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#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/]
|
||||
@@ -9,6 +10,15 @@
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.node node "children"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign nodeuri][@linksLib.nodeuri node/][/#assign]
|
||||
[@linksLib.linkvia href="${nodeuri}"/]
|
||||
[#if cmisproperty(node, cmisconstants.PROP_PARENT_ID)?is_string]
|
||||
[@linksLib.linkchildren node.parent "${cmisconstants.REL_UP}"/]
|
||||
[/#if]
|
||||
[@linksLib.linkdescendants node/]
|
||||
[@linksLib.linktree node/]
|
||||
[@pagingLib.links cursor/]
|
||||
[/@feedLib.node]
|
||||
[@pagingLib.opensearch cursor/]
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
@@ -7,7 +8,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.node node "descendants"/]
|
||||
[@feedLib.node node "descendants"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign nodeuri][@linksLib.nodeuri node/][/#assign]
|
||||
[@linksLib.linkvia href="${nodeuri}"/]
|
||||
[#if cmisproperty(node, cmisconstants.PROP_PARENT_ID)?is_string]
|
||||
[@linksLib.linkchildren node.parent "${cmisconstants.REL_UP}"/]
|
||||
[/#if]
|
||||
[@linksLib.linkchildren node/]
|
||||
[@linksLib.linktree node/]
|
||||
[/@feedLib.node]
|
||||
|
||||
[#if depth > 0 || depth == -1]
|
||||
[#list cmischildren(node, typesFilter) as child]
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
@@ -8,7 +9,12 @@
|
||||
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.node node "parents"/]
|
||||
[@feedLib.node node "parents"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign nodeuri][@linksLib.nodeuri node/][/#assign]
|
||||
[@linksLib.linkvia href="${nodeuri}"/]
|
||||
[/@feedLib.node]
|
||||
|
||||
[#if parent?? && parent.isContainer]
|
||||
[@entryLib.folder node=parent propfilter=filter includeallowableactions=includeAllowableActions includerelationships="none"/]
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#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/]
|
||||
@@ -9,6 +10,10 @@
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.node node "relationships"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign nodeuri][@linksLib.nodeuri node/][/#assign]
|
||||
[@linksLib.linkvia href="${nodeuri}"/]
|
||||
[@pagingLib.links cursor/]
|
||||
[/@feedLib.node]
|
||||
[@pagingLib.opensearch cursor/]
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
@@ -7,7 +8,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.node node "tree"/]
|
||||
[@feedLib.node node "tree"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign nodeuri][@linksLib.nodeuri node/][/#assign]
|
||||
[@linksLib.linkvia href="${nodeuri}"/]
|
||||
[#if cmisproperty(node, cmisconstants.PROP_PARENT_ID)?is_string]
|
||||
[@linksLib.linkchildren node.parent "${cmisconstants.REL_UP}"/]
|
||||
[/#if]
|
||||
[@linksLib.linkchildren node/]
|
||||
[@linksLib.linkdescendants node/]
|
||||
[/@feedLib.node]
|
||||
|
||||
[#if depth > 0 || depth == -1]
|
||||
[#list cmischildren(node, "folders") as child]
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#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/]
|
||||
@@ -8,14 +9,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[#assign title][#if type = "base"]Base Types[#else]Type ${type}[/#if][/#assign]
|
||||
[@feedLib.generic "urn:uuid:types-${type}" "${title}" "${person.properties.userName}"]
|
||||
[#assign title][#if typedef??]Type ${typedef.displayName}[#else]Base Types[/#if][/#assign]
|
||||
[#assign id][#if typedef??]urn:uuid:types-${typedef.typeId.id}[#else]urn:uuid:types-base[/#if][/#assign]
|
||||
|
||||
[@feedLib.generic "${id}" "${title}" "${person.properties.userName}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#if typedef??]
|
||||
[#assign typeuri][@linksLib.typeuri typedef/][/#assign]
|
||||
[@linksLib.linkvia href="${typeuri}"/]
|
||||
[@linksLib.linktypedescendants typedef/]
|
||||
[/#if]
|
||||
[@pagingLib.links cursor/]
|
||||
[/@feedLib.generic]
|
||||
[@pagingLib.opensearch cursor/]
|
||||
|
||||
[#list results as child]
|
||||
[@entryLib.typedef child returnPropertyDefinitions/]
|
||||
[@entryLib.typedef child includePropertyDefinitions/]
|
||||
[/#list]
|
||||
|
||||
</feed>
|
||||
|
@@ -12,7 +12,7 @@ script:
|
||||
var paged = cmis.queryTypeChildren(null, page);
|
||||
model.results = paged.results;
|
||||
model.cursor = paged.cursor;
|
||||
model.type = "base";
|
||||
model.typedef = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -28,10 +28,10 @@ script:
|
||||
var paged = cmis.queryTypeChildren(typedef, page);
|
||||
model.results = paged.results;
|
||||
model.cursor = paged.cursor;
|
||||
model.type = typeId;
|
||||
model.typedef = typedef;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
@@ -10,17 +11,29 @@
|
||||
[#if depth > 0 || depth == -1]
|
||||
|
||||
[#if typedef??]
|
||||
[@feedLib.typedef typedefn=typedef kind="descendants" author="${person.properties.userName}"/]
|
||||
|
||||
[@feedLib.generic "urn:uuid:type-${typedef.typeId.id}-descendants" "Type ${typedef.displayName} Descendants" "${person.properties.userName}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign typeuri][@linksLib.typeuri typedef/][/#assign]
|
||||
[@linksLib.linkvia href="${typeuri}"/]
|
||||
[@linksLib.linktypechildren typedef/]
|
||||
[/@feedLib.generic]
|
||||
[#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}"/]
|
||||
|
||||
[@feedLib.generic "urn:uuid:types-all" "All Types" "${person.properties.userName}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[/@feedLib.generic]
|
||||
[#list basetypes as child]
|
||||
[@entryLib.typedef typedefn=child includeProperties=includePropertyDefinitions depth=1 maxdepth=depth/]
|
||||
[/#list]
|
||||
[/#if]
|
||||
|
||||
[/#if]
|
||||
[/#if]
|
||||
|
||||
</feed>
|
||||
|
@@ -1,12 +1,16 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
|
||||
[#compress]
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<feed [@nsLib.feedNS/]>
|
||||
[@feedLib.generic "urn:uuid:unfiled" "Unfiled Documents"/]
|
||||
[@feedLib.generic "urn:uuid:unfiled" "Unfiled Documents"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[/@feedLib.generic]
|
||||
</feed>
|
||||
|
||||
[/#compress]
|
@@ -1,5 +1,6 @@
|
||||
[#ftl]
|
||||
[#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/]
|
||||
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
|
||||
[#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/]
|
||||
[#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/]
|
||||
[#compress]
|
||||
@@ -8,7 +9,12 @@
|
||||
|
||||
<feed [@nsLib.feedNS/]>
|
||||
|
||||
[@feedLib.generic "urn:uuid:${node.id}-versions" "Versions of ${node.displayPath}"/]
|
||||
[@feedLib.generic "urn:uuid:${node.id}-versions" "Versions of ${node.displayPath}"]
|
||||
[@linksLib.linkservice/]
|
||||
[@linksLib.linkself/]
|
||||
[#assign nodeuri][@linksLib.nodeuri node/][/#assign]
|
||||
[@linksLib.linkvia href="${nodeuri}"/]
|
||||
[/@feedLib.generic]
|
||||
|
||||
[#list nodes as version]
|
||||
[@entryLib.version version versions[version_index]/]
|
||||
|
@@ -62,7 +62,7 @@ public class CMISQueryReader implements FormatReader<String>
|
||||
*/
|
||||
public String getSourceMimetype()
|
||||
{
|
||||
return CMISConstants.MIMETYPE_QUERY;
|
||||
return CMISConstants.MIMETYPE_CMIS_QUERY;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@@ -40,6 +40,7 @@ import org.alfresco.cmis.CMISResultSet;
|
||||
import org.alfresco.cmis.CMISServices;
|
||||
import org.alfresco.cmis.CMISTypeDefinition;
|
||||
import org.alfresco.cmis.CMISTypesFilterEnum;
|
||||
import org.alfresco.cmis.CMISQueryOptions.CMISQueryMode;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.jscript.Association;
|
||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||
@@ -84,6 +85,7 @@ public class CMISScript extends BaseScopableProcessorExtension
|
||||
public static final String ARG_MAJOR_VERSION = "majorVersion";
|
||||
public static final String ARG_MAX_ITEMS = "maxItems";
|
||||
public static final String ARG_OFFSET = "offset";
|
||||
public static final String ARG_QUERY_STATEMENT = "q";
|
||||
public static final String ARG_REMOVE_FROM = "removeFrom";
|
||||
public static final String ARG_RELATIONSHIP_TYPE = "relationshipType";
|
||||
public static final String ARG_REPOSITORY_ID = "repositoryId";
|
||||
@@ -554,6 +556,7 @@ public class CMISScript extends BaseScopableProcessorExtension
|
||||
public PagedResults query(String statement, Page page)
|
||||
{
|
||||
CMISQueryOptions options = new CMISQueryOptions(statement, cmisService.getDefaultRootStoreRef());
|
||||
options.setQueryMode(CMISQueryMode.CMS_WITH_ALFRESCO_EXTENSIONS);
|
||||
options.setSkipCount(page.getNumber());
|
||||
options.setMaxItems(page.getSize());
|
||||
CMISResultSet resultSet = cmisQueryService.query(options);
|
||||
|
@@ -231,7 +231,7 @@ public class CMISTemplateResultSet implements Serializable
|
||||
public String getColumnType(String colName)
|
||||
{
|
||||
CMISResultSetColumn col = resultSet.getMetaData().getColumn(colName);
|
||||
return col == null ? null : col.getCMISDataType().name();
|
||||
return col == null ? null : col.getCMISDataType().getLabel();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -273,7 +273,7 @@ public class CMISCustomTypeTest extends BaseCMISWebScriptTest
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "5");
|
||||
|
||||
// issue structured query
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
|
@@ -1274,13 +1274,13 @@ public class CMISTest extends BaseCMISWebScriptTest
|
||||
{
|
||||
{
|
||||
// meta data only query against folder
|
||||
String query = "SELECT * FROM Folder " +
|
||||
"WHERE ObjectId = '" + testFolderObject.getObjectId().getStringValue() + "'";
|
||||
String query = "SELECT * FROM cmis:folder " +
|
||||
"WHERE cmis:ObjectId = '" + testFolderObject.getObjectId().getStringValue() + "'";
|
||||
String queryReq = queryDoc.replace("${STATEMENT}", query);
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", "0");
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "5");
|
||||
queryReq = queryReq.replace("${MAXITEMS}", "5");
|
||||
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
@@ -1294,14 +1294,14 @@ public class CMISTest extends BaseCMISWebScriptTest
|
||||
|
||||
{
|
||||
// meta data only query against document
|
||||
String query = "SELECT * FROM Document " +
|
||||
String query = "SELECT * FROM cmis:document " +
|
||||
"WHERE IN_FOLDER('" + testFolderObject.getObjectId().getStringValue() + "') " +
|
||||
"AND Name = 'apple1'";
|
||||
"AND cmis:Name = 'apple1'";
|
||||
String queryReq = queryDoc.replace("${STATEMENT}", query);
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", "0");
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "5");
|
||||
queryReq = queryReq.replace("${MAXITEMS}", "5");
|
||||
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
@@ -1317,13 +1317,13 @@ public class CMISTest extends BaseCMISWebScriptTest
|
||||
if (queryCapability.equals("fulltextonly") || queryCapability.equals("bothseperate") || queryCapability.equals("bothcombined"))
|
||||
{
|
||||
// full text only query
|
||||
String query = "SELECT ObjectId, ObjectTypeId, Name FROM Document " +
|
||||
String query = "SELECT cmis:ObjectId, cmis:ObjectTypeId, cmis:Name FROM cmis:document " +
|
||||
"WHERE CONTAINS('" + doc2name + "')";
|
||||
String queryReq = queryDoc.replace("${STATEMENT}", query);
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", "0");
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "5");
|
||||
queryReq = queryReq.replace("${MAXITEMS}", "5");
|
||||
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
@@ -1338,15 +1338,15 @@ public class CMISTest extends BaseCMISWebScriptTest
|
||||
if (queryCapability.equals("bothcombined"))
|
||||
{
|
||||
// combined meta data and full text
|
||||
String query = "SELECT ObjectId, ObjectTypeId, Name FROM Document " +
|
||||
String query = "SELECT cmis:ObjectId, cmis:ObjectTypeId, cmis:Name FROM cmis:document " +
|
||||
"WHERE IN_FOLDER('" + testFolderObject.getObjectId().getStringValue() + "') " +
|
||||
"AND Name = 'apple1' " +
|
||||
"AND cmis:Name = 'apple1' " +
|
||||
"AND CONTAINS('apple1')";
|
||||
String queryReq = queryDoc.replace("${STATEMENT}", query);
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", "0");
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "5");
|
||||
queryReq = queryReq.replace("${MAXITEMS}", "5");
|
||||
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
@@ -1386,26 +1386,52 @@ public class CMISTest extends BaseCMISWebScriptTest
|
||||
// query children
|
||||
String queryDoc = loadString("/org/alfresco/repo/cmis/rest/test/query.cmisquery.xml");
|
||||
CMISObject testFolderObject = testFolder.getExtension(CMISConstants.OBJECT);
|
||||
String query = "SELECT ObjectId, ObjectTypeId, Name FROM Document " + "WHERE IN_FOLDER('" + testFolderObject.getObjectId().getStringValue() + "')";
|
||||
|
||||
for (int page = 0; page < 4; page++)
|
||||
{
|
||||
String query = "SELECT cmis:ObjectId, cmis:ObjectTypeId, cmis:Name FROM cmis:document " + "WHERE IN_FOLDER('" + testFolderObject.getObjectId().getStringValue() + "')";
|
||||
String queryReq = queryDoc.replace("${STATEMENT}", query);
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", new Integer(page * 4).toString());
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "4");
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", "0");
|
||||
queryReq = queryReq.replace("${MAXITEMS}", "4");
|
||||
|
||||
// issue query
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
|
||||
// retrieve entries for first page
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
assertEquals(page < 3 ? 4 : 3, queryFeed.getEntries().size());
|
||||
|
||||
int page = 0;
|
||||
Link nextLink = null;
|
||||
do
|
||||
{
|
||||
page++;
|
||||
assertEquals(page < 4 ? 4 : 3, queryFeed.getEntries().size());
|
||||
|
||||
// mark entries as read
|
||||
for (Entry entry : queryFeed.getEntries())
|
||||
{
|
||||
docIds.remove(entry.getId());
|
||||
}
|
||||
|
||||
// next page
|
||||
nextLink = queryFeed.getLink("next");
|
||||
if (page == 4)
|
||||
{
|
||||
assertNull(nextLink);
|
||||
}
|
||||
else
|
||||
{
|
||||
assertNotNull(nextLink);
|
||||
}
|
||||
|
||||
if (nextLink != null)
|
||||
{
|
||||
queryFeed = getFeed(nextLink.getHref());
|
||||
assertNotNull(queryFeed);
|
||||
}
|
||||
}
|
||||
while (nextLink != null);
|
||||
|
||||
assertEquals(4, page);
|
||||
assertEquals(0, docIds.size());
|
||||
}
|
||||
|
||||
@@ -1444,15 +1470,15 @@ public class CMISTest extends BaseCMISWebScriptTest
|
||||
|
||||
{
|
||||
// construct structured query
|
||||
String query = "SELECT * FROM Document " +
|
||||
String query = "SELECT * FROM cmis:document " +
|
||||
"WHERE IN_FOLDER('" + testFolderObject.getObjectId().getStringValue() + "') ";
|
||||
String queryReq = queryDoc.replace("${STATEMENT}", query);
|
||||
queryReq = queryReq.replace("${INCLUDEALLOWABLEACTIONS}", "true");
|
||||
queryReq = queryReq.replace("${SKIPCOUNT}", "0");
|
||||
queryReq = queryReq.replace("${PAGESIZE}", "5");
|
||||
queryReq = queryReq.replace("${MAXITEMS}", "5");
|
||||
|
||||
// issue structured query
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_QUERY), 200);
|
||||
Response queryRes = sendRequest(new PostRequest(queryHREF.toString(), queryReq, CMISConstants.MIMETYPE_CMIS_QUERY), 200);
|
||||
assertNotNull(queryRes);
|
||||
Feed queryFeed = getAbdera().parseFeed(new StringReader(queryRes.getContentAsString()), null);
|
||||
assertNotNull(queryFeed);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<cmis:query xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901" >
|
||||
<cmis:statement><![CDATA[${STATEMENT}]]></cmis:statement>
|
||||
<cmis:skipCount>${SKIPCOUNT}</cmis:skipCount>
|
||||
<cmis:pageSize>${PAGESIZE}</cmis:pageSize>
|
||||
<cmis:maxItems>${MAXITEMS}</cmis:maxItems>
|
||||
</cmis:query>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<cmis:query xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200901" >
|
||||
<cmis:statement><![CDATA[${STATEMENT}]]></cmis:statement>
|
||||
<cmis:returnAllowableActions>${INCLUDEALLOWABLEACTIONS}</cmis:returnAllowableActions>
|
||||
<cmis:includeAllowableActions>${INCLUDEALLOWABLEACTIONS}</cmis:includeAllowableActions>
|
||||
<cmis:skipCount>${SKIPCOUNT}</cmis:skipCount>
|
||||
<cmis:pageSize>${PAGESIZE}</cmis:pageSize>
|
||||
<cmis:maxItems>${MAXITEMS}</cmis:maxItems>
|
||||
</cmis:query>
|
||||
|
@@ -152,10 +152,6 @@ public class Paging
|
||||
* skipCount => row number start index
|
||||
* maxItems => size of page
|
||||
*
|
||||
* - header values
|
||||
* CMIS-skipCount => row number start index
|
||||
* CMIS-maxItems => size of page
|
||||
*
|
||||
* @param args request args
|
||||
* @return page (if pageNumber driven) or window (if skipCount driven)
|
||||
*/
|
||||
@@ -253,7 +249,7 @@ public class Paging
|
||||
*/
|
||||
public Page createUnlimitedPage()
|
||||
{
|
||||
return new Page(PageType.PAGE, zeroBasedPage, zeroBasedPage ? 0 : 1, 0);
|
||||
return new Page(PageType.PAGE, zeroBasedPage, zeroBasedPage ? 0 : 1, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user