mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge from SEAMIST3
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10725 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="source/java"/>
|
<classpathentry kind="src" path="source/java"/>
|
||||||
<classpathentry kind="src" path="source/xsd"/>
|
|
||||||
<classpathentry kind="src" path="source/generated"/>
|
<classpathentry kind="src" path="source/generated"/>
|
||||||
<classpathentry kind="src" path="source/test/java"/>
|
<classpathentry kind="src" path="source/test/java"/>
|
||||||
<classpathentry kind="src" path="source/test-resources"/>
|
<classpathentry kind="src" path="source/test-resources"/>
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
|
|
||||||
<#-- -->
|
<#-- -->
|
||||||
<#-- ATOM Entry for Document -->
|
<#-- ATOM Entry for Document -->
|
||||||
<#-- -->
|
<#-- -->
|
||||||
@@ -11,33 +13,14 @@
|
|||||||
<summary>${node.properties.description!node.properties.title!cropContent(node, 50)}</summary>
|
<summary>${node.properties.description!node.properties.title!cropContent(node, 50)}</summary>
|
||||||
<title>${node.name}</title>
|
<title>${node.name}</title>
|
||||||
<updated>${xmldate(node.properties.modified)}</updated>
|
<updated>${xmldate(node.properties.modified)}</updated>
|
||||||
<link rel="self" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}" type="entry"/>
|
<link rel="self" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}"/>
|
||||||
<link rel="enclosure" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content" type="${node.mimetype}"/>
|
<link rel="enclosure" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content" type="${node.mimetype}"/>
|
||||||
<#-- ATOM Publishing Protocol -->
|
<#-- ATOM Publishing Protocol -->
|
||||||
<app:edited>${xmldate(node.properties.modified)}</app:edited>
|
<app:edited>${xmldate(node.properties.modified)}</app:edited>
|
||||||
<link rel="edit" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}" type="entry"/>
|
<link rel="edit" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}"/>
|
||||||
<link rel="edit-media" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content" type="${node.mimetype}"/>
|
<link rel="edit-media" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content" type="${node.mimetype}"/>
|
||||||
<#-- Alfresco props -->
|
<#-- Alfresco props -->
|
||||||
<alf:icon>${absurl(url.context)}${node.icon16}</alf:icon>
|
<alf:icon>${absurl(url.context)}${node.icon16}</alf:icon>
|
||||||
<#-- CMIS Schema -->
|
|
||||||
<link rel="cmis-allowableactions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/permissions" type="entry"/>
|
|
||||||
<link rel="cmis-relationships" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/associations" type="feed"/>
|
|
||||||
<link rel="cmis-parents" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/parents" type="feed"/>
|
|
||||||
<link rel="cmis-allversions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/versions" type="feed"/>
|
|
||||||
<link rel="cmis-stream" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content" type="${node.mimetype}"/>
|
|
||||||
<cmis:object>
|
|
||||||
<cmis:object_id>${node.nodeRef}</cmis:object_id>
|
|
||||||
<cmis:baseType>document</cmis:baseType>
|
|
||||||
<cmis:createdBy>${node.properties.creator}</cmis:createdBy>
|
|
||||||
<cmis:creationDate>${xmldate(node.properties.created)}</cmis:creationDate>
|
|
||||||
<cmis:lastModifiedBy>${node.properties.modifier}</cmis:lastModifiedBy>
|
|
||||||
<cmis:lastModificationDate>${xmldate(node.properties.modified)}</cmis:lastModificationDate>
|
|
||||||
<cmis:contentStreamLength>${node.properties.content.size}</cmis:contentStreamLength>
|
|
||||||
<cmis:contentStreamMimetype>${node.properties.content.mimetype}</cmis:contentStreamMimetype>
|
|
||||||
<cmis:contentStreamName>${node.name}</cmis:contentStreamName>
|
|
||||||
<cmis:contentStreamUri>${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content</cmis:contentStreamUri>
|
|
||||||
</cmis:object>
|
|
||||||
<#-- CMIS LINKS -->
|
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#-- -->
|
<#-- -->
|
||||||
@@ -53,29 +36,12 @@
|
|||||||
<summary>${node.properties.description!node.properties.title}</summary> <#-- TODO -->
|
<summary>${node.properties.description!node.properties.title}</summary> <#-- TODO -->
|
||||||
<title>${node.name}</title>
|
<title>${node.name}</title>
|
||||||
<updated>${xmldate(node.properties.modified)}</updated>
|
<updated>${xmldate(node.properties.modified)}</updated>
|
||||||
<link rel="self" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}" type="entry"/>
|
<link rel="self" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}"/>
|
||||||
<#-- ATOM Publishing Protocol -->
|
<#-- ATOM Publishing Protocol -->
|
||||||
<app:edited>${xmldate(node.properties.modified)}</app:edited>
|
<app:edited>${xmldate(node.properties.modified)}</app:edited>
|
||||||
<link rel="edit" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}" type="entry"/>
|
<link rel="edit" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}"/>
|
||||||
<#-- Alfresco props -->
|
<#-- Alfresco props -->
|
||||||
<alf:icon>${absurl(url.context)}${node.icon16}</alf:icon>
|
<alf:icon>${absurl(url.context)}${node.icon16}</alf:icon>
|
||||||
<#-- CMIS Schema -->
|
|
||||||
<link rel="cmis-allowableactions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/permissions" type="entry"/>
|
|
||||||
<link rel="cmis-relationships" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/associations" type="feed"/>
|
|
||||||
<link rel="cmis-parent" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/parent" type="feed"/>
|
|
||||||
<link rel="cmis-children" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/children" type="feed"/>
|
|
||||||
<link rel="cmis-descendants" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/descendants" type="feed"/>
|
|
||||||
<cmis:object>
|
|
||||||
<cmis:object_id>${node.nodeRef}</cmis:object_id>
|
|
||||||
<cmis:baseType>folder</cmis:baseType>
|
|
||||||
<cmis:createdBy>${node.properties.creator}</cmis:createdBy>
|
|
||||||
<cmis:creationDate>${xmldate(node.properties.created)}</cmis:creationDate>
|
|
||||||
<cmis:lastModifiedBy>${node.properties.modifier}</cmis:lastModifiedBy>
|
|
||||||
<cmis:lastModificationDate>${xmldate(node.properties.modified)}</cmis:lastModificationDate>
|
|
||||||
<cmis:name>${node.name}</cmis:name>
|
|
||||||
<cmis:parent>${node.parent.nodeRef}</cmis:parent>
|
|
||||||
<#-- In certain cases, if depth is specified children may appear Here. If there are children, the cmis:object tag will be nested For the children of this item -->
|
|
||||||
</cmis:object>
|
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,15 +9,15 @@
|
|||||||
<id>urn:uuid:${node.id}</id>
|
<id>urn:uuid:${node.id}</id>
|
||||||
<title>${node.name}</title>
|
<title>${node.name}</title>
|
||||||
<updated>${xmldate(node.properties.modified)}</updated>
|
<updated>${xmldate(node.properties.modified)}</updated>
|
||||||
<link rel="self" href="${absurl(url.full)?xml}" type="feed"/>
|
<link rel="self" href="${absurl(encodeuri(url.full))?xml}"/>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro generic id title>
|
<#macro generic id title author="System">
|
||||||
<author><name>System</name></author>
|
<author><name>${author}</name></author>
|
||||||
<generator version="${server.version}">Alfresco (${server.edition})</generator>
|
<generator version="${server.version}">Alfresco (${server.edition})</generator>
|
||||||
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
|
<icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<title>${title}</title>
|
<title>${title}</title>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<link rel="self" href="${absurl(url.full)?xml}" type="feed"/>
|
<link rel="self" href="${absurl(encodeuri(url.full))?xml}"/>
|
||||||
</#macro>
|
</#macro>
|
@@ -0,0 +1,45 @@
|
|||||||
|
<#-- -->
|
||||||
|
<#-- CMIS Extensions for Document -->
|
||||||
|
<#-- -->
|
||||||
|
|
||||||
|
<#macro document node>
|
||||||
|
<link rel="cmis-allowableactions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/permissions"/>
|
||||||
|
<link rel="cmis-relationships" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/associations"/>
|
||||||
|
<link rel="cmis-parents" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/parents"/>
|
||||||
|
<link rel="cmis-allversions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/versions"/>
|
||||||
|
<link rel="cmis-stream" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content" type="${node.mimetype}"/>
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>${node.nodeRef}</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:createdBy>${node.properties.creator}</cmis:createdBy>
|
||||||
|
<cmis:creationDate>${xmldate(node.properties.created)}</cmis:creationDate>
|
||||||
|
<cmis:lastModifiedBy>${node.properties.modifier}</cmis:lastModifiedBy>
|
||||||
|
<cmis:lastModificationDate>${xmldate(node.properties.modified)}</cmis:lastModificationDate>
|
||||||
|
<cmis:contentStreamLength>${node.properties.content.size}</cmis:contentStreamLength>
|
||||||
|
<cmis:contentStreamMimetype>${node.properties.content.mimetype}</cmis:contentStreamMimetype>
|
||||||
|
<cmis:contentStreamName>${node.name}</cmis:contentStreamName>
|
||||||
|
<cmis:contentStreamUri>${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/content</cmis:contentStreamUri>
|
||||||
|
</cmis:properties>
|
||||||
|
</#macro>
|
||||||
|
|
||||||
|
<#-- -->
|
||||||
|
<#-- CMIS Extensions for Folder -->
|
||||||
|
<#-- -->
|
||||||
|
|
||||||
|
<#macro folder node>
|
||||||
|
<link rel="cmis-allowableactions" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/permissions"/>
|
||||||
|
<link rel="cmis-relationships" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/associations"/>
|
||||||
|
<link rel="cmis-parent" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/parent"/>
|
||||||
|
<link rel="cmis-children" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/children"/>
|
||||||
|
<link rel="cmis-descendants" href="${absurl(url.serviceContext)}/api/node/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/descendants"/>
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>${node.nodeRef}</cmis:objectId>
|
||||||
|
<cmis:baseType>folder</cmis:baseType>
|
||||||
|
<cmis:createdBy>${node.properties.creator}</cmis:createdBy>
|
||||||
|
<cmis:creationDate>${xmldate(node.properties.created)}</cmis:creationDate>
|
||||||
|
<cmis:lastModifiedBy>${node.properties.modifier}</cmis:lastModifiedBy>
|
||||||
|
<cmis:lastModificationDate>${xmldate(node.properties.modified)}</cmis:lastModificationDate>
|
||||||
|
<cmis:name>${node.name}</cmis:name>
|
||||||
|
<cmis:parent>${node.parent.nodeRef}</cmis:parent>
|
||||||
|
</cmis:properties>
|
||||||
|
</#macro>
|
@@ -6,29 +6,29 @@
|
|||||||
<opensearch:itemsPerPage>${cursor.pageSize}</opensearch:itemsPerPage>
|
<opensearch:itemsPerPage>${cursor.pageSize}</opensearch:itemsPerPage>
|
||||||
<#if cursor.pageType = "PAGE">
|
<#if cursor.pageType = "PAGE">
|
||||||
<#if cursor.hasFirstPage>
|
<#if cursor.hasFirstPage>
|
||||||
<link rel="first" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.firstPage)))?xml}" type="${format.type}"/>
|
<link rel="first" href="${absurl(encodeuri(scripturl(argreplace(url.args, pageArg, cursor.firstPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#if cursor.hasLastPage>
|
<#if cursor.hasLastPage>
|
||||||
<link rel="last" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.lastPage)))?xml}" type="${format.type}"/>
|
<link rel="last" href="${absurl(encodeuri(scripturl(argreplace(url.args, pageArg, cursor.lastPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#if cursor.hasPrevPage>
|
<#if cursor.hasPrevPage>
|
||||||
<link rel="prev" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.prevPage)))?xml}" type="${format.type}"/>
|
<link rel="prev" href="${absurl(encodeuri(scripturl(argreplace(url.args, pageArg, cursor.prevPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#if cursor.hasNextPage>
|
<#if cursor.hasNextPage>
|
||||||
<link rel="next" href="${absurl(scripturl(argreplace(url.args, pageArg, cursor.nextPage)))?xml}" type="${format.type}"/>
|
<link rel="next" href="${absurl(encodeuri(scripturl(argreplace(url.args, pageArg, cursor.nextPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#else>
|
<#else>
|
||||||
<#if cursor.hasFirstPage>
|
<#if cursor.hasFirstPage>
|
||||||
<link rel="first" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.firstPage)))?xml}" type="${format.type}"/>
|
<link rel="first" href="${absurl(encodeuri(scripturl(argreplace(url.args, skipArg, cursor.firstPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#if cursor.hasLastPage>
|
<#if cursor.hasLastPage>
|
||||||
<link rel="last" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.lastPage)))?xml}" type="${format.type}"/>
|
<link rel="last" href="${absurl(encodeuri(scripturl(argreplace(url.args, skipArg, cursor.lastPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#if cursor.hasPrevPage>
|
<#if cursor.hasPrevPage>
|
||||||
<link rel="prev" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.prevPage)))?xml}" type="${format.type}"/>
|
<link rel="prev" href="${absurl(encodeuri(scripturl(argreplace(url.args, skipArg, cursor.prevPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
<#if cursor.hasNextPage>
|
<#if cursor.hasNextPage>
|
||||||
<link rel="next" href="${absurl(scripturl(argreplace(url.args, skipArg, cursor.nextPage)))?xml}" type="${format.type}"/>
|
<link rel="next" href="${absurl(encodeuri(scripturl(argreplace(url.args, skipArg, cursor.nextPage))))?xml}" type="${format.type}"/>
|
||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
</#macro>
|
</#macro>
|
@@ -26,24 +26,20 @@
|
|||||||
<cmis:repositorySpecificInformation></cmis:repositorySpecificInformation>
|
<cmis:repositorySpecificInformation></cmis:repositorySpecificInformation>
|
||||||
</cmis:repositoryInfo>
|
</cmis:repositoryInfo>
|
||||||
|
|
||||||
<#-- TODO: cmis:id on collection elements - are they required by cmis? -->
|
<collection href="${absurl(url.serviceContext)}/api/path/${encodeuri(defaultRootFolderPath)}/children" cmis:collectionType="root">
|
||||||
<#-- TODO: collection resources -->
|
<atom:title>root collection</atom:title>
|
||||||
|
</collection>
|
||||||
|
<collection href="${absurl(url.serviceContext)}/api/checkedout" cmis:collectionType="checkedout">
|
||||||
|
<atom:title>checkedout collection</atom:title>
|
||||||
|
</collection>
|
||||||
|
<collection href="${absurl(url.serviceContext)}/api/unfiled" cmis:collectionType="unfiled">
|
||||||
|
<atom:title>unfiled collection</atom:title>
|
||||||
|
</collection>
|
||||||
|
|
||||||
<collection href="${absurl(url.serviceContext)}/api/path/workspace/SpacesStore//children" cmis:collectionType="root">
|
<#-- TODO: collection resources -->
|
||||||
<atom:title>CMIS root folder</atom:title>
|
|
||||||
</collection>
|
|
||||||
<collection href="http://example.org/cmis/main?checkedout" cmis:collectionType="checkedout">
|
|
||||||
<atom:title>CMIS checked-out documents</atom:title>
|
|
||||||
</collection>
|
|
||||||
<collection href="http://example.org/cmis/main?types" cmis:collectionType="types">
|
<collection href="http://example.org/cmis/main?types" cmis:collectionType="types">
|
||||||
<atom:title>CMIS Types</atom:title>
|
<atom:title>CMIS Types</atom:title>
|
||||||
</collection>
|
</collection>
|
||||||
|
|
||||||
<#-- NOTE: alfresco does not support notion of unfiled...
|
|
||||||
<collection href="http://example.org/cmis/main?unfiled" cmis:collectionType="unfiled">
|
|
||||||
<atom:title>CMIS unfiled documents</atom:title>
|
|
||||||
</collection>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</workspace>
|
</workspace>
|
||||||
</service>
|
</service>
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
model.defaultRootFolderPath = cmis.defaultRootFolderPath;
|
@@ -0,0 +1,21 @@
|
|||||||
|
<#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/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
|
<#import "/org/alfresco/paging.lib.atom.ftl" as pagingLib/>
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<feed <@nsLib.feedNS/>>
|
||||||
|
<@feedLib.generic id="urn:uuid:checkedout" title="Checked out Documents" author="${person.properties.userName}"/>
|
||||||
|
<@pagingLib.cursor cursor=cursor/>
|
||||||
|
<#list results as child>
|
||||||
|
<entry>
|
||||||
|
<#if child.isDocument>
|
||||||
|
<@entryLib.document node=child/>
|
||||||
|
<@cmisLib.document node=child/>
|
||||||
|
<#else>
|
||||||
|
<@entryLib.folder node=child/>
|
||||||
|
<@cmisLib.folder node=child/>
|
||||||
|
</#if>
|
||||||
|
</entry>
|
||||||
|
</#list>
|
||||||
|
</feed>
|
@@ -0,0 +1,8 @@
|
|||||||
|
<webscript>
|
||||||
|
<shortname>Checked-out Documents</shortname>
|
||||||
|
<description>Retrieve list of documents that are checked-out</description>
|
||||||
|
<url>/api/checkedout</url>
|
||||||
|
<authentication>user</authentication>
|
||||||
|
<format default="atomfeed"/>
|
||||||
|
<cmis version="0.21"/>
|
||||||
|
</webscript>
|
@@ -0,0 +1,36 @@
|
|||||||
|
script:
|
||||||
|
{
|
||||||
|
// locate (optional) folder
|
||||||
|
model.folder = null;
|
||||||
|
var folderId = cmis.findArg(args.folderId, headers["CMIS-folderId"]);
|
||||||
|
if (folderId !== null)
|
||||||
|
{
|
||||||
|
model.folder = search.findNode(folderId);
|
||||||
|
if (model.folder === null)
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Folder " + folderId + " not found";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
if (!model.folder.isContainer)
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Folder id " + folderId + " does not refer to a folder";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// NOTE: includeDescendants is an extension of CMIS
|
||||||
|
model.includeDescendants = (args.includeDescendants == "true") ? true : false;;
|
||||||
|
|
||||||
|
// TODO: property filters
|
||||||
|
|
||||||
|
// TODO: includeAllowableActions
|
||||||
|
|
||||||
|
// retrieve checked-out
|
||||||
|
var page = paging.createPageOrWindow(args.pageNo, args.pageSize, cmis.findArg(args.skipCount, headers["CMIS-skipCount"]), cmis.findArg(args.maxItems, headers["CMIS-maxItems"]));
|
||||||
|
var paged = cmis.queryCheckedOut(person.properties.userName, model.folder, model.includeDescendants, page);
|
||||||
|
model.results = paged.results;
|
||||||
|
model.cursor = paged.cursor;
|
||||||
|
}
|
@@ -0,0 +1,66 @@
|
|||||||
|
script:
|
||||||
|
{
|
||||||
|
// ensure atom entry is posted
|
||||||
|
if (entry === null)
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Expected Atom entry";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
|
||||||
|
// extract object id from atom entry
|
||||||
|
var cmisProperties = entry.getExtension(atom.names.cmis_properties);
|
||||||
|
var objectId = (cmisProperties !== null) ? cmisProperties.objectId : null;
|
||||||
|
if (objectId === null)
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Atom entry does not specify repository object id";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
|
||||||
|
// locate node
|
||||||
|
model.node = search.findNode(objectId);
|
||||||
|
if (model.node === null)
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Repository node " + model.node + " not found";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ensure node can be checked-out
|
||||||
|
if (!model.node.isDocument)
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Cannot checkout node " + objectId + " as it is not a document";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: need to test for isCheckedOut not isLocked
|
||||||
|
if (model.node.isLocked || model.node.hasAspect("cm:workingCopy"))
|
||||||
|
{
|
||||||
|
status.code = 400;
|
||||||
|
status.message = "Cannot checkout node " + objectId + " as it is already checked-out";
|
||||||
|
status.redirect = true;
|
||||||
|
break script;
|
||||||
|
}
|
||||||
|
|
||||||
|
// switch on versioning
|
||||||
|
if (!model.node.hasAspect("cm:versionable"))
|
||||||
|
{
|
||||||
|
// create an initial version of the current document
|
||||||
|
model.node.createVersion("Initial Version", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// checkout
|
||||||
|
model.pwc = model.node.checkout();
|
||||||
|
|
||||||
|
// setup for 201 Created response
|
||||||
|
// TODO: set Content-Location
|
||||||
|
status.code = 201;
|
||||||
|
status.location = url.server + url.serviceContext + "/api/pwc/" + model.pwc.nodeRef.storeRef.protocol + "/" + model.pwc.nodeRef.storeRef.identifier + "/" + model.pwc.nodeRef.id;
|
||||||
|
status.redirect = true;
|
||||||
|
}
|
@@ -0,0 +1,8 @@
|
|||||||
|
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
||||||
|
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<entry <@nsLib.entryNS/>>
|
||||||
|
<@entryLib.document node=pwc/>
|
||||||
|
<@cmisLib.document node=pwc/>
|
||||||
|
</entry>
|
@@ -0,0 +1,8 @@
|
|||||||
|
<webscript>
|
||||||
|
<shortname>Checkout a document</shortname>
|
||||||
|
<description></description>
|
||||||
|
<url>/api/checkedout</url>
|
||||||
|
<authentication>user</authentication>
|
||||||
|
<format default="atomentry"/>
|
||||||
|
<cmis version="0.21"/>
|
||||||
|
</webscript>
|
@@ -1,17 +1,21 @@
|
|||||||
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
||||||
<#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/>
|
<#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/>
|
||||||
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
<#import "/org/alfresco/paging.lib.atom.ftl" as pagingLib/>
|
<#import "/org/alfresco/paging.lib.atom.ftl" as pagingLib/>
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<feed <@nsLib.feedNS/>>
|
<feed <@nsLib.feedNS/>>
|
||||||
<@feedLib.node node=node/>
|
<@feedLib.node node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
<@pagingLib.cursor cursor=cursor/>
|
<@pagingLib.cursor cursor=cursor/>
|
||||||
<#list results as child>
|
<#list results as child>
|
||||||
<entry>
|
<entry>
|
||||||
<#if child.isDocument>
|
<#if child.isDocument>
|
||||||
<@entryLib.document node=child/>
|
<@entryLib.document node=child/>
|
||||||
|
<@cmisLib.document node=child/>
|
||||||
<#else>
|
<#else>
|
||||||
<@entryLib.folder node=child/>
|
<@entryLib.folder node=child/>
|
||||||
|
<@cmisLib.folder node=child/>
|
||||||
</#if>
|
</#if>
|
||||||
</entry>
|
</entry>
|
||||||
</#list>
|
</#list>
|
||||||
|
@@ -24,7 +24,7 @@ script:
|
|||||||
// TODO: property filters
|
// TODO: property filters
|
||||||
|
|
||||||
// retrieve children
|
// retrieve children
|
||||||
var page = paging.createPageOrWindow(args.pageNo, args.pageSize, cmis.findArg(args.skipCount, headers["CMIS-skipCount"]), cmis.findArg(args.maxChildren, headers["CMIS-maxChildren"]));
|
var page = paging.createPageOrWindow(args.pageNo, args.pageSize, cmis.findArg(args.skipCount, headers["CMIS-skipCount"]), cmis.findArg(args.maxItems, headers["CMIS-maxItems"]));
|
||||||
var paged = cmis.queryChildren(model.node, model.types, page);
|
var paged = cmis.queryChildren(model.node, model.types, page);
|
||||||
model.results = paged.results;
|
model.results = paged.results;
|
||||||
model.cursor = paged.cursor;
|
model.cursor = paged.cursor;
|
||||||
|
@@ -32,8 +32,8 @@ script:
|
|||||||
var updated = entry.updated;
|
var updated = entry.updated;
|
||||||
var author = (entry.author !== null) ? entry.author.name : null;
|
var author = (entry.author !== null) ? entry.author.name : null;
|
||||||
var content = entry.content;
|
var content = entry.content;
|
||||||
var cmisObject = entry.getExtension(atom.names.cmis_object);
|
var cmisProperties = entry.getExtension(atom.names.cmis_properties);
|
||||||
var baseType = (cmisObject !== null) ? cmisObject.baseType : null;
|
var baseType = (cmisProperties !== null) ? cmisProperties.baseType : null;
|
||||||
|
|
||||||
// create the item
|
// create the item
|
||||||
// TODO: author/updated/id
|
// TODO: author/updated/id
|
||||||
|
@@ -1,10 +1,13 @@
|
|||||||
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
||||||
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<entry <@nsLib.entryNS/>>
|
<entry <@nsLib.entryNS/>>
|
||||||
<#if node.isDocument>
|
<#if node.isDocument>
|
||||||
<@entryLib.document node=node/>
|
<@entryLib.document node=node/>
|
||||||
|
<@cmisLib.document node=node/>
|
||||||
<#else>
|
<#else>
|
||||||
<@entryLib.folder node=node/>
|
<@entryLib.folder node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
</#if>
|
</#if>
|
||||||
</entry>
|
</entry>
|
||||||
|
@@ -1,10 +1,13 @@
|
|||||||
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
||||||
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<entry <@nsLib.entryNS/>>
|
<entry <@nsLib.entryNS/>>
|
||||||
<#if node.isDocument>
|
<#if node.isDocument>
|
||||||
<@entryLib.document node=node/>
|
<@entryLib.document node=node/>
|
||||||
|
<@cmisLib.document node=node/>
|
||||||
<#else>
|
<#else>
|
||||||
<@entryLib.folder node=node/>
|
<@entryLib.folder node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
</#if>
|
</#if>
|
||||||
</entry>
|
</entry>
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
||||||
<#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/>
|
<#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/>
|
||||||
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<feed <@nsLib.feedNS/>>
|
<feed <@nsLib.feedNS/>>
|
||||||
<@feedLib.node node=node/>
|
<@feedLib.node node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
<@parent node=node.parent recurse=returnToRoot/>
|
<@parent node=node.parent recurse=returnToRoot/>
|
||||||
</feed>
|
</feed>
|
||||||
|
|
||||||
@@ -11,6 +13,7 @@
|
|||||||
<#if node?exists && node.isContainer>
|
<#if node?exists && node.isContainer>
|
||||||
<entry>
|
<entry>
|
||||||
<@entryLib.folder node=node/>
|
<@entryLib.folder node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
</entry>
|
</entry>
|
||||||
<#if recurse>
|
<#if recurse>
|
||||||
<@parent node=node.parent recurse=true/>
|
<@parent node=node.parent recurse=true/>
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
<#import "/org/alfresco/cmis/ns.lib.atom.ftl" as nsLib/>
|
||||||
<#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/>
|
<#import "/org/alfresco/cmis/atomfeed.lib.atom.ftl" as feedLib/>
|
||||||
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
<#import "/org/alfresco/cmis/atomentry.lib.atom.ftl" as entryLib/>
|
||||||
|
<#import "/org/alfresco/cmis/cmis.lib.atom.ftl" as cmisLib/>
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<feed <@nsLib.feedNS/>>
|
<feed <@nsLib.feedNS/>>
|
||||||
<@feedLib.node node=node/>
|
<@feedLib.node node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
<@parent node=node.parent recurse=returnToRoot/>
|
<@parent node=node.parent recurse=returnToRoot/>
|
||||||
<#-- TODO: secondary parents loop -->
|
<#-- TODO: secondary parents loop -->
|
||||||
</feed>
|
</feed>
|
||||||
@@ -12,6 +14,7 @@
|
|||||||
<#if node?exists && node.isContainer>
|
<#if node?exists && node.isContainer>
|
||||||
<entry>
|
<entry>
|
||||||
<@entryLib.folder node=node/>
|
<@entryLib.folder node=node/>
|
||||||
|
<@cmisLib.folder node=node/>
|
||||||
</entry>
|
</entry>
|
||||||
<#if recurse>
|
<#if recurse>
|
||||||
<@parent node=node.parent recurse=true/>
|
<@parent node=node.parent recurse=true/>
|
||||||
|
@@ -394,25 +394,29 @@
|
|||||||
<property name="extensionName"><value>cmis</value></property>
|
<property name="extensionName"><value>cmis</value></property>
|
||||||
<property name="serviceRegistry" ref="ServiceRegistry" />
|
<property name="serviceRegistry" ref="ServiceRegistry" />
|
||||||
<property name="repository" ref="webscripts.repo" />
|
<property name="repository" ref="webscripts.repo" />
|
||||||
<property name="navigation" ref="webscripts.cmis.navigation" />
|
<property name="CMISService" ref="webscripts.cmis.service" />
|
||||||
<property name="paging" ref="webscripts.js.paging" />
|
<property name="paging" ref="webscripts.js.paging" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- CMIS Helpers -->
|
<!-- CMIS Helpers -->
|
||||||
<bean id="webscripts.cmis.navigation" class="org.alfresco.repo.cmis.rest.Navigation">
|
<bean id="webscripts.cmis.service" class="org.alfresco.repo.cmis.rest.CMISService">
|
||||||
|
<property name="defaultRootPath"><value>workspace/SpacesStore/Company Home</value></property>
|
||||||
<property name="dictionaryService" ref="dictionaryService" />
|
<property name="dictionaryService" ref="dictionaryService" />
|
||||||
<property name="searchService" ref="searchService" />
|
<property name="searchService" ref="searchService" />
|
||||||
|
<property name="transactionHelper" ref="retryingTransactionHelper" />
|
||||||
|
<property name="tenantDeployerService" ref="tenantAdminService" />
|
||||||
|
<property name="nodeService" ref="nodeService" />
|
||||||
|
<property name="repository" ref="webscripts.repo" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="webscripts.cmis.description" class="org.alfresco.repo.cmis.rest.CMISDescription"/>
|
<bean id="webscripts.cmis.description" class="org.alfresco.repo.cmis.rest.CMISDescription"/>
|
||||||
|
|
||||||
<bean id="webscripts.cmis.atom.extension" class="org.alfresco.web.scripts.atom.AbderaExtension">
|
<bean id="webscripts.cmis.atom.extension" class="org.alfresco.web.scripts.atom.AbderaExtension">
|
||||||
<property name="abderaService" ref="webscripts.abdera"/>
|
<property name="abderaService" ref="webscripts.abdera"/>
|
||||||
<property name="defaultNamespace"><value>http://www.cmis.org/CMIS/1.0</value></property>
|
<property name="defaultNamespace"><value>http://www.cmis.org/2008/05</value></property>
|
||||||
<property name="QNames">
|
<property name="QNames">
|
||||||
<props>
|
<props>
|
||||||
<prop key="cmis_object">object</prop>
|
<prop key="cmis_properties">properties</prop>
|
||||||
<prop key="cmis_baseType">baseType</prop>
|
|
||||||
</props>
|
</props>
|
||||||
</property>
|
</property>
|
||||||
<property name="extensionFactories">
|
<property name="extensionFactories">
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.cmis.rest;
|
package org.alfresco.repo.cmis.rest;
|
||||||
|
|
||||||
import org.alfresco.repo.cmis.rest.Navigation.TypesFilter;
|
import org.alfresco.repo.cmis.rest.CMISService.TypesFilter;
|
||||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||||
import org.alfresco.repo.jscript.ScriptNode;
|
import org.alfresco.repo.jscript.ScriptNode;
|
||||||
import org.alfresco.repo.web.scripts.Repository;
|
import org.alfresco.repo.web.scripts.Repository;
|
||||||
@@ -45,12 +45,12 @@ public class CMISScript extends BaseScopableProcessorExtension
|
|||||||
{
|
{
|
||||||
private static final TypesFilter defaultTypesFilter = TypesFilter.FoldersAndDocuments;
|
private static final TypesFilter defaultTypesFilter = TypesFilter.FoldersAndDocuments;
|
||||||
|
|
||||||
|
|
||||||
private ServiceRegistry services;
|
private ServiceRegistry services;
|
||||||
private Repository repository;
|
private Repository repository;
|
||||||
private Navigation navigation;
|
private CMISService cmisService;
|
||||||
private Paging paging;
|
private Paging paging;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the service registry
|
* Set the service registry
|
||||||
*
|
*
|
||||||
@@ -84,13 +84,32 @@ public class CMISScript extends BaseScopableProcessorExtension
|
|||||||
/**
|
/**
|
||||||
* Set the CMIS Navigation helper
|
* Set the CMIS Navigation helper
|
||||||
*
|
*
|
||||||
* @param navigation
|
* @param cmisService
|
||||||
*/
|
*/
|
||||||
public void setNavigation(Navigation navigation)
|
public void setCMISService(CMISService cmisService)
|
||||||
{
|
{
|
||||||
this.navigation = navigation;
|
this.cmisService = cmisService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the default root folder path
|
||||||
|
*
|
||||||
|
* @return default root folder path
|
||||||
|
*/
|
||||||
|
public String getDefaultRootFolderPath()
|
||||||
|
{
|
||||||
|
return cmisService.getDefaultRootPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the default root folder
|
||||||
|
*
|
||||||
|
* @return default root folder
|
||||||
|
*/
|
||||||
|
public ScriptNode getDefaultRootFolder()
|
||||||
|
{
|
||||||
|
return new ScriptNode(cmisService.getDefaultRootNodeRef(), services, getScope());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the arg value from the specified url argument and header
|
* Finds the arg value from the specified url argument and header
|
||||||
@@ -182,7 +201,7 @@ public class CMISScript extends BaseScopableProcessorExtension
|
|||||||
public PagedResults queryChildren(ScriptNode parent, String typesFilter, Page page)
|
public PagedResults queryChildren(ScriptNode parent, String typesFilter, Page page)
|
||||||
{
|
{
|
||||||
TypesFilter filter = resolveTypesFilter(typesFilter);
|
TypesFilter filter = resolveTypesFilter(typesFilter);
|
||||||
NodeRef[] children = navigation.getChildren(parent.getNodeRef(), filter);
|
NodeRef[] children = cmisService.getChildren(parent.getNodeRef(), filter);
|
||||||
|
|
||||||
Cursor cursor = paging.createCursor(children.length, page);
|
Cursor cursor = paging.createCursor(children.length, page);
|
||||||
ScriptNode[] nodes = new ScriptNode[cursor.getRowCount()];
|
ScriptNode[] nodes = new ScriptNode[cursor.getRowCount()];
|
||||||
@@ -195,6 +214,54 @@ public class CMISScript extends BaseScopableProcessorExtension
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query for items checked-out to user
|
||||||
|
*
|
||||||
|
* @param username user
|
||||||
|
* @param page
|
||||||
|
* @return paged result set of checked-out items
|
||||||
|
*/
|
||||||
|
public PagedResults queryCheckedOut(String username, Page page)
|
||||||
|
{
|
||||||
|
return queryCheckedOut(username, null, false, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query for items checked-out to user within folder
|
||||||
|
*
|
||||||
|
* @param username user
|
||||||
|
* @param folder folder
|
||||||
|
* @param page
|
||||||
|
* @return paged result set of checked-out items
|
||||||
|
*/
|
||||||
|
public PagedResults queryCheckedOut(String username, ScriptNode folder, Page page)
|
||||||
|
{
|
||||||
|
return queryCheckedOut(username, folder, false, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query for items checked-out to user within folder (and possibly descendants)
|
||||||
|
*
|
||||||
|
* @param username user
|
||||||
|
* @param folder folder
|
||||||
|
* @param includeDescendants true = include descendants
|
||||||
|
* @param page
|
||||||
|
* @return paged result set of checked-out items
|
||||||
|
*/
|
||||||
|
public PagedResults queryCheckedOut(String username, ScriptNode folder, boolean includeDescendants, Page page)
|
||||||
|
{
|
||||||
|
NodeRef[] checkedout = cmisService.getCheckedOut(username, (folder == null) ? null : folder.getNodeRef(), includeDescendants);
|
||||||
|
Cursor cursor = paging.createCursor(checkedout.length, page);
|
||||||
|
ScriptNode[] nodes = new ScriptNode[cursor.getRowCount()];
|
||||||
|
for (int i = cursor.getStartRow(); i <= cursor.getEndRow(); i++)
|
||||||
|
{
|
||||||
|
nodes[i - cursor.getStartRow()] = new ScriptNode(checkedout[i], services, getScope());
|
||||||
|
}
|
||||||
|
|
||||||
|
PagedResults results = paging.createPagedResults(nodes, cursor);
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve to a Types Filter
|
* Resolve to a Types Filter
|
||||||
*
|
*
|
||||||
|
437
source/java/org/alfresco/repo/cmis/rest/CMISService.java
Normal file
437
source/java/org/alfresco/repo/cmis/rest/CMISService.java
Normal file
@@ -0,0 +1,437 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2008 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
* 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 java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.repo.search.QueryParameterDefImpl;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
|
import org.alfresco.repo.tenant.TenantDeployer;
|
||||||
|
import org.alfresco.repo.tenant.TenantDeployerService;
|
||||||
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
|
import org.alfresco.repo.web.scripts.Repository;
|
||||||
|
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||||
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
|
import org.alfresco.service.cmr.repository.StoreRef;
|
||||||
|
import org.alfresco.service.cmr.search.QueryParameterDefinition;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
|
import org.alfresco.service.cmr.search.SearchParameters;
|
||||||
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.alfresco.util.AbstractLifecycleBean;
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
import org.springframework.context.ApplicationEvent;
|
||||||
|
import org.springframework.context.ApplicationListener;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CMIS Navigation Service
|
||||||
|
*
|
||||||
|
* @author davidc
|
||||||
|
*/
|
||||||
|
public class CMISService implements ApplicationContextAware, ApplicationListener, TenantDeployer
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Types Filter
|
||||||
|
*
|
||||||
|
* @author davidc
|
||||||
|
*/
|
||||||
|
public enum TypesFilter
|
||||||
|
{
|
||||||
|
Folders,
|
||||||
|
FoldersAndDocuments,
|
||||||
|
Documents
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Query Parameters */
|
||||||
|
private static final QName PARAM_PARENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "parent");
|
||||||
|
private static final QName PARAM_USERNAME = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "username");
|
||||||
|
|
||||||
|
/** Shallow search for all files and folders */
|
||||||
|
private static final String LUCENE_QUERY_SHALLOW_FOLDERS =
|
||||||
|
"+PARENT:\"${cm:parent}\" " +
|
||||||
|
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
|
||||||
|
"+TYPE:\"" + ContentModel.TYPE_FOLDER + "\" ";
|
||||||
|
|
||||||
|
/** Shallow search for all files and folders */
|
||||||
|
private static final String LUCENE_QUERY_SHALLOW_FILES =
|
||||||
|
"+PARENT:\"${cm:parent}\" " +
|
||||||
|
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
|
||||||
|
"+TYPE:\"" + ContentModel.TYPE_CONTENT + "\" ";
|
||||||
|
|
||||||
|
private static final String LUCENE_QUERY_CHECKEDOUT =
|
||||||
|
"+@cm\\:workingCopyOwner:${cm:username}";
|
||||||
|
|
||||||
|
private static final String LUCENE_QUERY_CHECKEDOUT_IN_FOLDER =
|
||||||
|
"+@cm\\:workingCopyOwner:${cm:username} " +
|
||||||
|
"+PARENT:\"${cm:parent}\"";
|
||||||
|
|
||||||
|
|
||||||
|
// dependencies
|
||||||
|
private Repository repository;
|
||||||
|
private RetryingTransactionHelper retryingTransactionHelper;
|
||||||
|
private DictionaryService dictionaryService;
|
||||||
|
private SearchService searchService;
|
||||||
|
private NodeService nodeService;
|
||||||
|
private TenantDeployerService tenantDeployerService;
|
||||||
|
private ProcessorLifecycle lifecycle = new ProcessorLifecycle();
|
||||||
|
|
||||||
|
// default CMIS store and path
|
||||||
|
private String defaultRootPath;
|
||||||
|
private Map<String, NodeRef> defaultRootNodeRefs;
|
||||||
|
|
||||||
|
// data types for query
|
||||||
|
private DataTypeDefinition nodeRefDataType;
|
||||||
|
private DataTypeDefinition textDataType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the default root path
|
||||||
|
*
|
||||||
|
* store_type/store_id/path...
|
||||||
|
*
|
||||||
|
* @param path store_type/store_id/path...
|
||||||
|
*/
|
||||||
|
public void setDefaultRootPath(String path)
|
||||||
|
{
|
||||||
|
defaultRootPath = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the tenant deployer service
|
||||||
|
*
|
||||||
|
* @param tenantDeployerService
|
||||||
|
*/
|
||||||
|
public void setTenantDeployerService(TenantDeployerService tenantDeployerService)
|
||||||
|
{
|
||||||
|
this.tenantDeployerService = tenantDeployerService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets helper that provides transaction callbacks
|
||||||
|
*/
|
||||||
|
public void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
|
||||||
|
{
|
||||||
|
this.retryingTransactionHelper = retryingTransactionHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dictionaryService
|
||||||
|
*/
|
||||||
|
public void setDictionaryService(DictionaryService dictionaryService)
|
||||||
|
{
|
||||||
|
this.dictionaryService = dictionaryService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param searchService
|
||||||
|
*/
|
||||||
|
public void setSearchService(SearchService searchService)
|
||||||
|
{
|
||||||
|
this.searchService = searchService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param nodeService
|
||||||
|
*/
|
||||||
|
public void setNodeService(NodeService nodeService)
|
||||||
|
{
|
||||||
|
this.nodeService = nodeService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param repository
|
||||||
|
*/
|
||||||
|
public void setRepository(Repository repository)
|
||||||
|
{
|
||||||
|
this.repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||||
|
*/
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||||
|
{
|
||||||
|
lifecycle.setApplicationContext(applicationContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
|
||||||
|
*/
|
||||||
|
public void onApplicationEvent(ApplicationEvent event)
|
||||||
|
{
|
||||||
|
lifecycle.onApplicationEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hooks into Spring Application Lifecycle
|
||||||
|
*/
|
||||||
|
private class ProcessorLifecycle extends AbstractLifecycleBean
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected void onBootstrap(ApplicationEvent event)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onShutdown(ApplicationEvent event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.alfresco.repo.tenant.TenantDeployer#onEnableTenant()
|
||||||
|
*/
|
||||||
|
public void onEnableTenant()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.alfresco.repo.tenant.TenantDeployer#onDisableTenant()
|
||||||
|
*/
|
||||||
|
public void onDisableTenant()
|
||||||
|
{
|
||||||
|
destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.alfresco.repo.tenant.TenantDeployer#init()
|
||||||
|
*/
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
// initialise data types
|
||||||
|
nodeRefDataType = dictionaryService.getDataType(DataTypeDefinition.NODE_REF);
|
||||||
|
textDataType = dictionaryService.getDataType(DataTypeDefinition.TEXT);
|
||||||
|
|
||||||
|
// initialise root node ref
|
||||||
|
tenantDeployerService.register(this);
|
||||||
|
if (defaultRootNodeRefs == null)
|
||||||
|
{
|
||||||
|
defaultRootNodeRefs = new HashMap<String, NodeRef>(1);
|
||||||
|
}
|
||||||
|
getDefaultRootNodeRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.alfresco.repo.tenant.TenantDeployer#destroy()
|
||||||
|
*/
|
||||||
|
public void destroy()
|
||||||
|
{
|
||||||
|
defaultRootNodeRefs.remove(tenantDeployerService.getCurrentUserDomain());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the default root node path
|
||||||
|
*
|
||||||
|
* @return root node path
|
||||||
|
*/
|
||||||
|
public String getDefaultRootPath()
|
||||||
|
{
|
||||||
|
return defaultRootPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the default root node ref
|
||||||
|
*
|
||||||
|
* @return root node ref
|
||||||
|
*/
|
||||||
|
public NodeRef getDefaultRootNodeRef()
|
||||||
|
{
|
||||||
|
String tenantDomain = tenantDeployerService.getCurrentUserDomain();
|
||||||
|
NodeRef defaultNodeRef = defaultRootNodeRefs.get(tenantDomain);
|
||||||
|
if (defaultNodeRef == null)
|
||||||
|
{
|
||||||
|
defaultNodeRef = AuthenticationUtil.runAs(new RunAsWork<NodeRef>()
|
||||||
|
{
|
||||||
|
public NodeRef doWork() throws Exception
|
||||||
|
{
|
||||||
|
return retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<NodeRef>()
|
||||||
|
{
|
||||||
|
public NodeRef execute() throws Exception
|
||||||
|
{
|
||||||
|
return repository.findNodeRef("path", defaultRootPath.split("/"));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, AuthenticationUtil.getSystemUserName());
|
||||||
|
|
||||||
|
if (defaultNodeRef == null)
|
||||||
|
{
|
||||||
|
throw new AlfrescoRuntimeException("Default root folder path '" + defaultRootPath + "' not found");
|
||||||
|
}
|
||||||
|
defaultRootNodeRefs.put(tenantDomain, defaultNodeRef);
|
||||||
|
}
|
||||||
|
return defaultNodeRef;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the default store ref
|
||||||
|
*
|
||||||
|
* @return store ref
|
||||||
|
*/
|
||||||
|
public StoreRef getDefaultRootStoreRef()
|
||||||
|
{
|
||||||
|
return getDefaultRootNodeRef().getStoreRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query for node children
|
||||||
|
*
|
||||||
|
* @param parent node to query children for
|
||||||
|
* @param typesFilter types filter
|
||||||
|
* @return children of node
|
||||||
|
*/
|
||||||
|
public NodeRef[] getChildren(NodeRef parent, TypesFilter typesFilter)
|
||||||
|
{
|
||||||
|
if (typesFilter == TypesFilter.FoldersAndDocuments)
|
||||||
|
{
|
||||||
|
NodeRef[] folders = queryChildren(parent, TypesFilter.Folders);
|
||||||
|
NodeRef[] docs = queryChildren(parent, TypesFilter.Documents);
|
||||||
|
NodeRef[] foldersAndDocs = new NodeRef[folders.length + docs.length];
|
||||||
|
System.arraycopy(folders, 0, foldersAndDocs, 0, folders.length);
|
||||||
|
System.arraycopy(docs, 0, foldersAndDocs, folders.length, docs.length);
|
||||||
|
return foldersAndDocs;
|
||||||
|
}
|
||||||
|
else if (typesFilter == TypesFilter.Folders)
|
||||||
|
{
|
||||||
|
NodeRef[] folders = queryChildren(parent, TypesFilter.Folders);
|
||||||
|
return folders;
|
||||||
|
}
|
||||||
|
else if (typesFilter == TypesFilter.Documents)
|
||||||
|
{
|
||||||
|
NodeRef[] docs = queryChildren(parent, TypesFilter.Documents);
|
||||||
|
return docs;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new NodeRef[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query for checked out items
|
||||||
|
*
|
||||||
|
* @param username for user
|
||||||
|
* @param folder (optional) within folder
|
||||||
|
* @param includeDescendants true => include descendants of folder, false => only children of folder
|
||||||
|
* @return checked out items
|
||||||
|
*/
|
||||||
|
public NodeRef[] getCheckedOut(String username, NodeRef folder, boolean includeDescendants)
|
||||||
|
{
|
||||||
|
SearchParameters params = new SearchParameters();
|
||||||
|
params.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||||
|
QueryParameterDefinition usernameDef = new QueryParameterDefImpl(PARAM_USERNAME, textDataType, true, username);
|
||||||
|
params.addQueryParameterDefinition(usernameDef);
|
||||||
|
|
||||||
|
if (folder == null)
|
||||||
|
{
|
||||||
|
// get all checked-out items
|
||||||
|
params.setQuery(LUCENE_QUERY_CHECKEDOUT);
|
||||||
|
params.addStore(getDefaultRootStoreRef());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get all checked-out items within folder
|
||||||
|
// NOTE: special-case for all descendants in root folder (treat as all checked-out items)
|
||||||
|
if (includeDescendants && nodeService.getRootNode(folder.getStoreRef()) == folder)
|
||||||
|
{
|
||||||
|
// get all checked-out items within specified folder store
|
||||||
|
params.setQuery(LUCENE_QUERY_CHECKEDOUT);
|
||||||
|
params.addStore(folder.getStoreRef());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: implement descendants of folder
|
||||||
|
params.setQuery(LUCENE_QUERY_CHECKEDOUT_IN_FOLDER);
|
||||||
|
params.addStore(folder.getStoreRef());
|
||||||
|
QueryParameterDefinition parentDef = new QueryParameterDefImpl(PARAM_PARENT, nodeRefDataType, true, folder.toString());
|
||||||
|
params.addQueryParameterDefinition(parentDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ResultSet resultSet = searchService.query(params);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<NodeRef> results = resultSet.getNodeRefs();
|
||||||
|
NodeRef[] nodeRefs = new NodeRef[results.size()];
|
||||||
|
return results.toArray(nodeRefs);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query children helper
|
||||||
|
*
|
||||||
|
* NOTE: Queries for folders only or documents only
|
||||||
|
*
|
||||||
|
* @param parent node to query children for
|
||||||
|
* @param typesFilter folders or documents
|
||||||
|
* @return node children
|
||||||
|
*/
|
||||||
|
private NodeRef[] queryChildren(NodeRef parent, TypesFilter typesFilter)
|
||||||
|
{
|
||||||
|
SearchParameters params = new SearchParameters();
|
||||||
|
params.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||||
|
params.addStore(parent.getStoreRef());
|
||||||
|
QueryParameterDefinition parentDef = new QueryParameterDefImpl(PARAM_PARENT, nodeRefDataType, true, parent.toString());
|
||||||
|
params.addQueryParameterDefinition(parentDef);
|
||||||
|
|
||||||
|
if (typesFilter == TypesFilter.Folders)
|
||||||
|
{
|
||||||
|
params.setQuery(LUCENE_QUERY_SHALLOW_FOLDERS);
|
||||||
|
}
|
||||||
|
else if (typesFilter == TypesFilter.Documents)
|
||||||
|
{
|
||||||
|
params.setQuery(LUCENE_QUERY_SHALLOW_FILES);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResultSet resultSet = searchService.query(params);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<NodeRef> results = resultSet.getNodeRefs();
|
||||||
|
NodeRef[] nodeRefs = new NodeRef[results.size()];
|
||||||
|
return results.toArray(nodeRefs);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -25,21 +25,17 @@
|
|||||||
package org.alfresco.repo.cmis.rest;
|
package org.alfresco.repo.cmis.rest;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
import javax.xml.XMLConstants;
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
import javax.xml.transform.Source;
|
|
||||||
import javax.xml.transform.dom.DOMSource;
|
import javax.xml.transform.dom.DOMSource;
|
||||||
import javax.xml.transform.stream.StreamSource;
|
|
||||||
import javax.xml.validation.Schema;
|
|
||||||
import javax.xml.validation.SchemaFactory;
|
|
||||||
import javax.xml.validation.Validator;
|
import javax.xml.validation.Validator;
|
||||||
|
|
||||||
|
import org.alfresco.repo.cmis.rest.xsd.CMISValidator;
|
||||||
import org.alfresco.repo.web.scripts.BaseWebScriptTest;
|
import org.alfresco.repo.web.scripts.BaseWebScriptTest;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
@@ -52,69 +48,17 @@ import org.xml.sax.SAXException;
|
|||||||
*/
|
*/
|
||||||
public class CMISWebScriptTest extends BaseWebScriptTest
|
public class CMISWebScriptTest extends BaseWebScriptTest
|
||||||
{
|
{
|
||||||
/** XML Schema Validation */
|
private CMISValidator cmisValidator = new CMISValidator();
|
||||||
private static DocumentBuilder documentBuilder = null;
|
|
||||||
private static Validator appValidator = null;
|
|
||||||
private static Validator atomValidator = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets document parser
|
* Gets CMIS Validator
|
||||||
*
|
*
|
||||||
* @return document parser
|
* @return CMIS Validator
|
||||||
* @throws ParserConfigurationException
|
|
||||||
*/
|
*/
|
||||||
protected static DocumentBuilder getDocumentBuilder()
|
protected CMISValidator getCMISValidator()
|
||||||
throws ParserConfigurationException
|
|
||||||
{
|
{
|
||||||
if (documentBuilder == null)
|
return cmisValidator;
|
||||||
{
|
|
||||||
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
|
|
||||||
builderFactory.setNamespaceAware(true);
|
|
||||||
documentBuilder = builderFactory.newDocumentBuilder();
|
|
||||||
}
|
|
||||||
return documentBuilder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets CMIS Atom Publishing Protocol XML Validator
|
|
||||||
*
|
|
||||||
* @return APP Validator
|
|
||||||
* @throws IOException
|
|
||||||
* @throws SAXException
|
|
||||||
*/
|
|
||||||
protected static Validator getAppValidator()
|
|
||||||
throws IOException, SAXException
|
|
||||||
{
|
|
||||||
if (appValidator == null)
|
|
||||||
{
|
|
||||||
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
|
||||||
Source schemaFile = new StreamSource(new ClassPathResource("org/alfresco/repo/cmis/rest/xsd/APP.xsd").getFile());
|
|
||||||
Schema schema = factory.newSchema(schemaFile);
|
|
||||||
appValidator = schema.newValidator();
|
|
||||||
}
|
|
||||||
return appValidator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets CMIS Atom Validator
|
|
||||||
*
|
|
||||||
* @return CMIS Atom Validator
|
|
||||||
* @throws IOException
|
|
||||||
* @throws SAXException
|
|
||||||
*/
|
|
||||||
protected static Validator getCMISAtomValidator()
|
|
||||||
throws IOException, SAXException
|
|
||||||
{
|
|
||||||
if (atomValidator == null)
|
|
||||||
{
|
|
||||||
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
|
||||||
Source schemaFile = new StreamSource(new ClassPathResource("org/alfresco/repo/cmis/rest/xsd/ATOM4CMIS.xsd").getFile());
|
|
||||||
Schema schema = factory.newSchema(schemaFile);
|
|
||||||
atomValidator = schema.newValidator();
|
|
||||||
}
|
|
||||||
|
|
||||||
return atomValidator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,34 +69,56 @@ public class CMISWebScriptTest extends BaseWebScriptTest
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws ParserConfigurationException
|
* @throws ParserConfigurationException
|
||||||
*/
|
*/
|
||||||
public void assertValidXML(String xml, Validator validator)
|
protected void assertValidXML(String xml, Validator validator)
|
||||||
throws IOException, ParserConfigurationException
|
throws IOException, ParserConfigurationException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Document document = getDocumentBuilder().parse(new InputSource(new StringReader(xml)));
|
Document document = cmisValidator.getDocumentBuilder().parse(new InputSource(new StringReader(xml)));
|
||||||
validator.validate(new DOMSource(document));
|
validator.validate(new DOMSource(document));
|
||||||
}
|
}
|
||||||
catch (SAXException e)
|
catch (SAXException e)
|
||||||
{
|
{
|
||||||
fail(e.toString() + "\n\n" + xml);
|
fail(cmisValidator.toString(e, xml));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
public static void main(String[] args) throws IOException, ParserConfigurationException
|
* Load text from file specified by class path
|
||||||
|
*
|
||||||
|
* @param classPath XML file
|
||||||
|
* @return XML
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
protected String loadString(String classPath)
|
||||||
|
throws IOException
|
||||||
{
|
{
|
||||||
|
InputStream input = getClass().getResourceAsStream(classPath);
|
||||||
|
if (input == null)
|
||||||
|
{
|
||||||
|
throw new IOException(classPath + " not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
InputStreamReader reader = new InputStreamReader(input);
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Document document = getDocumentBuilder().parse(new ClassPathResource("test.xml").getFile());
|
char[] buffer = new char[4096];
|
||||||
getAppValidator().validate(new DOMSource(document));
|
int bytesRead = -1;
|
||||||
}
|
while ((bytesRead = reader.read(buffer)) != -1)
|
||||||
catch (SAXException e)
|
|
||||||
{
|
{
|
||||||
fail(e.toString());
|
writer.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
reader.close();
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@@ -1,179 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2005-2008 Alfresco Software Limited.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
|
|
||||||
* 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 java.util.List;
|
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
|
||||||
import org.alfresco.repo.search.QueryParameterDefImpl;
|
|
||||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
|
||||||
import org.alfresco.service.cmr.search.QueryParameterDefinition;
|
|
||||||
import org.alfresco.service.cmr.search.ResultSet;
|
|
||||||
import org.alfresco.service.cmr.search.SearchParameters;
|
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
|
||||||
import org.alfresco.service.namespace.QName;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CMIS Navigation Service
|
|
||||||
*
|
|
||||||
* @author davidc
|
|
||||||
*/
|
|
||||||
public class Navigation implements InitializingBean
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Types Filter
|
|
||||||
*
|
|
||||||
* @author davidc
|
|
||||||
*/
|
|
||||||
public enum TypesFilter
|
|
||||||
{
|
|
||||||
Folders,
|
|
||||||
FoldersAndDocuments,
|
|
||||||
Documents
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Query Parameters */
|
|
||||||
private static final QName PARAM_PARENT = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "parent");
|
|
||||||
|
|
||||||
/** Shallow search for all files and folders */
|
|
||||||
private static final String LUCENE_QUERY_SHALLOW_FOLDERS =
|
|
||||||
"+PARENT:\"${cm:parent}\" " +
|
|
||||||
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
|
|
||||||
"+TYPE:\"" + ContentModel.TYPE_FOLDER + "\" ";
|
|
||||||
|
|
||||||
/** Shallow search for all files and folders */
|
|
||||||
private static final String LUCENE_QUERY_SHALLOW_FILES =
|
|
||||||
"+PARENT:\"${cm:parent}\" " +
|
|
||||||
"-TYPE:\"" + ContentModel.TYPE_SYSTEM_FOLDER + "\" " +
|
|
||||||
"+TYPE:\"" + ContentModel.TYPE_CONTENT + "\" ";
|
|
||||||
|
|
||||||
// dependencies
|
|
||||||
private DictionaryService dictionaryService;
|
|
||||||
private SearchService searchService;
|
|
||||||
private DataTypeDefinition nodeRefDataType;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dictionaryService
|
|
||||||
*/
|
|
||||||
public void setDictionaryService(DictionaryService dictionaryService)
|
|
||||||
{
|
|
||||||
this.dictionaryService = dictionaryService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param searchService
|
|
||||||
*/
|
|
||||||
public void setSearchService(SearchService searchService)
|
|
||||||
{
|
|
||||||
this.searchService = searchService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialisation
|
|
||||||
*/
|
|
||||||
public void afterPropertiesSet() throws Exception
|
|
||||||
{
|
|
||||||
nodeRefDataType = dictionaryService.getDataType(DataTypeDefinition.NODE_REF);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query for node children
|
|
||||||
*
|
|
||||||
* @param parent node to query children for
|
|
||||||
* @param typesFilter types filter
|
|
||||||
* @return children of node
|
|
||||||
*/
|
|
||||||
public NodeRef[] getChildren(NodeRef parent, TypesFilter typesFilter)
|
|
||||||
{
|
|
||||||
if (typesFilter == TypesFilter.FoldersAndDocuments)
|
|
||||||
{
|
|
||||||
NodeRef[] folders = queryChildren(parent, TypesFilter.Folders);
|
|
||||||
NodeRef[] docs = queryChildren(parent, TypesFilter.Documents);
|
|
||||||
NodeRef[] foldersAndDocs = new NodeRef[folders.length + docs.length];
|
|
||||||
System.arraycopy(folders, 0, foldersAndDocs, 0, folders.length);
|
|
||||||
System.arraycopy(docs, 0, foldersAndDocs, folders.length, docs.length);
|
|
||||||
return foldersAndDocs;
|
|
||||||
}
|
|
||||||
else if (typesFilter == TypesFilter.Folders)
|
|
||||||
{
|
|
||||||
NodeRef[] folders = queryChildren(parent, TypesFilter.Folders);
|
|
||||||
return folders;
|
|
||||||
}
|
|
||||||
else if (typesFilter == TypesFilter.Documents)
|
|
||||||
{
|
|
||||||
NodeRef[] docs = queryChildren(parent, TypesFilter.Documents);
|
|
||||||
return docs;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NodeRef[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query children helper
|
|
||||||
*
|
|
||||||
* NOTE: Queries for folders only or documents only
|
|
||||||
*
|
|
||||||
* @param parent node to query children for
|
|
||||||
* @param typesFilter folders or documents
|
|
||||||
* @return node children
|
|
||||||
*/
|
|
||||||
private NodeRef[] queryChildren(NodeRef parent, TypesFilter typesFilter)
|
|
||||||
{
|
|
||||||
SearchParameters params = new SearchParameters();
|
|
||||||
params.setLanguage(SearchService.LANGUAGE_LUCENE);
|
|
||||||
params.addStore(parent.getStoreRef());
|
|
||||||
QueryParameterDefinition parentDef = new QueryParameterDefImpl(PARAM_PARENT, nodeRefDataType, true, parent.toString());
|
|
||||||
params.addQueryParameterDefinition(parentDef);
|
|
||||||
|
|
||||||
if (typesFilter == TypesFilter.Folders)
|
|
||||||
{
|
|
||||||
params.setQuery(LUCENE_QUERY_SHALLOW_FOLDERS);
|
|
||||||
}
|
|
||||||
else if (typesFilter == TypesFilter.Documents)
|
|
||||||
{
|
|
||||||
params.setQuery(LUCENE_QUERY_SHALLOW_FILES);
|
|
||||||
}
|
|
||||||
|
|
||||||
ResultSet resultSet = searchService.query(params);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
List<NodeRef> results = resultSet.getNodeRefs();
|
|
||||||
NodeRef[] nodeRefs = new NodeRef[results.size()];
|
|
||||||
return results.toArray(nodeRefs);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
resultSet.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -24,6 +24,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.cmis.rest;
|
package org.alfresco.repo.cmis.rest;
|
||||||
|
|
||||||
|
import java.io.StringReader;
|
||||||
|
|
||||||
|
import org.alfresco.util.GUID;
|
||||||
|
import org.alfresco.web.scripts.Format;
|
||||||
|
import org.alfresco.web.scripts.atom.AbderaService;
|
||||||
|
import org.alfresco.web.scripts.atom.AbderaServiceImpl;
|
||||||
|
import org.apache.abdera.ext.cmis.CMISExtensionFactory;
|
||||||
|
import org.apache.abdera.ext.cmis.CMISProperties;
|
||||||
|
import org.apache.abdera.i18n.iri.IRI;
|
||||||
|
import org.apache.abdera.model.Collection;
|
||||||
|
import org.apache.abdera.model.Entry;
|
||||||
|
import org.apache.abdera.model.Feed;
|
||||||
|
import org.apache.abdera.model.Link;
|
||||||
|
import org.apache.abdera.model.Service;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
|
|
||||||
|
|
||||||
@@ -34,11 +48,215 @@ import org.springframework.mock.web.MockHttpServletResponse;
|
|||||||
*/
|
*/
|
||||||
public class TestCMIS extends CMISWebScriptTest
|
public class TestCMIS extends CMISWebScriptTest
|
||||||
{
|
{
|
||||||
|
private AbderaService abdera;
|
||||||
|
|
||||||
public void testRepository() throws Exception
|
private static Service service = null;
|
||||||
|
private static Entry testFolder = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp()
|
||||||
|
throws Exception
|
||||||
{
|
{
|
||||||
MockHttpServletResponse res = getRequest("/api/repository", 200);
|
super.setUp();
|
||||||
assertValidXML(res.getContentAsString(), getAppValidator());
|
|
||||||
|
AbderaServiceImpl abderaImpl = new AbderaServiceImpl();
|
||||||
|
abderaImpl.afterPropertiesSet();
|
||||||
|
abderaImpl.registerExtensionFactory(new CMISExtensionFactory());
|
||||||
|
abdera = abderaImpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Service getRepository()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
if (service == null)
|
||||||
|
{
|
||||||
|
MockHttpServletResponse res = getRequest("/api/repository", 200, null);
|
||||||
|
String xml = res.getContentAsString();
|
||||||
|
assertNotNull(xml);
|
||||||
|
assertTrue(xml.length() > 0);
|
||||||
|
//assertValidXML(xml, getCMISValidator().getAppValidator());
|
||||||
|
|
||||||
|
service = abdera.parseService(new StringReader(xml), null);
|
||||||
|
assertNotNull(service);
|
||||||
|
}
|
||||||
|
return service;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IRI getRootCollection(Service service)
|
||||||
|
{
|
||||||
|
Collection root = service.getCollection("Main Repository", "root collection");
|
||||||
|
assertNotNull(root);
|
||||||
|
IRI rootHREF = root.getHref();
|
||||||
|
assertNotNull(rootHREF);
|
||||||
|
return rootHREF;
|
||||||
|
}
|
||||||
|
|
||||||
|
private IRI getCheckedOutCollection(Service service)
|
||||||
|
{
|
||||||
|
Collection root = service.getCollection("Main Repository", "checkedout collection");
|
||||||
|
assertNotNull(root);
|
||||||
|
IRI rootHREF = root.getHref();
|
||||||
|
assertNotNull(rootHREF);
|
||||||
|
return rootHREF;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Entry getTestFolder()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
if (testFolder == null)
|
||||||
|
{
|
||||||
|
testFolder = createTestFolder();
|
||||||
|
}
|
||||||
|
return testFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Entry getEntry(IRI href)
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
MockHttpServletResponse res = getRequest(href.toString(), 200, "admin");
|
||||||
|
assertNotNull(res);
|
||||||
|
String xml = res.getContentAsString();
|
||||||
|
Entry entry = abdera.parseEntry(new StringReader(xml), null);
|
||||||
|
assertNotNull(entry);
|
||||||
|
assertEquals(href, entry.getSelfLink().getHref());
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Feed getFeed(IRI href)
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
MockHttpServletResponse res = getRequest(href.toString(), 200, "admin");
|
||||||
|
assertNotNull(res);
|
||||||
|
String xml = res.getContentAsString();
|
||||||
|
Feed feed = abdera.parseFeed(new StringReader(xml), null);
|
||||||
|
assertNotNull(feed);
|
||||||
|
assertEquals(href, feed.getSelfLink().getHref());
|
||||||
|
return feed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Entry createTestFolder()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Service service = getRepository();
|
||||||
|
IRI rootFolderHREF = getRootCollection(service);
|
||||||
|
String createFolder = loadString("/cmis/rest/createtestfolder.atomentry.xml");
|
||||||
|
String guid = GUID.generate();
|
||||||
|
createFolder = createFolder.replace("${GUID}", guid);
|
||||||
|
MockHttpServletResponse res = postRequest(rootFolderHREF.toString(), 201, createFolder, Format.ATOMENTRY.mimetype(), "admin");
|
||||||
|
assertNotNull(res);
|
||||||
|
String xml = res.getContentAsString();
|
||||||
|
Entry entry = abdera.parseEntry(new StringReader(xml), null);
|
||||||
|
assertNotNull(entry);
|
||||||
|
assertEquals("CMIS Test Folder " + guid, entry.getTitle());
|
||||||
|
assertEquals("CMIS Test Folder " + guid + " Summary", entry.getSummary());
|
||||||
|
CMISProperties props = entry.getExtension(CMISExtensionFactory.PROPERTIES);
|
||||||
|
assertEquals("folder", props.getBaseType());
|
||||||
|
String testFolderHREF = (String)res.getHeader("Location");
|
||||||
|
assertNotNull(testFolderHREF);
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Entry createTestDocument(IRI parent)
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
String createFile = loadString("/cmis/rest/createtestdocument.atomentry.xml");
|
||||||
|
String guid = GUID.generate();
|
||||||
|
createFile = createFile.replace("${GUID}", guid);
|
||||||
|
MockHttpServletResponse res = postRequest(parent.toString(), 201, createFile, Format.ATOMENTRY.mimetype(), "admin");
|
||||||
|
assertNotNull(res);
|
||||||
|
String xml = res.getContentAsString();
|
||||||
|
Entry entry = abdera.parseEntry(new StringReader(xml), null);
|
||||||
|
assertNotNull(entry);
|
||||||
|
assertEquals("Test Document " + guid, entry.getTitle());
|
||||||
|
assertEquals("Test Document " + guid + " Summary", entry.getSummary());
|
||||||
|
assertNotNull(entry.getContentSrc());
|
||||||
|
CMISProperties props = entry.getExtension(CMISExtensionFactory.PROPERTIES);
|
||||||
|
assertEquals("document", props.getBaseType());
|
||||||
|
String testFileHREF = (String)res.getHeader("Location");
|
||||||
|
assertNotNull(testFileHREF);
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testRepository()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Service service = getRepository();
|
||||||
|
IRI rootHREF = getRootCollection(service);
|
||||||
|
getRequest(rootHREF.toString(), 200, "admin");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCreateTestFolder()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
createTestFolder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCreateDocument()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Entry testFolder = getTestFolder();
|
||||||
|
Link childrenLink = testFolder.getLink("cmis-children");
|
||||||
|
assertNotNull(childrenLink);
|
||||||
|
Feed children = getFeed(childrenLink.getHref());
|
||||||
|
assertNotNull(children);
|
||||||
|
int entriesBefore = children.getEntries().size();
|
||||||
|
Entry document = createTestDocument(children.getSelfLink().getHref());
|
||||||
|
Feed feedFolderAfter = getFeed(childrenLink.getHref());
|
||||||
|
int entriesAfter = feedFolderAfter.getEntries().size();
|
||||||
|
assertEquals(entriesBefore +1, entriesAfter);
|
||||||
|
Entry entry = feedFolderAfter.getEntry(document.getId().toString());
|
||||||
|
assertNotNull(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testGetCheckedOut()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
// retrieve test folder for checkouts
|
||||||
|
Entry testFolder = getTestFolder();
|
||||||
|
Link childrenLink = testFolder.getLink("cmis-children");
|
||||||
|
Feed scope = getFeed(childrenLink.getHref());
|
||||||
|
assertNotNull(scope);
|
||||||
|
CMISProperties props = scope.getExtension(CMISExtensionFactory.PROPERTIES);
|
||||||
|
String scopeId = props.getObjectId();
|
||||||
|
assertNotNull(scopeId);
|
||||||
|
|
||||||
|
// retrieve checkouts within scope of test checkout folder
|
||||||
|
Service repository = getRepository();
|
||||||
|
assertNotNull(repository);
|
||||||
|
IRI checkedoutHREF = getCheckedOutCollection(service);
|
||||||
|
Feed checkedout = getFeed(new IRI(checkedoutHREF.toString() + "?folderId=" + scopeId));
|
||||||
|
assertNotNull(checkedout);
|
||||||
|
assertEquals(0, checkedout.getEntries().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCheckout()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
// retrieve test folder for checkouts
|
||||||
|
Entry testFolder = getTestFolder();
|
||||||
|
Link childrenLink = testFolder.getLink("cmis-children");
|
||||||
|
Feed scope = getFeed(childrenLink.getHref());
|
||||||
|
|
||||||
|
// create document for checkout
|
||||||
|
Entry document = createTestDocument(scope.getSelfLink().getHref());
|
||||||
|
MockHttpServletResponse documentRes = getRequest(document.getSelfLink().getHref().toString(), 200, "admin");
|
||||||
|
assertNotNull(documentRes);
|
||||||
|
String xml = documentRes.getContentAsString();
|
||||||
|
assertNotNull(xml);
|
||||||
|
|
||||||
|
// checkout
|
||||||
|
IRI checkedoutHREF = getCheckedOutCollection(service);
|
||||||
|
MockHttpServletResponse checkoutRes = postRequest(checkedoutHREF.toString(), 201, xml, Format.ATOMENTRY.mimetype(), "admin");
|
||||||
|
assertNotNull(checkoutRes);
|
||||||
|
// TODO: test private working copy properties
|
||||||
|
|
||||||
|
// test getCheckedOut is updated
|
||||||
|
CMISProperties props = testFolder.getExtension(CMISExtensionFactory.PROPERTIES);
|
||||||
|
String scopeId = props.getObjectId();
|
||||||
|
Feed checkedout = getFeed(new IRI(checkedoutHREF.toString() + "?folderId=" + scopeId));
|
||||||
|
assertNotNull(checkedout);
|
||||||
|
assertEquals(1, checkedout.getEntries().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,14 +13,14 @@
|
|||||||
xmlns:cmis="http://www.cmis.org/2008/05"
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
>
|
>
|
||||||
<xs:import namespace="http://www.w3.org/2005/Atom" schemaLocation="ATOM4CMIS.xsd"/>
|
<xs:import namespace="http://www.w3.org/2005/Atom" schemaLocation="ATOM4CMIS.xsd"/>
|
||||||
<xs:import namespace="http://www.cmis.org/2008/05" schemaLocation="CMIS REST.xsd"/>
|
<xs:import namespace="http://www.cmis.org/2008/05" schemaLocation="CMIS-REST.xsd"/>
|
||||||
|
|
||||||
|
|
||||||
<xs:element name="service" type="app:appServiceType"></xs:element>
|
<xs:element name="service" type="app:appServiceType"></xs:element>
|
||||||
|
|
||||||
<xs:complexType name="appServiceType">
|
<xs:complexType name="appServiceType">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<!-- <xs:element ref="atom:author"></xs:element> -->
|
<xs:element ref="atom:author" minOccurs="0" maxOccurs="1"></xs:element>
|
||||||
<xs:element ref="app:workspace" minOccurs="1" maxOccurs="unbounded"></xs:element>
|
<xs:element ref="app:workspace" minOccurs="1" maxOccurs="unbounded"></xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
@@ -44,11 +44,11 @@
|
|||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="atom:title"></xs:element>
|
<xs:element ref="atom:title"></xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute name="href" type="xs:anyURI" use="required"></xs:attribute>
|
|
||||||
<xs:attribute ref="cmis:id"></xs:attribute>
|
<xs:attribute ref="cmis:id"></xs:attribute>
|
||||||
<xs:attribute ref="cmis:collectionType"></xs:attribute>
|
<xs:attribute ref="cmis:collectionType"></xs:attribute>
|
||||||
|
<xs:attribute name="href" type="xs:anyURI"></xs:attribute>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<!-- <xs:attribute name="href" type="xs:anyURI"></xs:attribute> -->
|
<xs:attribute name="href" type="xs:anyURI"></xs:attribute>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
<!-- EOF -->
|
<!-- EOF -->
|
||||||
|
@@ -12,9 +12,10 @@
|
|||||||
xmlns:cmis="http://www.cmis.org/2008/05"
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
>
|
>
|
||||||
|
|
||||||
<xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml1-strict.xsd"/>
|
<xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml1-strict.xsd"/>
|
||||||
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
|
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
|
||||||
<xs:import namespace="http://www.cmis.org/2008/05" schemaLocation="CMIS REST.xsd"/>
|
<xs:import namespace="http://www.cmis.org/2008/05" schemaLocation="CMIS-REST.xsd"/>
|
||||||
|
|
||||||
|
|
||||||
<!-- Common attributes -->
|
<!-- Common attributes -->
|
||||||
@@ -104,11 +105,6 @@
|
|||||||
<xs:group ref="atom:extensionElement"/>
|
<xs:group ref="atom:extensionElement"/>
|
||||||
</xs:choice>
|
</xs:choice>
|
||||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="atom:entry"/>
|
<xs:element minOccurs="0" maxOccurs="unbounded" ref="atom:entry"/>
|
||||||
<!--
|
|
||||||
<xs:choice minOccurs="0" maxOccurs="1">
|
|
||||||
<xs:group ref="cmis:CMISFolderEntry" />
|
|
||||||
<xs:group ref="cmis:CMISTypeEntry" />
|
|
||||||
</xs:choice> -->
|
|
||||||
|
|
||||||
<xs:element minOccurs="0" maxOccurs="1" ref="cmis:hasMoreItems"/>
|
<xs:element minOccurs="0" maxOccurs="1" ref="cmis:hasMoreItems"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
@@ -137,17 +133,18 @@
|
|||||||
<xs:element ref="atom:updated" />
|
<xs:element ref="atom:updated" />
|
||||||
<xs:group ref="atom:extensionElement" />
|
<xs:group ref="atom:extensionElement" />
|
||||||
<xs:element ref="atom:uri"></xs:element>
|
<xs:element ref="atom:uri"></xs:element>
|
||||||
|
|
||||||
</xs:choice>
|
</xs:choice>
|
||||||
<!--
|
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element ref="cmis:properties" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element ref="cmis:allowableActions" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
|
||||||
|
<!-- This is necessary for nested entries such as descendants -->
|
||||||
<xs:choice minOccurs="0" maxOccurs="1">
|
<xs:choice minOccurs="0" maxOccurs="1">
|
||||||
<xs:group ref="cmis:CMISDocumentEntry" />
|
<xs:element ref="atom:entry" />
|
||||||
<xs:group ref="cmis:CMISFolderEntry" />
|
</xs:choice>
|
||||||
<xs:group ref="cmis:CMISRelationshipEntry" />
|
|
||||||
<xs:group ref="cmis:CMISPolicyEntry" />
|
|
||||||
<xs:group ref="cmis:CMISActionsEntry" />
|
|
||||||
<xs:group ref="cmis:CMISTypeEntry" />
|
|
||||||
</xs:choice> -->
|
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attributeGroup ref="atom:atomCommonAttributes"/>
|
<xs:attributeGroup ref="atom:atomCommonAttributes"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
@@ -426,7 +423,6 @@
|
|||||||
<xs:element ref="atom:title"></xs:element>
|
<xs:element ref="atom:title"></xs:element>
|
||||||
<xs:element ref="cmis:repositoryInfo"></xs:element>
|
<xs:element ref="cmis:repositoryInfo"></xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute ref="cmis:id"></xs:attribute>
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<xs:element name="collection" type="xs:string"></xs:element>
|
<xs:element name="collection" type="xs:string"></xs:element>
|
||||||
@@ -435,8 +431,8 @@
|
|||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="atom:title"></xs:element>
|
<xs:element ref="atom:title"></xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute ref="cmis:id"></xs:attribute>
|
|
||||||
<xs:attribute ref="cmis:collectionType"></xs:attribute>
|
<xs:attribute ref="cmis:collectionType"></xs:attribute>
|
||||||
|
<xs:attribute ref="cmis:id"></xs:attribute>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
<!-- EOF -->
|
<!-- EOF -->
|
||||||
|
@@ -16,12 +16,12 @@
|
|||||||
|
|
||||||
<xs:element name="repositoryInfo" type="cmis:repositoryInfoType"></xs:element>
|
<xs:element name="repositoryInfo" type="cmis:repositoryInfoType"></xs:element>
|
||||||
<xs:element name="property" type="cmis:propertyDefinitionType"></xs:element>
|
<xs:element name="property" type="cmis:propertyDefinitionType"></xs:element>
|
||||||
<xs:element name="parent" type="xs:string"></xs:element>
|
<xs:element name="parentId" type="xs:string"></xs:element>
|
||||||
<xs:element name="displayName" type="xs:string"></xs:element>
|
<xs:element name="displayName" type="xs:string"></xs:element>
|
||||||
<xs:element name="isVersionable" type="xs:boolean"></xs:element>
|
<xs:element name="isVersionable" type="xs:boolean"></xs:element>
|
||||||
<xs:element name="description" type="xs:string"></xs:element>
|
<xs:element name="description" type="xs:string"></xs:element>
|
||||||
<xs:element name="isQueryable" type="xs:string"></xs:element>
|
<xs:element name="isQueryable" type="xs:boolean"></xs:element>
|
||||||
<xs:element name="isCreatable" type="xs:string"></xs:element>
|
<xs:element name="isCreatable" type="xs:boolean"></xs:element>
|
||||||
<xs:element name="queryName" type="xs:string"></xs:element>
|
<xs:element name="queryName" type="xs:string"></xs:element>
|
||||||
<xs:element name="baseTypeQueryName" type="xs:string"></xs:element>
|
<xs:element name="baseTypeQueryName" type="xs:string"></xs:element>
|
||||||
<xs:element name="isContentStreamAllowed" type="xs:boolean"></xs:element>
|
<xs:element name="isContentStreamAllowed" type="xs:boolean"></xs:element>
|
||||||
@@ -110,10 +110,9 @@
|
|||||||
<xs:element name="repositorySpecificInformation"
|
<xs:element name="repositorySpecificInformation"
|
||||||
type="xs:string" maxOccurs="1" minOccurs="0">
|
type="xs:string" maxOccurs="1" minOccurs="0">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<!--
|
<xs:any namespace="##other" processContents="skip"
|
||||||
<xs:any namespace="##any" processContents="skip"
|
|
||||||
minOccurs="0" maxOccurs="unbounded">
|
minOccurs="0" maxOccurs="unbounded">
|
||||||
</xs:any> -->
|
</xs:any>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
@@ -199,6 +198,9 @@
|
|||||||
|
|
||||||
<xs:group name="entryCommonElements">
|
<xs:group name="entryCommonElements">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
|
<xs:element ref="cmis:objectId" minOccurs="1"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
<xs:element ref="cmis:baseType" minOccurs="1"
|
<xs:element ref="cmis:baseType" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@@ -365,6 +367,12 @@
|
|||||||
<xs:element ref="cmis:canDelete" minOccurs="0"
|
<xs:element ref="cmis:canDelete" minOccurs="0"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<xs:element ref="cmis:parentId" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
|
<xs:element ref="cmis:parentUrl" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
<xs:element ref="cmis:canUpdateProperties" minOccurs="0"
|
<xs:element ref="cmis:canUpdateProperties" minOccurs="0"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@@ -435,14 +443,12 @@
|
|||||||
<xs:element ref="cmis:displayName" minOccurs="1"
|
<xs:element ref="cmis:displayName" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<!--
|
|
||||||
<xs:element ref="cmis:baseType" minOccurs="1"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:element> -->
|
|
||||||
<xs:element ref="cmis:baseTypeQueryName" minOccurs="1"
|
<xs:element ref="cmis:baseTypeQueryName" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:parent" minOccurs="1" maxOccurs="1"></xs:element>
|
<xs:element ref="cmis:parentId" minOccurs="1"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
<xs:element ref="cmis:description" minOccurs="0"
|
<xs:element ref="cmis:description" minOccurs="0"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@@ -458,16 +464,18 @@
|
|||||||
<xs:element ref="cmis:isContentStreamAllowed" minOccurs="1"
|
<xs:element ref="cmis:isContentStreamAllowed" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:AllowedSourceTypes" minOccurs="1" maxOccurs="1">
|
<xs:element ref="cmis:isControllable" minOccurs="1"
|
||||||
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:AllowedTargetTypes" minOccurs="1" maxOccurs="1">
|
<xs:element ref="cmis:AllowedSourceTypes" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:constraints" minOccurs="0"
|
<xs:element ref="cmis:AllowedTargetTypes" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
|
<xs:element ref="cmis:property" minOccurs="0"
|
||||||
maxOccurs="unbounded">
|
maxOccurs="unbounded">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
<xs:element ref="cmis:property"></xs:element>
|
|
||||||
<xs:element ref="cmis:isControllable"></xs:element>
|
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
||||||
</xs:group>
|
</xs:group>
|
||||||
@@ -475,9 +483,6 @@
|
|||||||
|
|
||||||
<xs:group name="CMISDocumentEntry">
|
<xs:group name="CMISDocumentEntry">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:group ref="cmis:entryCommonElements" minOccurs="1"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:group>
|
|
||||||
<xs:element ref="cmis:objectType" minOccurs="1"
|
<xs:element ref="cmis:objectType" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@@ -496,14 +501,14 @@
|
|||||||
<xs:element ref="cmis:isImmutable" minOccurs="0"
|
<xs:element ref="cmis:isImmutable" minOccurs="0"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:isVersionSeriesCheckedOut" minOccurs="0"
|
<xs:element ref="cmis:isVersionSeriesCheckedOut"
|
||||||
maxOccurs="1">
|
minOccurs="0" maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:versionSeriesCheckedOutBy" minOccurs="0"
|
<xs:element ref="cmis:versionSeriesCheckedOutBy"
|
||||||
maxOccurs="1">
|
minOccurs="0" maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:versionSeriesCheckedOutID" minOccurs="0"
|
<xs:element ref="cmis:versionSeriesCheckedOutID"
|
||||||
maxOccurs="1">
|
minOccurs="0" maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:checkinComment" minOccurs="1"
|
<xs:element ref="cmis:checkinComment" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
@@ -516,22 +521,15 @@
|
|||||||
<xs:group ref="cmis:entryContentStreamElements"
|
<xs:group ref="cmis:entryContentStreamElements"
|
||||||
minOccurs="0" maxOccurs="1">
|
minOccurs="0" maxOccurs="1">
|
||||||
</xs:group>
|
</xs:group>
|
||||||
<xs:element ref="cmis:allowableActions" minOccurs="0"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:group>
|
</xs:group>
|
||||||
|
|
||||||
<xs:group name="CMISFolderEntry">
|
<xs:group name="CMISFolderEntry">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:group ref="cmis:entryCommonElements" minOccurs="1"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:group>
|
|
||||||
<xs:element ref="cmis:objectType" minOccurs="1"
|
<xs:element ref="cmis:objectType" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:parent" minOccurs="1" maxOccurs="1"></xs:element>
|
<xs:element ref="cmis:parentId" minOccurs="1"
|
||||||
<xs:element ref="cmis:allowableActions" minOccurs="0"
|
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
@@ -540,20 +538,12 @@
|
|||||||
|
|
||||||
<xs:group name="CMISRelationshipEntry">
|
<xs:group name="CMISRelationshipEntry">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:group ref="cmis:entryCommonElements" minOccurs="1"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:group>
|
|
||||||
<xs:element ref="cmis:objectType" minOccurs="1"
|
<xs:element ref="cmis:objectType" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:source" minOccurs="1"
|
<xs:element ref="cmis:source" minOccurs="1" maxOccurs="1">
|
||||||
maxOccurs="1">
|
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:target" minOccurs="1"
|
<xs:element ref="cmis:target" minOccurs="1" maxOccurs="1">
|
||||||
maxOccurs="1">
|
|
||||||
</xs:element>
|
|
||||||
<xs:element ref="cmis:allowableActions" minOccurs="0"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
|
||||||
@@ -561,15 +551,9 @@
|
|||||||
|
|
||||||
<xs:group name="CMISPolicyEntry">
|
<xs:group name="CMISPolicyEntry">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:group ref="cmis:entryCommonElements" minOccurs="1"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:group>
|
|
||||||
<xs:element ref="cmis:objectType" minOccurs="1"
|
<xs:element ref="cmis:objectType" minOccurs="1"
|
||||||
maxOccurs="1">
|
maxOccurs="1">
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:allowableActions" minOccurs="0"
|
|
||||||
maxOccurs="1">
|
|
||||||
</xs:element>
|
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:group>
|
</xs:group>
|
||||||
|
|
||||||
@@ -592,11 +576,21 @@
|
|||||||
|
|
||||||
<xs:complexType name="queryType">
|
<xs:complexType name="queryType">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="cmis:statement" minOccurs="1" maxOccurs="1"></xs:element>
|
<xs:element ref="cmis:statement" minOccurs="1"
|
||||||
<xs:element ref="cmis:searchAllVersions" minOccurs="0" maxOccurs="1"></xs:element>
|
maxOccurs="1">
|
||||||
<xs:element ref="cmis:pageSize" minOccurs="0" maxOccurs="1"></xs:element>
|
</xs:element>
|
||||||
<xs:element ref="cmis:skipCount" minOccurs="0" maxOccurs="1"></xs:element>
|
<xs:element ref="cmis:searchAllVersions" minOccurs="0"
|
||||||
<xs:element ref="cmis:returnAllowableActions" minOccurs="0" maxOccurs="1"></xs:element>
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
|
<xs:element ref="cmis:pageSize" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
|
<xs:element ref="cmis:skipCount" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
|
<xs:element ref="cmis:returnAllowableActions" minOccurs="0"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
@@ -617,6 +611,7 @@
|
|||||||
<xs:enumeration value="unfiled"></xs:enumeration>
|
<xs:enumeration value="unfiled"></xs:enumeration>
|
||||||
<xs:enumeration value="checkedout"></xs:enumeration>
|
<xs:enumeration value="checkedout"></xs:enumeration>
|
||||||
<xs:enumeration value="types"></xs:enumeration>
|
<xs:enumeration value="types"></xs:enumeration>
|
||||||
|
<xs:enumeration value="query"></xs:enumeration>
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
</xs:attribute>
|
</xs:attribute>
|
||||||
@@ -632,5 +627,35 @@
|
|||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
</xs:attribute>
|
</xs:attribute>
|
||||||
|
|
||||||
|
<xs:complexType name="typeType">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:group ref="cmis:CMISTypeEntry"></xs:group>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<xs:element name="objectId" type="xs:string"></xs:element>
|
||||||
|
|
||||||
|
<xs:element name="type" type="cmis:typeType"></xs:element>
|
||||||
|
|
||||||
|
<xs:element name="parentUrl" type="xs:anyURI"></xs:element>
|
||||||
|
|
||||||
|
<xs:element name="properties" type="cmis:propertiesType"></xs:element>
|
||||||
|
|
||||||
|
<xs:complexType name="propertiesType">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="1">
|
||||||
|
<xs:group ref="cmis:entryCommonElements" minOccurs="1"
|
||||||
|
maxOccurs="1">
|
||||||
|
</xs:group>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:choice minOccurs="0" maxOccurs="1">
|
||||||
|
<xs:group ref="cmis:CMISDocumentEntry" />
|
||||||
|
<xs:group ref="cmis:CMISFolderEntry" />
|
||||||
|
<xs:group ref="cmis:CMISRelationshipEntry" />
|
||||||
|
<xs:group ref="cmis:CMISPolicyEntry" />
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
<!-- EOF -->
|
<!-- EOF -->
|
160
source/java/org/alfresco/repo/cmis/rest/xsd/CMISValidator.java
Normal file
160
source/java/org/alfresco/repo/cmis/rest/xsd/CMISValidator.java
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
* 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.xsd;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.StringReader;
|
||||||
|
|
||||||
|
import javax.xml.XMLConstants;
|
||||||
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import javax.xml.transform.Source;
|
||||||
|
import javax.xml.transform.dom.DOMSource;
|
||||||
|
import javax.xml.transform.stream.StreamSource;
|
||||||
|
import javax.xml.validation.Schema;
|
||||||
|
import javax.xml.validation.SchemaFactory;
|
||||||
|
import javax.xml.validation.Validator;
|
||||||
|
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
import org.xml.sax.InputSource;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
import org.xml.sax.SAXParseException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CMIS Validator
|
||||||
|
*
|
||||||
|
* Support for validating CMIS requests/responses against CMIS XSDs
|
||||||
|
*
|
||||||
|
* @author davidc
|
||||||
|
*/
|
||||||
|
public class CMISValidator
|
||||||
|
{
|
||||||
|
/** XML Schema Validation */
|
||||||
|
private DocumentBuilder documentBuilder = null;
|
||||||
|
private Validator appValidator = null;
|
||||||
|
private Validator atomValidator = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets document parser
|
||||||
|
*
|
||||||
|
* @return document parser
|
||||||
|
* @throws ParserConfigurationException
|
||||||
|
*/
|
||||||
|
public DocumentBuilder getDocumentBuilder()
|
||||||
|
throws ParserConfigurationException
|
||||||
|
{
|
||||||
|
if (documentBuilder == null)
|
||||||
|
{
|
||||||
|
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
|
||||||
|
builderFactory.setNamespaceAware(true);
|
||||||
|
documentBuilder = builderFactory.newDocumentBuilder();
|
||||||
|
}
|
||||||
|
return documentBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets CMIS Atom Publishing Protocol XML Validator
|
||||||
|
*
|
||||||
|
* @return APP Validator
|
||||||
|
* @throws IOException
|
||||||
|
* @throws SAXException
|
||||||
|
*/
|
||||||
|
public Validator getAppValidator()
|
||||||
|
throws IOException, SAXException
|
||||||
|
{
|
||||||
|
if (appValidator == null)
|
||||||
|
{
|
||||||
|
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
||||||
|
Source APPFile = new StreamSource(getClass().getResourceAsStream("APP.xsd"), getClass().getResource("APP.xsd").toExternalForm());
|
||||||
|
Schema schema = factory.newSchema(APPFile);
|
||||||
|
appValidator = schema.newValidator();
|
||||||
|
}
|
||||||
|
return appValidator;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets CMIS Atom Validator
|
||||||
|
*
|
||||||
|
* @return CMIS Atom Validator
|
||||||
|
* @throws IOException
|
||||||
|
* @throws SAXException
|
||||||
|
*/
|
||||||
|
public Validator getCMISAtomValidator()
|
||||||
|
throws IOException, SAXException
|
||||||
|
{
|
||||||
|
if (atomValidator == null)
|
||||||
|
{
|
||||||
|
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
||||||
|
Source ATOM4CMISFile = new StreamSource(getClass().getResourceAsStream("ATOM4CMIS.xsd"), getClass().getResource("ATOM4CMIS.xsd").toExternalForm());
|
||||||
|
Schema schema = factory.newSchema(ATOM4CMISFile);
|
||||||
|
atomValidator = schema.newValidator();
|
||||||
|
}
|
||||||
|
|
||||||
|
return atomValidator;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts XML complies with specified Validator
|
||||||
|
*
|
||||||
|
* @param xml xml to assert
|
||||||
|
* @param validator validator to assert with
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ParserConfigurationException
|
||||||
|
*/
|
||||||
|
public void validateXML(String xml, Validator validator)
|
||||||
|
throws IOException, ParserConfigurationException, SAXException
|
||||||
|
{
|
||||||
|
Document document = getDocumentBuilder().parse(new InputSource(new StringReader(xml)));
|
||||||
|
validator.validate(new DOMSource(document));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert SAX Exception to String
|
||||||
|
*
|
||||||
|
* @param e SAX Exception
|
||||||
|
* @param xml related XML (if any)
|
||||||
|
* @return description of SAX Exception
|
||||||
|
*/
|
||||||
|
public String toString(SAXException e, String xml)
|
||||||
|
{
|
||||||
|
StringBuffer fail = new StringBuffer(e.toString());
|
||||||
|
if (e instanceof SAXParseException)
|
||||||
|
{
|
||||||
|
fail.append("\n");
|
||||||
|
fail.append("line: ").append(((SAXParseException)e).getLineNumber()).append("\n");
|
||||||
|
fail.append("col: ").append(((SAXParseException)e).getColumnNumber()).append("\n");
|
||||||
|
}
|
||||||
|
if (xml != null)
|
||||||
|
{
|
||||||
|
fail.append("\n");
|
||||||
|
fail.append(xml);
|
||||||
|
}
|
||||||
|
return fail.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
49
source/java/org/alfresco/repo/cmis/rest/xsd/Example-AllowableActions.xml
Executable file
49
source/java/org/alfresco/repo/cmis/rest/xsd/Example-AllowableActions.xml
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<cmis:allowableActions xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<!-- all -->
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
|
||||||
|
<!-- if not embedded in entry -->
|
||||||
|
<cmis:parentId>cmis:parentId</cmis:parentId>
|
||||||
|
<cmis:parentUrl>http://tempuri.org</cmis:parentUrl>
|
||||||
|
|
||||||
|
<!-- all -->
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
|
||||||
|
<!-- policy, document -->
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
|
||||||
|
<!-- folder -->
|
||||||
|
<cmis:canGetDescendants>true</cmis:canGetDescendants>
|
||||||
|
|
||||||
|
<!-- doc, folder, policy -->
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
|
||||||
|
<!-- doc -->
|
||||||
|
<cmis:canDeleteVersion>true</cmis:canDeleteVersion>
|
||||||
|
<cmis:canDeleteContent>true</cmis:canDeleteContent>
|
||||||
|
<cmis:canCheckout>true</cmis:canCheckout>
|
||||||
|
<cmis:canCancelCheckout>true</cmis:canCancelCheckout>
|
||||||
|
<cmis:canCheckin>true</cmis:canCheckin>
|
||||||
|
<cmis:canSetContent>true</cmis:canSetContent>
|
||||||
|
<cmis:canGetAllVersions>true</cmis:canGetAllVersions>
|
||||||
|
<cmis:canAddToFolder>true</cmis:canAddToFolder>
|
||||||
|
<cmis:canRemoveFromFolder>true</cmis:canRemoveFromFolder>
|
||||||
|
<cmis:canViewContent>true</cmis:canViewContent>
|
||||||
|
|
||||||
|
<!-- doc, folder, policy -->
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
|
||||||
|
<!-- folder -->
|
||||||
|
<cmis:canGetChildren>true</cmis:canGetChildren>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</cmis:allowableActions>
|
112
source/java/org/alfresco/repo/cmis/rest/xsd/Example-DocumentEntry.xml
Executable file
112
source/java/org/alfresco/repo/cmis/rest/xsd/Example-DocumentEntry.xml
Executable file
@@ -0,0 +1,112 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang=""
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<title>Document Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/document-entry</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
<atom:link rel="edit-media"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="enclosure"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="alternate"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parents"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/parents" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/actions" />
|
||||||
|
<atom:link rel="cmis-allversions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/allversions" />
|
||||||
|
<atom:link rel="cmis-latestversion"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/latestversion" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/email" />
|
||||||
|
<atom:link rel="cmis-stream"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content src="http://www.cmis.org/rep1/media/document-entry">
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<atom:summary>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
</atom:summary>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>docid1</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>2001-12-31T12:00:00</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>email</cmis:objectType>
|
||||||
|
<cmis:isCheckedOut>false</cmis:isCheckedOut>
|
||||||
|
<cmis:isLatestVersion>true</cmis:isLatestVersion>
|
||||||
|
<cmis:isMajorVersion>true</cmis:isMajorVersion>
|
||||||
|
<cmis:isLatestMajorVersion>true</cmis:isLatestMajorVersion>
|
||||||
|
<cmis:isImmutable>false</cmis:isImmutable>
|
||||||
|
<cmis:isVersionSeriesCheckedOut>
|
||||||
|
false
|
||||||
|
</cmis:isVersionSeriesCheckedOut>
|
||||||
|
<cmis:versionSeriesCheckedOutBy></cmis:versionSeriesCheckedOutBy>
|
||||||
|
<cmis:versionSeriesCheckedOutID></cmis:versionSeriesCheckedOutID>
|
||||||
|
<cmis:checkinComment>
|
||||||
|
This is the initial checkin comment
|
||||||
|
</cmis:checkinComment>
|
||||||
|
<cmis:versionLabel>1.0</cmis:versionLabel>
|
||||||
|
<cmis:contentStreamLength>70</cmis:contentStreamLength>
|
||||||
|
<cmis:contentStreamMimetype>
|
||||||
|
text/plain
|
||||||
|
</cmis:contentStreamMimetype>
|
||||||
|
<cmis:contentStreamName>foo.txt</cmis:contentStreamName>
|
||||||
|
<cmis:contentStreamURI>
|
||||||
|
http://www.cmis.org/rep1/media/document-entry
|
||||||
|
</cmis:contentStreamURI>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canDeleteVersion>true</cmis:canDeleteVersion>
|
||||||
|
<cmis:canDeleteContent>true</cmis:canDeleteContent>
|
||||||
|
<cmis:canCheckout>true</cmis:canCheckout>
|
||||||
|
<cmis:canCancelCheckout>true</cmis:canCancelCheckout>
|
||||||
|
<cmis:canCheckin>true</cmis:canCheckin>
|
||||||
|
<cmis:canSetContent>true</cmis:canSetContent>
|
||||||
|
<cmis:canGetAllVersions>true</cmis:canGetAllVersions>
|
||||||
|
<cmis:canAddToFolder>true</cmis:canAddToFolder>
|
||||||
|
<cmis:canRemoveFromFolder>true</cmis:canRemoveFromFolder>
|
||||||
|
<cmis:canViewContent>true</cmis:canViewContent>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
118
source/java/org/alfresco/repo/cmis/rest/xsd/Example-DocumentPWCEntry.xml
Executable file
118
source/java/org/alfresco/repo/cmis/rest/xsd/Example-DocumentPWCEntry.xml
Executable file
@@ -0,0 +1,118 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang=""
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<title>Document Entry example PWC</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/document-entry</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2007-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
<atom:link rel="edit-media"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="enclosure"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="alternate"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parents"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/parents" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/actions" />
|
||||||
|
<atom:link rel="cmis-allversions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/allversions" />
|
||||||
|
<atom:link rel="cmis-latestversion"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/latestversion" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/email" />
|
||||||
|
<atom:link rel="cmis-stream"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content src="http://www.cmis.org/rep1/media/document-entry">
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<atom:summary>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
</atom:summary>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>docid1pwc</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>2001-12-31T12:00:00</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>email</cmis:objectType>
|
||||||
|
|
||||||
|
<!-- PWC -->
|
||||||
|
<cmis:isCheckedOut>true</cmis:isCheckedOut>
|
||||||
|
<cmis:isLatestVersion>true</cmis:isLatestVersion>
|
||||||
|
<cmis:isMajorVersion>false</cmis:isMajorVersion>
|
||||||
|
<cmis:isLatestMajorVersion>false</cmis:isLatestMajorVersion>
|
||||||
|
<cmis:isImmutable>false</cmis:isImmutable>
|
||||||
|
|
||||||
|
<!-- PWC -->
|
||||||
|
<cmis:isVersionSeriesCheckedOut>
|
||||||
|
true
|
||||||
|
</cmis:isVersionSeriesCheckedOut>
|
||||||
|
<cmis:versionSeriesCheckedOutBy>Al Brown</cmis:versionSeriesCheckedOutBy>
|
||||||
|
<cmis:versionSeriesCheckedOutID>docid1pwc</cmis:versionSeriesCheckedOutID>
|
||||||
|
|
||||||
|
<cmis:checkinComment></cmis:checkinComment>
|
||||||
|
|
||||||
|
<!-- PWC -->
|
||||||
|
<cmis:versionLabel>1.1</cmis:versionLabel>
|
||||||
|
|
||||||
|
<cmis:contentStreamLength>70</cmis:contentStreamLength>
|
||||||
|
<cmis:contentStreamMimetype>
|
||||||
|
text/plain
|
||||||
|
</cmis:contentStreamMimetype>
|
||||||
|
<cmis:contentStreamName>foo.txt</cmis:contentStreamName>
|
||||||
|
<cmis:contentStreamURI>
|
||||||
|
http://www.cmis.org/rep1/media/document-entry
|
||||||
|
</cmis:contentStreamURI>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canDeleteVersion>true</cmis:canDeleteVersion>
|
||||||
|
<cmis:canDeleteContent>true</cmis:canDeleteContent>
|
||||||
|
<cmis:canCheckout>false</cmis:canCheckout>
|
||||||
|
<cmis:canCancelCheckout>true</cmis:canCancelCheckout>
|
||||||
|
<cmis:canCheckin>true</cmis:canCheckin>
|
||||||
|
<cmis:canSetContent>true</cmis:canSetContent>
|
||||||
|
<cmis:canGetAllVersions>true</cmis:canGetAllVersions>
|
||||||
|
<cmis:canAddToFolder>true</cmis:canAddToFolder>
|
||||||
|
<cmis:canRemoveFromFolder>true</cmis:canRemoveFromFolder>
|
||||||
|
<cmis:canViewContent>true</cmis:canViewContent>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
208
source/java/org/alfresco/repo/cmis/rest/xsd/Example-FolderChildren.xml
Executable file
208
source/java/org/alfresco/repo/cmis/rest/xsd/Example-FolderChildren.xml
Executable file
@@ -0,0 +1,208 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:feed xml:base="http://tempuri.org" xml:lang=""
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<!-- This is a feed of folder containing:
|
||||||
|
folder1\
|
||||||
|
folder2
|
||||||
|
docid1
|
||||||
|
-->
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
<atom:title>Folder1's Children - page 3</atom:title>
|
||||||
|
<atom:link href="http://www.cmis.org/rep1/folder1/children/3" />
|
||||||
|
|
||||||
|
<!-- Points to the folder entry document -->
|
||||||
|
<atom:link rel="cmis-source" href="http://www.cmis.org/rep1/folder1" />
|
||||||
|
|
||||||
|
<atom:updated>2007-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- RFC 5005 Feed Paging -->
|
||||||
|
<atom:link rel="first"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children" />
|
||||||
|
<atom:link rel="next"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children/4" />
|
||||||
|
<atom:link rel="previous"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children/2" />
|
||||||
|
<atom:link rel="last"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children/last" />
|
||||||
|
|
||||||
|
<!-- sub-folder 1 -->
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="en-US">
|
||||||
|
<title>Folder Entry example (folder2)</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/folder-entry2</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parent"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2/parent" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2/actions" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/emailfolder" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
Folder Entry Example (folderid2) Property1 Value1
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>folderid2</cmis:objectId>
|
||||||
|
<cmis:baseType>folder</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>
|
||||||
|
2001-12-31T12:00:00
|
||||||
|
</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>emailfolder</cmis:objectType>
|
||||||
|
<cmis:parentId>folderid1</cmis:parentId>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canGetDescendants>true</cmis:canGetDescendants>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
<cmis:canGetChildren>true</cmis:canGetChildren>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
||||||
|
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<title>Document Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/document-entry</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
<atom:link rel="edit-media"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="enclosure"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="alternate"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parents"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/parents" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/actions" />
|
||||||
|
<atom:link rel="cmis-allversions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/allversions" />
|
||||||
|
<atom:link rel="cmis-latestversion"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/latestversion" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/email" />
|
||||||
|
<atom:link rel="cmis-stream"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content
|
||||||
|
src="http://www.cmis.org/rep1/media/document-entry">
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<atom:summary>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
</atom:summary>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>docid1</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>
|
||||||
|
2001-12-31T12:00:00
|
||||||
|
</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>email</cmis:objectType>
|
||||||
|
<cmis:isCheckedOut>false</cmis:isCheckedOut>
|
||||||
|
<cmis:isLatestVersion>true</cmis:isLatestVersion>
|
||||||
|
<cmis:isMajorVersion>true</cmis:isMajorVersion>
|
||||||
|
<cmis:isLatestMajorVersion>true</cmis:isLatestMajorVersion>
|
||||||
|
<cmis:isImmutable>false</cmis:isImmutable>
|
||||||
|
<cmis:isVersionSeriesCheckedOut>
|
||||||
|
false
|
||||||
|
</cmis:isVersionSeriesCheckedOut>
|
||||||
|
<cmis:versionSeriesCheckedOutBy></cmis:versionSeriesCheckedOutBy>
|
||||||
|
<cmis:versionSeriesCheckedOutID></cmis:versionSeriesCheckedOutID>
|
||||||
|
<cmis:checkinComment>
|
||||||
|
This is the initial checkin comment
|
||||||
|
</cmis:checkinComment>
|
||||||
|
<cmis:versionLabel>1.0</cmis:versionLabel>
|
||||||
|
<cmis:contentStreamLength>70</cmis:contentStreamLength>
|
||||||
|
<cmis:contentStreamMimetype>
|
||||||
|
text/plain
|
||||||
|
</cmis:contentStreamMimetype>
|
||||||
|
<cmis:contentStreamName>foo.txt</cmis:contentStreamName>
|
||||||
|
<cmis:contentStreamURI>
|
||||||
|
http://www.cmis.org/rep1/media/document-entry
|
||||||
|
</cmis:contentStreamURI>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canDeleteVersion>true</cmis:canDeleteVersion>
|
||||||
|
<cmis:canDeleteContent>true</cmis:canDeleteContent>
|
||||||
|
<cmis:canCheckout>true</cmis:canCheckout>
|
||||||
|
<cmis:canCancelCheckout>true</cmis:canCancelCheckout>
|
||||||
|
<cmis:canCheckin>true</cmis:canCheckin>
|
||||||
|
<cmis:canSetContent>true</cmis:canSetContent>
|
||||||
|
<cmis:canGetAllVersions>true</cmis:canGetAllVersions>
|
||||||
|
<cmis:canAddToFolder>true</cmis:canAddToFolder>
|
||||||
|
<cmis:canRemoveFromFolder>true</cmis:canRemoveFromFolder>
|
||||||
|
<cmis:canViewContent>true</cmis:canViewContent>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
||||||
|
|
||||||
|
<!-- notification of more items -->
|
||||||
|
<cmis:hasMoreItems>true</cmis:hasMoreItems>
|
||||||
|
</atom:feed>
|
326
source/java/org/alfresco/repo/cmis/rest/xsd/Example-FolderDescendants.xml
Executable file
326
source/java/org/alfresco/repo/cmis/rest/xsd/Example-FolderDescendants.xml
Executable file
@@ -0,0 +1,326 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:feed xml:base="http://tempuri.org" xml:lang=""
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<!-- This is a feed of folder containing:
|
||||||
|
folder1\
|
||||||
|
folder2\
|
||||||
|
docid2
|
||||||
|
docid1
|
||||||
|
-->
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
<atom:title>Folder1's Children - page 3</atom:title>
|
||||||
|
<atom:link href="http://www.cmis.org/rep1/folder1/children/3" />
|
||||||
|
|
||||||
|
<!-- Points to the folder entry document -->
|
||||||
|
<atom:link rel="cmis-source"
|
||||||
|
href="http://www.cmis.org/rep1/folder1" />
|
||||||
|
|
||||||
|
<atom:updated>2007-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- RFC 5005 Feed Paging -->
|
||||||
|
<atom:link rel="first"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children" />
|
||||||
|
<atom:link rel="next"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children/4" />
|
||||||
|
<atom:link rel="previous"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children/2" />
|
||||||
|
<atom:link rel="last"
|
||||||
|
href="http://www.cmis.org/rep1/folder1/children/last" />
|
||||||
|
|
||||||
|
<!-- sub-folder 1 -->
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="en-US">
|
||||||
|
<title>Folder Entry example (folder2)</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/folder-entry2</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parent"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2/parent" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2/actions" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry2/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/emailfolder" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
Folder Entry Example (folderid2) Property1 Value1
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>folderid2</cmis:objectId>
|
||||||
|
<cmis:baseType>folder</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>
|
||||||
|
2001-12-31T12:00:00
|
||||||
|
</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>emailfolder</cmis:objectType>
|
||||||
|
<cmis:parentId>folderid1</cmis:parentId>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canGetDescendants>true</cmis:canGetDescendants>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
<cmis:canGetChildren>true</cmis:canGetChildren>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
|
||||||
|
<!-- docid2 -->
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<title>Document Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/document-entry2</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2" />
|
||||||
|
<atom:link rel="edit-media"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry2" />
|
||||||
|
<atom:link rel="enclosure"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry2" />
|
||||||
|
<atom:link rel="alternate"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry2" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parents"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2/parents" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2/actions" />
|
||||||
|
<atom:link rel="cmis-allversions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2/allversions" />
|
||||||
|
<atom:link rel="cmis-latestversion"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2/latestversion" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry2/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/email" />
|
||||||
|
<atom:link rel="cmis-stream"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry2" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content
|
||||||
|
src="http://www.cmis.org/rep1/media/document-entry2">
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<atom:summary>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
</atom:summary>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>docid2</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>
|
||||||
|
2001-12-31T12:00:00
|
||||||
|
</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>
|
||||||
|
2001-12-31T12:00:00
|
||||||
|
</cmis:creationDate>
|
||||||
|
<cmis:objectType>email</cmis:objectType>
|
||||||
|
<cmis:isCheckedOut>false</cmis:isCheckedOut>
|
||||||
|
<cmis:isLatestVersion>true</cmis:isLatestVersion>
|
||||||
|
<cmis:isMajorVersion>true</cmis:isMajorVersion>
|
||||||
|
<cmis:isLatestMajorVersion>
|
||||||
|
true
|
||||||
|
</cmis:isLatestMajorVersion>
|
||||||
|
<cmis:isImmutable>false</cmis:isImmutable>
|
||||||
|
<cmis:isVersionSeriesCheckedOut>
|
||||||
|
false
|
||||||
|
</cmis:isVersionSeriesCheckedOut>
|
||||||
|
<cmis:versionSeriesCheckedOutBy></cmis:versionSeriesCheckedOutBy>
|
||||||
|
<cmis:versionSeriesCheckedOutID></cmis:versionSeriesCheckedOutID>
|
||||||
|
<cmis:checkinComment>
|
||||||
|
This is the initial checkin comment
|
||||||
|
</cmis:checkinComment>
|
||||||
|
<cmis:versionLabel>1.0</cmis:versionLabel>
|
||||||
|
<cmis:contentStreamLength>700</cmis:contentStreamLength>
|
||||||
|
<cmis:contentStreamMimetype>
|
||||||
|
text/plain
|
||||||
|
</cmis:contentStreamMimetype>
|
||||||
|
<cmis:contentStreamName>foo2.txt</cmis:contentStreamName>
|
||||||
|
<cmis:contentStreamURI>
|
||||||
|
http://www.cmis.org/rep1/media/document-entry2
|
||||||
|
</cmis:contentStreamURI>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>
|
||||||
|
true
|
||||||
|
</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canDeleteVersion>true</cmis:canDeleteVersion>
|
||||||
|
<cmis:canDeleteContent>true</cmis:canDeleteContent>
|
||||||
|
<cmis:canCheckout>true</cmis:canCheckout>
|
||||||
|
<cmis:canCancelCheckout>true</cmis:canCancelCheckout>
|
||||||
|
<cmis:canCheckin>true</cmis:canCheckin>
|
||||||
|
<cmis:canSetContent>true</cmis:canSetContent>
|
||||||
|
<cmis:canGetAllVersions>true</cmis:canGetAllVersions>
|
||||||
|
<cmis:canAddToFolder>true</cmis:canAddToFolder>
|
||||||
|
<cmis:canRemoveFromFolder>
|
||||||
|
true
|
||||||
|
</cmis:canRemoveFromFolder>
|
||||||
|
<cmis:canViewContent>true</cmis:canViewContent>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
||||||
|
</atom:entry>
|
||||||
|
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<title>Document Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/document-entry</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry" />
|
||||||
|
<atom:link rel="edit-media"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="enclosure"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
<atom:link rel="alternate"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parents"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/parents" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/actions" />
|
||||||
|
<atom:link rel="cmis-allversions"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/allversions" />
|
||||||
|
<atom:link rel="cmis-latestversion"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/latestversion" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/document-entry/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/email" />
|
||||||
|
<atom:link rel="cmis-stream"
|
||||||
|
href="http://www.cmis.org/rep1/media/document-entry" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content
|
||||||
|
src="http://www.cmis.org/rep1/media/document-entry">
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<atom:summary>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
</atom:summary>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>docid1</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>
|
||||||
|
2001-12-31T12:00:00
|
||||||
|
</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>email</cmis:objectType>
|
||||||
|
<cmis:isCheckedOut>false</cmis:isCheckedOut>
|
||||||
|
<cmis:isLatestVersion>true</cmis:isLatestVersion>
|
||||||
|
<cmis:isMajorVersion>true</cmis:isMajorVersion>
|
||||||
|
<cmis:isLatestMajorVersion>true</cmis:isLatestMajorVersion>
|
||||||
|
<cmis:isImmutable>false</cmis:isImmutable>
|
||||||
|
<cmis:isVersionSeriesCheckedOut>
|
||||||
|
false
|
||||||
|
</cmis:isVersionSeriesCheckedOut>
|
||||||
|
<cmis:versionSeriesCheckedOutBy></cmis:versionSeriesCheckedOutBy>
|
||||||
|
<cmis:versionSeriesCheckedOutID></cmis:versionSeriesCheckedOutID>
|
||||||
|
<cmis:checkinComment>
|
||||||
|
This is the initial checkin comment
|
||||||
|
</cmis:checkinComment>
|
||||||
|
<cmis:versionLabel>1.0</cmis:versionLabel>
|
||||||
|
<cmis:contentStreamLength>70</cmis:contentStreamLength>
|
||||||
|
<cmis:contentStreamMimetype>
|
||||||
|
text/plain
|
||||||
|
</cmis:contentStreamMimetype>
|
||||||
|
<cmis:contentStreamName>foo.txt</cmis:contentStreamName>
|
||||||
|
<cmis:contentStreamURI>
|
||||||
|
http://www.cmis.org/rep1/media/document-entry
|
||||||
|
</cmis:contentStreamURI>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canDeleteVersion>true</cmis:canDeleteVersion>
|
||||||
|
<cmis:canDeleteContent>true</cmis:canDeleteContent>
|
||||||
|
<cmis:canCheckout>true</cmis:canCheckout>
|
||||||
|
<cmis:canCancelCheckout>true</cmis:canCancelCheckout>
|
||||||
|
<cmis:canCheckin>true</cmis:canCheckin>
|
||||||
|
<cmis:canSetContent>true</cmis:canSetContent>
|
||||||
|
<cmis:canGetAllVersions>true</cmis:canGetAllVersions>
|
||||||
|
<cmis:canAddToFolder>true</cmis:canAddToFolder>
|
||||||
|
<cmis:canRemoveFromFolder>true</cmis:canRemoveFromFolder>
|
||||||
|
<cmis:canViewContent>true</cmis:canViewContent>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
||||||
|
|
||||||
|
<!-- notification of more items -->
|
||||||
|
<cmis:hasMoreItems>true</cmis:hasMoreItems>
|
||||||
|
</atom:feed>
|
68
source/java/org/alfresco/repo/cmis/rest/xsd/Example-FolderEntry.xml
Executable file
68
source/java/org/alfresco/repo/cmis/rest/xsd/Example-FolderEntry.xml
Executable file
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="en-US"
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<title>Folder Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/folder-entry</atom:id>
|
||||||
|
<atom:link rel='self' href="http://www.cmis.org/rep1/folder-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-parent"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry/parent" />
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry/actions" />
|
||||||
|
<atom:link rel="cmis-relationships"
|
||||||
|
href="http://www.cmis.org/rep1/folder-entry/relationships" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/emailfolder" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
Folder Entry Example (folderid1) Property1 Value1
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>folderid1</cmis:objectId>
|
||||||
|
<cmis:baseType>folder</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>2001-12-31T12:00:00</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>emailfolder</cmis:objectType>
|
||||||
|
<cmis:parentId>ParentFolderId</cmis:parentId>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canGetParents>true</cmis:canGetParents>
|
||||||
|
<cmis:canGetDescendants>true</cmis:canGetDescendants>
|
||||||
|
<cmis:canMove>true</cmis:canMove>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
<cmis:canGetChildren>true</cmis:canGetChildren>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
64
source/java/org/alfresco/repo/cmis/rest/xsd/Example-PolicyEntry.xml
Executable file
64
source/java/org/alfresco/repo/cmis/rest/xsd/Example-PolicyEntry.xml
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="en-US"
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<title>Policy Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/policy-entry</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/policy-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/v-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/policy-entry/actions" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/securitypolicy" />
|
||||||
|
<atom:link rel="cmis-source"
|
||||||
|
href="http://www.cmis.org/rep1/policy-entry/source" />
|
||||||
|
<atom:link rel="cmis-target"
|
||||||
|
href="http://www.cmis.org/rep1/policy-entry/target" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
Policy Entry Example (policyid1) Property1 Value1
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>policyid1</cmis:objectId>
|
||||||
|
<cmis:baseType>policy</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>2001-12-31T12:00:00</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>securitypolicy</cmis:objectType>
|
||||||
|
<cmis:source>docid1</cmis:source>
|
||||||
|
<cmis:target>docid2</cmis:target>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
11
source/java/org/alfresco/repo/cmis/rest/xsd/Example-Query.xml
Executable file
11
source/java/org/alfresco/repo/cmis/rest/xsd/Example-Query.xml
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<cmis:query xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:p="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.cmis.org/2008/05 ../CMIS-REST.xsd ">
|
||||||
|
<cmis:statement>SELECT * FROM document</cmis:statement>
|
||||||
|
<cmis:searchAllVersions>true</cmis:searchAllVersions>
|
||||||
|
<cmis:pageSize>0</cmis:pageSize>
|
||||||
|
<cmis:skipCount>0</cmis:skipCount>
|
||||||
|
<cmis:returnAllowableActions>false</cmis:returnAllowableActions>
|
||||||
|
</cmis:query>
|
65
source/java/org/alfresco/repo/cmis/rest/xsd/Example-RelationshipEntry.xml
Executable file
65
source/java/org/alfresco/repo/cmis/rest/xsd/Example-RelationshipEntry.xml
Executable file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<atom:entry xml:base="http://tempuri.org" xml:lang="en-US"
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2005/Atom ../ATOM4CMIS.xsd http://www.cmis.org/2008/05 C:\Java\eclipse\workspace\p8cmis\src\main\resources\rest-schema\CMIS-REST.xsd ">
|
||||||
|
|
||||||
|
<title>Relationship Entry example</title>
|
||||||
|
<atom:author xml:base="http://tempuri.org" xml:lang="">
|
||||||
|
<atom:name>Al Brown</atom:name>
|
||||||
|
</atom:author>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- URI to document entry resource -->
|
||||||
|
<atom:id>http://www.cmis.org/rep1/relationship-entry</atom:id>
|
||||||
|
<atom:link rel='self'
|
||||||
|
href="http://www.cmis.org/rep1/relationship-entry" />
|
||||||
|
|
||||||
|
<!-- lastModifiedDate -->
|
||||||
|
<atom:updated>2001-12-31T12:00:00</atom:updated>
|
||||||
|
|
||||||
|
<!-- createdDate -->
|
||||||
|
<atom:published>2001-12-31T12:00:00</atom:published>
|
||||||
|
|
||||||
|
<!-- atom links -->
|
||||||
|
<atom:link rel="edit"
|
||||||
|
href="http://www.cmis.org/rep1/relationship-entry" />
|
||||||
|
|
||||||
|
<!-- CMIS Links -->
|
||||||
|
<atom:link rel="cmis-allowableactions"
|
||||||
|
href="http://www.cmis.org/rep1/relationship-entry/actions" />
|
||||||
|
<atom:link rel="cmis-type"
|
||||||
|
href="http://www.cmis.org/rep1/type/emaillink" />
|
||||||
|
<atom:link rel="cmis-source"
|
||||||
|
href="http://www.cmis.org/rep1/relationship-entry/source" />
|
||||||
|
<atom:link rel="cmis-target"
|
||||||
|
href="http://www.cmis.org/rep1/relationship-entry/target" />
|
||||||
|
|
||||||
|
<!-- atom:content -->
|
||||||
|
<atom:content>
|
||||||
|
<!-- auto-generated HTML table of properties -->
|
||||||
|
Relationship Entry Example (relid1) Property1 Value1
|
||||||
|
</atom:content>
|
||||||
|
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:objectId>relid1</cmis:objectId>
|
||||||
|
<cmis:baseType>relationship</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>2001-12-31T12:00:00</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:objectType>emaillink</cmis:objectType>
|
||||||
|
<cmis:source>docid1</cmis:source>
|
||||||
|
<cmis:target>docid2</cmis:target>
|
||||||
|
</cmis:properties>
|
||||||
|
|
||||||
|
<!-- Optional Allowable actions -->
|
||||||
|
<cmis:allowableActions>
|
||||||
|
<cmis:canDelete>true</cmis:canDelete>
|
||||||
|
<cmis:canUpdateProperties>true</cmis:canUpdateProperties>
|
||||||
|
<cmis:canGetProperties>true</cmis:canGetProperties>
|
||||||
|
<cmis:canAddPolicy>true</cmis:canAddPolicy>
|
||||||
|
<cmis:canRemovePolicy>true</cmis:canRemovePolicy>
|
||||||
|
</cmis:allowableActions>
|
||||||
|
</atom:entry>
|
45
source/java/org/alfresco/repo/cmis/rest/xsd/Example-Service.xml
Executable file
45
source/java/org/alfresco/repo/cmis/rest/xsd/Example-Service.xml
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<app:service xmlns:app="http://www.w3.org/2007/app"
|
||||||
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
|
xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xsi:schemaLocation="http://www.w3.org/2007/app APP.xsd http://www.w3.org/2005/Atom ATOM4CMIS.xsd http://www.cmis.org/2008/05 CMIS-REST.xsd ">
|
||||||
|
<app:workspace cmis:repositoryRelationship="self">
|
||||||
|
<atom:title>Repository 1</atom:title>
|
||||||
|
<cmis:repositoryInfo>
|
||||||
|
<cmis:repositoryId>repid1</cmis:repositoryId>
|
||||||
|
<cmis:repositoryName>repository1</cmis:repositoryName>
|
||||||
|
<cmis:repositoryDescription>Repository Description</cmis:repositoryDescription>
|
||||||
|
<cmis:vendorName>ACME Vendor</cmis:vendorName>
|
||||||
|
<cmis:productName>ACME Repository</cmis:productName>
|
||||||
|
<cmis:productVersion>ACME Version 99.01</cmis:productVersion>
|
||||||
|
<cmis:capabilities>
|
||||||
|
<cmis:capabilityMultifiling>true</cmis:capabilityMultifiling>
|
||||||
|
<cmis:capabilityUnfiling>true</cmis:capabilityUnfiling>
|
||||||
|
<cmis:capabilityVersionSpecificFiling>true</cmis:capabilityVersionSpecificFiling>
|
||||||
|
<cmis:capabilityPWCUpdateable>true</cmis:capabilityPWCUpdateable>
|
||||||
|
<cmis:capabilityAllVersionsSearchable>true</cmis:capabilityAllVersionsSearchable>
|
||||||
|
<cmis:capabilityInnerJoin>true</cmis:capabilityInnerJoin>
|
||||||
|
<cmis:capabilityOuterJoin>true</cmis:capabilityOuterJoin>
|
||||||
|
<cmis:capabilityFullText>fulltextwithmetadata</cmis:capabilityFullText>
|
||||||
|
</cmis:capabilities>
|
||||||
|
<cmis:repositorySpecificInformation>Welcome to ACME 99</cmis:repositorySpecificInformation>
|
||||||
|
</cmis:repositoryInfo>
|
||||||
|
<app:collection cmis:collectionType="unfiled" href="http://www.cmis.org/rep1/unfiled">
|
||||||
|
<atom:title>unfiled collection</atom:title>
|
||||||
|
</app:collection>
|
||||||
|
<app:collection cmis:collectionType="root" href="http://www.cmis.org/rep1/root">
|
||||||
|
<atom:title>root collection</atom:title>
|
||||||
|
</app:collection>
|
||||||
|
<app:collection cmis:collectionType="checkedout" href="http://www.cmis.org/rep1/checkedout">
|
||||||
|
<atom:title>checkedout collection</atom:title>
|
||||||
|
</app:collection>
|
||||||
|
<app:collection cmis:collectionType="types" href="http://www.cmis.org/rep1/types">
|
||||||
|
<atom:title>type collection</atom:title>
|
||||||
|
</app:collection>
|
||||||
|
<app:collection cmis:collectionType="query" href="http://www.cmis.org/rep1/query">
|
||||||
|
<atom:title>type collection</atom:title>
|
||||||
|
</app:collection>
|
||||||
|
</app:workspace>
|
||||||
|
</app:service>
|
38
source/java/org/alfresco/repo/cmis/rest/xsd/Example-Type.xml
Executable file
38
source/java/org/alfresco/repo/cmis/rest/xsd/Example-Type.xml
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<cmis:type xmlns:cmis="http://www.cmis.org/2008/05"
|
||||||
|
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.cmis.org/2008/05 CMIS-REST.xsd ">
|
||||||
|
<cmis:objectId>documentTypeId</cmis:objectId>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
<cmis:lastModifiedBy>2001-12-31T12:00:00</cmis:lastModifiedBy>
|
||||||
|
<cmis:creationDate>2001-12-31T12:00:00</cmis:creationDate>
|
||||||
|
<cmis:queryName>document</cmis:queryName>
|
||||||
|
<cmis:displayName>document</cmis:displayName>
|
||||||
|
<cmis:baseTypeQueryName>document</cmis:baseTypeQueryName>
|
||||||
|
<cmis:parentId></cmis:parentId>
|
||||||
|
<cmis:description>The document type</cmis:description>
|
||||||
|
|
||||||
|
<cmis:isCreatable>true</cmis:isCreatable>
|
||||||
|
<cmis:isVersionable>true</cmis:isVersionable>
|
||||||
|
<cmis:isQueryable>true</cmis:isQueryable>
|
||||||
|
<cmis:isContentStreamAllowed>true</cmis:isContentStreamAllowed>
|
||||||
|
<cmis:isControllable>true</cmis:isControllable>
|
||||||
|
|
||||||
|
<cmis:property cmis:id="foo1">
|
||||||
|
<cmis:displayName>foo1</cmis:displayName>
|
||||||
|
<cmis:description>Description of foo1</cmis:description>
|
||||||
|
<cmis:propertyType>String</cmis:propertyType>
|
||||||
|
<cmis:cardinality>Single</cmis:cardinality>
|
||||||
|
<cmis:maxLength>64</cmis:maxLength>
|
||||||
|
<cmis:choices index="1">cmis:choices</cmis:choices>
|
||||||
|
<cmis:isOpenChoice>true</cmis:isOpenChoice>
|
||||||
|
<cmis:isRequired>true</cmis:isRequired>
|
||||||
|
<cmis:defaultValue>cmis:defaultValue</cmis:defaultValue>
|
||||||
|
<cmis:updateability>ro</cmis:updateability>
|
||||||
|
<cmis:isQueryable>true</cmis:isQueryable>
|
||||||
|
<cmis:isOrderable>true</cmis:isOrderable>
|
||||||
|
</cmis:property>
|
||||||
|
|
||||||
|
</cmis:type>
|
144
source/java/org/alfresco/repo/cmis/rest/xsd/TestXSDs.java
Normal file
144
source/java/org/alfresco/repo/cmis/rest/xsd/TestXSDs.java
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2008 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
* 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.xsd;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
import javax.xml.XMLConstants;
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import javax.xml.transform.Source;
|
||||||
|
import javax.xml.transform.dom.DOMSource;
|
||||||
|
import javax.xml.transform.stream.StreamSource;
|
||||||
|
import javax.xml.validation.Schema;
|
||||||
|
import javax.xml.validation.SchemaFactory;
|
||||||
|
import javax.xml.validation.Validator;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
import org.xml.sax.InputSource;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CMIS XSD Tests
|
||||||
|
*
|
||||||
|
* @author davidc
|
||||||
|
*/
|
||||||
|
public class TestXSDs extends TestCase
|
||||||
|
{
|
||||||
|
private CMISValidator cmisValidator = new CMISValidator();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets XML from file specified by class path
|
||||||
|
*
|
||||||
|
* @param classPath XML file
|
||||||
|
* @return XML
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private String getXML(String classPath)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
InputStream input = getClass().getResourceAsStream(classPath);
|
||||||
|
if (input == null)
|
||||||
|
{
|
||||||
|
throw new IOException(classPath + " not found.");
|
||||||
|
}
|
||||||
|
|
||||||
|
InputStreamReader reader = new InputStreamReader(input);
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
char[] buffer = new char[4096];
|
||||||
|
int bytesRead = -1;
|
||||||
|
while ((bytesRead = reader.read(buffer)) != -1)
|
||||||
|
{
|
||||||
|
writer.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
reader.close();
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return writer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assert XML is valid according to specified validator
|
||||||
|
*
|
||||||
|
* @param xml document to test
|
||||||
|
* @param validator validator to test with
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ParserConfigurationException
|
||||||
|
*/
|
||||||
|
private void assertValidXML(String xml, Validator validator)
|
||||||
|
throws IOException, ParserConfigurationException
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Document document = cmisValidator.getDocumentBuilder().parse(new InputSource(new StringReader(xml)));
|
||||||
|
validator.validate(new DOMSource(document));
|
||||||
|
}
|
||||||
|
catch (SAXException e)
|
||||||
|
{
|
||||||
|
fail(cmisValidator.toString(e, xml));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public void testRelaxNG()
|
||||||
|
// throws Exception
|
||||||
|
// {
|
||||||
|
// String xml = getXML("address.xml");
|
||||||
|
// SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.RELAXNG_NS_URI);
|
||||||
|
// Source schemaFile = new StreamSource(getClass().getResourceAsStream("address.rng"), getClass().getResource("address.rng").toExternalForm());
|
||||||
|
// Schema schema = factory.newSchema(schemaFile);
|
||||||
|
// assertValidXML(xml, schema.newValidator());
|
||||||
|
// }
|
||||||
|
|
||||||
|
public void testService()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
String xml = getXML("Example-Service.xml");
|
||||||
|
assertValidXML(xml, cmisValidator.getAppValidator());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testFolderChildren()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
String xml = getXML("Example-FolderChildren.xml");
|
||||||
|
assertValidXML(xml, cmisValidator.getCMISAtomValidator());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
27
source/java/org/alfresco/repo/cmis/rest/xsd/address.rng
Normal file
27
source/java/org/alfresco/repo/cmis/rest/xsd/address.rng
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<element name="addressBook" xmlns="http://relaxng.org/ns/structure/1.0">
|
||||||
|
<zeroOrMore>
|
||||||
|
<element name="card">
|
||||||
|
<choice>
|
||||||
|
<element name="givenName">
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
<group>
|
||||||
|
<element name="givenName">
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
<element name="familyName">
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
</group>
|
||||||
|
</choice>
|
||||||
|
<element name="email">
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
<optional>
|
||||||
|
<element name="note">
|
||||||
|
<text/>
|
||||||
|
</element>
|
||||||
|
</optional>
|
||||||
|
</element>
|
||||||
|
</zeroOrMore>
|
||||||
|
</element>
|
12
source/java/org/alfresco/repo/cmis/rest/xsd/address.xml
Normal file
12
source/java/org/alfresco/repo/cmis/rest/xsd/address.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<addressBook>
|
||||||
|
<card>
|
||||||
|
<givenName>John</givenName>
|
||||||
|
<familyName>Smith</familyName>
|
||||||
|
<email>js@example.com</email>
|
||||||
|
</card>
|
||||||
|
<card>
|
||||||
|
<givenName>Fred Bloggs</givenName>
|
||||||
|
<email>fb@example.net</email>
|
||||||
|
<note/>
|
||||||
|
</card>
|
||||||
|
</addressBook>
|
40
source/java/org/alfresco/repo/cmis/rest/xsd/example_feed.xml
Normal file
40
source/java/org/alfresco/repo/cmis/rest/xsd/example_feed.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:alf="http://www.alfresco.org" xmlns:app="http://www.w3.org/2007/app" xmlns:cmis="http://www.cmis.org/2008/05" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
|
||||||
|
<author><name>System</name></author>
|
||||||
|
<generator version="3.0.0 (SeaMistPreview1 @build-number@)">Alfresco (Community Network)</generator>
|
||||||
|
<icon>http://localhost:8080/alfresco/images/logo/AlfrescoLogo16.ico</icon>
|
||||||
|
<id>urn:uuid:78974cc9-2e91-11dd-add7-d79ea16aaad7</id>
|
||||||
|
<title>Company Home</title>
|
||||||
|
<updated>2008-05-30T22:44:50.379+01:00</updated>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children" rel="self"/>
|
||||||
|
<opensearch:totalResults>31</opensearch:totalResults>
|
||||||
|
<opensearch:startIndex>0</opensearch:startIndex>
|
||||||
|
<opensearch:itemsPerPage>0</opensearch:itemsPerPage>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children?pageNo=1&guest=&format=atomfeed" rel="first" type="application/atom+xml;type=feed"/>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children?pageNo=1&guest=&format=atomfeed" rel="last" type="application/atom+xml;type=feed"/>
|
||||||
|
<entry>
|
||||||
|
<author><name>System</name></author>
|
||||||
|
<content>78aef380-2e91-11dd-add7-d79ea16aaad7</content>
|
||||||
|
<id>urn:uuid:78aef380-2e91-11dd-add7-d79ea16aaad7</id>
|
||||||
|
<published>2008-05-30T22:43:42.120+01:00</published>
|
||||||
|
<summary>User managed definitions</summary>
|
||||||
|
<title>Data Dictionary</title>
|
||||||
|
<updated>2008-05-30T22:44:50.575+01:00</updated>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7" rel="self"/>
|
||||||
|
<app:edited>2008-05-30T22:44:50.575+01:00</app:edited>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7" rel="edit"/>
|
||||||
|
<alf:icon>http://localhost:8080/alfresco/images/icons/space-icon-default-16.gif</alf:icon>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7/permissions" rel="cmis-allowableactions"/>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7/associations" rel="cmis-relationships"/>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7/parent" rel="cmis-parent"/>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7/children" rel="cmis-children"/>
|
||||||
|
<link href="http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7/descendants" rel="cmis-descendants"/>
|
||||||
|
<cmis:objectId>workspace://SpacesStore/78aef380-2e91-11dd-add7-d79ea16aaad7</cmis:objectId>
|
||||||
|
<cmis:baseType>folder</cmis:baseType>
|
||||||
|
<!-- <cmis:createdBy>System</cmis:createdBy> -->
|
||||||
|
<cmis:creationDate>2008-05-30T22:43:42.120+01:00</cmis:creationDate>
|
||||||
|
<!-- <cmis:lastModifiedBy>System</cmis:lastModifiedBy> -->
|
||||||
|
<cmis:lastModificationDate>2008-05-30T22:44:50.575+01:00</cmis:lastModificationDate>
|
||||||
|
<cmis:name>Data Dictionary</cmis:name>
|
||||||
|
<cmis:parent>workspace://SpacesStore/78974cc9-2e91-11dd-add7-d79ea16aaad7</cmis:parent>
|
||||||
|
</entry>
|
||||||
|
</feed>
|
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" ?><service xmlns="http://www.w3.org/2007/app" xmlns:alf="http://www.alfresco.org" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05">
|
||||||
|
<workspace cmis:id="786f2b47-2e91-11dd-add7-d79ea16aaad7">
|
||||||
|
<atom:title>Main Repository</atom:title>
|
||||||
|
|
||||||
|
|
||||||
|
<cmis:repositoryInfo>
|
||||||
|
<cmis:repositoryId>786f2b47-2e91-11dd-add7-d79ea16aaad7</cmis:repositoryId>
|
||||||
|
<cmis:repositoryName>Main Repository</cmis:repositoryName>
|
||||||
|
<cmis:repositoryDescription/>
|
||||||
|
<cmis:vendorName>Alfresco</cmis:vendorName>
|
||||||
|
<cmis:productName>Alfresco Repository (Community Network)</cmis:productName>
|
||||||
|
<cmis:productVersion>3.0.0 (SeaMistPreview1 @build-number@)</cmis:productVersion>
|
||||||
|
<cmis:capabilities>
|
||||||
|
<cmis:capabilityMultifiling>true</cmis:capabilityMultifiling>
|
||||||
|
<cmis:capabilityUnfiling>false</cmis:capabilityUnfiling>
|
||||||
|
<cmis:capabilityVersionSpecificFiling>false</cmis:capabilityVersionSpecificFiling>
|
||||||
|
<cmis:capabilityPWCUpdateable>true</cmis:capabilityPWCUpdateable>
|
||||||
|
<cmis:capabilityAllVersionsSearchable>false</cmis:capabilityAllVersionsSearchable>
|
||||||
|
<cmis:capabilityInnerJoin>true</cmis:capabilityInnerJoin>
|
||||||
|
<cmis:capabilityOuterJoin>true</cmis:capabilityOuterJoin>
|
||||||
|
<cmis:capabilityFullText>fulltextwithmetadata</cmis:capabilityFullText>
|
||||||
|
</cmis:capabilities>
|
||||||
|
<cmis:repositorySpecificInformation/>
|
||||||
|
</cmis:repositoryInfo>
|
||||||
|
|
||||||
|
|
||||||
|
<collection cmis:collectionType="root" href="http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore//children">
|
||||||
|
<atom:title>CMIS root folder</atom:title>
|
||||||
|
</collection>
|
||||||
|
<collection cmis:collectionType="checkedout" href="http://example.org/cmis/main?checkedout">
|
||||||
|
<atom:title>CMIS checked-out documents</atom:title>
|
||||||
|
</collection>
|
||||||
|
<collection cmis:collectionType="types" href="http://example.org/cmis/main?types">
|
||||||
|
<atom:title>CMIS Types</atom:title>
|
||||||
|
</collection>
|
||||||
|
|
||||||
|
|
||||||
|
</workspace>
|
||||||
|
</service>
|
@@ -27,11 +27,13 @@ package org.alfresco.repo.web.scripts;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.web.scripts.TestWebScriptServer;
|
import org.alfresco.web.scripts.TestWebScriptServer;
|
||||||
import org.springframework.mock.web.MockHttpServletResponse;
|
import org.springframework.mock.web.MockHttpServletResponse;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base unit test class for web scripts.
|
* Base unit test class for web scripts.
|
||||||
*
|
*
|
||||||
@@ -68,7 +70,7 @@ public abstract class BaseWebScriptTest extends TestCase
|
|||||||
protected MockHttpServletResponse getRequest(String url, int expectedStatus)
|
protected MockHttpServletResponse getRequest(String url, int expectedStatus)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return sendRequest(METHOD_GET, url, expectedStatus, null, null);
|
return getRequest(url, expectedStatus, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -85,6 +87,21 @@ public abstract class BaseWebScriptTest extends TestCase
|
|||||||
return sendRequest(METHOD_DELETE, url, expectedStatus, null, null);
|
return sendRequest(METHOD_DELETE, url, expectedStatus, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "GET" the url and check for the expected status code
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param expectedStatus
|
||||||
|
* @param asUser
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
protected MockHttpServletResponse getRequest(String url, int expectedStatus, String asUser)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
return sendRequest(METHOD_GET, url, expectedStatus, null, null, asUser);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "POST" the url and check for the expected status code
|
* "POST" the url and check for the expected status code
|
||||||
*
|
*
|
||||||
@@ -98,7 +115,22 @@ public abstract class BaseWebScriptTest extends TestCase
|
|||||||
protected MockHttpServletResponse postRequest(String url, int expectedStatus, String body, String contentType)
|
protected MockHttpServletResponse postRequest(String url, int expectedStatus, String body, String contentType)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return postRequest(url, expectedStatus, body.getBytes(), contentType);
|
return postRequest(url, expectedStatus, body.getBytes(), contentType, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "POST" the url and check for the expected status code
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param expectedStatus
|
||||||
|
* @param asUser
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
protected MockHttpServletResponse postRequest(String url, int expectedStatus, String body, String contentType, String asUser)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
return postRequest(url, expectedStatus, body.getBytes(), contentType, asUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,11 +144,26 @@ public abstract class BaseWebScriptTest extends TestCase
|
|||||||
protected MockHttpServletResponse postRequest(String url, int expectedStatus, byte[] body, String contentType)
|
protected MockHttpServletResponse postRequest(String url, int expectedStatus, byte[] body, String contentType)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return sendRequest(METHOD_POST, url, expectedStatus, body, contentType);
|
return postRequest(url, expectedStatus, body, contentType, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "PUT" the url and check for the expected status code
|
* "POST" the url and check for the expected status code
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param expectedStatus
|
||||||
|
* @param asUser
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
protected MockHttpServletResponse postRequest(String url, int expectedStatus, byte[] body, String contentType, String asUser)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
return sendRequest(METHOD_POST, url, expectedStatus, body, contentType, asUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send request to Test Web Script Server
|
||||||
*
|
*
|
||||||
* @param url
|
* @param url
|
||||||
* @param expectedStatus
|
* @param expectedStatus
|
||||||
@@ -136,21 +183,34 @@ public abstract class BaseWebScriptTest extends TestCase
|
|||||||
* @param method
|
* @param method
|
||||||
* @param url
|
* @param url
|
||||||
* @param expectedStatus
|
* @param expectedStatus
|
||||||
|
* @param body
|
||||||
|
* @param contentType
|
||||||
|
* @param asUser
|
||||||
* @return
|
* @return
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
private MockHttpServletResponse sendRequest(String method, String url, int expectedStatus, byte[] body, String contentType)
|
private MockHttpServletResponse sendRequest(final String method, final String url, final int expectedStatus, final byte[] body, final String contentType, String asUser)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
MockHttpServletResponse response = BaseWebScriptTest.getServer().submitRequest(method, url, new HashMap<String, String>(), body, contentType);
|
// send request in context of specified user
|
||||||
|
String runAsUser = (asUser == null) ? AuthenticationUtil.getSystemUserName() : asUser;
|
||||||
|
MockHttpServletResponse response = AuthenticationUtil.runAs(new RunAsWork<MockHttpServletResponse>()
|
||||||
|
{
|
||||||
|
@SuppressWarnings("synthetic-access")
|
||||||
|
public MockHttpServletResponse doWork() throws Exception
|
||||||
|
{
|
||||||
|
return BaseWebScriptTest.getServer().submitRequest(method, url, new HashMap<String, String>(), body, contentType);
|
||||||
|
}
|
||||||
|
}, runAsUser);
|
||||||
|
|
||||||
if (expectedStatus > 0 && expectedStatus != response.getStatus())
|
if (expectedStatus > 0 && expectedStatus != response.getStatus())
|
||||||
{
|
{
|
||||||
//if (response.getStatus() == 500)
|
//if (response.getStatus() == 500)
|
||||||
//{
|
//{
|
||||||
System.out.println(response.getContentAsString());
|
// System.out.println(response.getContentAsString());
|
||||||
//}
|
//}
|
||||||
|
|
||||||
fail("Expected status code " + expectedStatus + " , " + response.getStatus() + " was returned");
|
fail("Status code " + response.getStatus() + " returned, but expected " + expectedStatus + " for " + url + " (" + method + ")");
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import org.alfresco.repo.cache.SimpleCache;
|
import org.alfresco.repo.cache.SimpleCache;
|
||||||
import org.alfresco.repo.model.Repository;
|
import org.alfresco.repo.model.Repository;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
|
import org.alfresco.repo.template.CropContentMethod;
|
||||||
import org.alfresco.repo.tenant.TenantDeployer;
|
import org.alfresco.repo.tenant.TenantDeployer;
|
||||||
import org.alfresco.repo.tenant.TenantDeployerService;
|
import org.alfresco.repo.tenant.TenantDeployerService;
|
||||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||||
@@ -179,6 +180,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
|||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.putAll(super.getTemplateParameters());
|
params.putAll(super.getTemplateParameters());
|
||||||
params.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver.getImageResolver());
|
params.put(TemplateService.KEY_IMAGE_RESOLVER, imageResolver.getImageResolver());
|
||||||
|
params.put("cropContent", new CropContentMethod());
|
||||||
addRepoParameters(params);
|
addRepoParameters(params);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
@@ -74,6 +74,7 @@ public class TestWebScriptRepoServer extends TestWebScriptServer
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
TestWebScriptServer testServer = getTestServer();
|
TestWebScriptServer testServer = getTestServer();
|
||||||
|
AuthenticationUtil.setSystemUserAsCurrentUser();
|
||||||
testServer.rep();
|
testServer.rep();
|
||||||
}
|
}
|
||||||
catch(Throwable e)
|
catch(Throwable e)
|
||||||
|
@@ -41,9 +41,10 @@ import javax.xml.namespace.QName;
|
|||||||
*/
|
*/
|
||||||
public interface CMISConstants
|
public interface CMISConstants
|
||||||
{
|
{
|
||||||
public static final String CMIS_V10_NS = "http://www.cmis.org/CMIS/1.0";
|
public static final String CMIS_200805_NS = "http://www.cmis.org/2008/05";
|
||||||
|
|
||||||
public static final QName OBJECT = new QName(CMIS_V10_NS, "object");
|
public static final QName PROPERTIES = new QName(CMIS_200805_NS, "properties");
|
||||||
public static final QName BASETYPE = new QName(CMIS_V10_NS, "baseType");
|
public static final QName OBJECTID = new QName(CMIS_200805_NS, "objectId");
|
||||||
|
public static final QName BASETYPE = new QName(CMIS_200805_NS, "baseType");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -45,8 +45,8 @@ public class CMISExtensionFactory extends AbstractExtensionFactory
|
|||||||
|
|
||||||
public CMISExtensionFactory()
|
public CMISExtensionFactory()
|
||||||
{
|
{
|
||||||
super(CMIS_V10_NS);
|
super(CMIS_200805_NS);
|
||||||
addImpl(OBJECT, CMISObject.class);
|
addImpl(PROPERTIES, CMISProperties.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -41,16 +41,22 @@ import org.apache.abdera.model.ElementWrapper;
|
|||||||
*
|
*
|
||||||
* @author davidc
|
* @author davidc
|
||||||
*/
|
*/
|
||||||
public class CMISObject extends ElementWrapper
|
public class CMISProperties extends ElementWrapper
|
||||||
{
|
{
|
||||||
public CMISObject(Element internal)
|
public CMISProperties(Element internal)
|
||||||
{
|
{
|
||||||
super(internal);
|
super(internal);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CMISObject(Factory factory)
|
public CMISProperties(Factory factory)
|
||||||
{
|
{
|
||||||
super(factory, CMISConstants.OBJECT);
|
super(factory, CMISConstants.PROPERTIES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getObjectId()
|
||||||
|
{
|
||||||
|
Element child = getInternal().getFirstChild(CMISConstants.OBJECTID);
|
||||||
|
return (child == null) ? null : child.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBaseType()
|
public String getBaseType()
|
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05">
|
||||||
|
<title>Test Document ${GUID}</title>
|
||||||
|
<summary>Test Document ${GUID} Summary</summary>
|
||||||
|
<content type="html">test content ${GUID}</content>
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:baseType>document</cmis:baseType>
|
||||||
|
</cmis:properties>
|
||||||
|
</entry>
|
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://www.cmis.org/2008/05">
|
||||||
|
<title>CMIS Test Folder ${GUID}</title>
|
||||||
|
<summary>CMIS Test Folder ${GUID} Summary</summary>
|
||||||
|
<cmis:properties>
|
||||||
|
<cmis:baseType>folder</cmis:baseType>
|
||||||
|
</cmis:properties>
|
||||||
|
</entry>
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user