Merged CMIS063 to HEAD

16809: CMIS 0.7 upgrade - checkpoint.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17241 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2009-10-29 18:00:30 +00:00
parent d4b2de0ee2
commit ec7bb80cf3
9 changed files with 22 additions and 3 deletions

View File

@@ -67,3 +67,9 @@
<opensearch:startIndex>${cursor.startRow}</opensearch:startIndex>
<opensearch:itemsPerPage>${cursor.pageSize}</opensearch:itemsPerPage>
[/#macro]
[#macro cmis cursor]
[#-- NOTE: this macro requires the definition of xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" in --]
[#-- the enclosing document --]
<cmisra:numItems>${cursor.totalRows}</cmisra:numItems>
[/#macro]

View File

@@ -3,7 +3,7 @@
[#import "/org/alfresco/cmis/links.lib.atom.ftl" as linksLib/]
<?xml version="1.0" encoding="utf-8"?>
<service [@nsLib.serviceNS/]>
<workspace cmis:id="${server.id}" cmis:repositoryRelationship="self">
<workspace cmis:id="${server.id}">
<atom:title>${server.name}</atom:title>
<collection href="${absurl(url.serviceContext)}[@linksLib.nodeuri defaultRootFolder/]/children">

View File

@@ -16,6 +16,7 @@
[@pagingLib.linksredirect cursor "${queryUri}" "${queryArgs}" "${cmisconstants.MIMETYPE_FEED}"/]
[/@feedLib.generic]
[@pagingLib.opensearch cursor/]
[@pagingLib.cmis cursor/]
[#assign rs = cmisresultset(resultset)]
[#list rs.rows as row]

View File

@@ -16,6 +16,7 @@
[@pagingLib.links cursor/]
[/@feedLib.generic]
[@pagingLib.opensearch cursor/]
[@pagingLib.cmis cursor/]
[#assign rs = cmisresultset(resultset)]
[#list rs.rows as row]

View File

@@ -22,6 +22,7 @@
[@pagingLib.links cursor/]
[/@feedLib.node]
[@pagingLib.opensearch cursor/]
[@pagingLib.cmis cursor/]
[#list results as child]
[#if child.isDocument]

View File

@@ -17,6 +17,7 @@
[@pagingLib.links cursor/]
[/@feedLib.node]
[@pagingLib.opensearch cursor/]
[@pagingLib.cmis cursor/]
[#list results as assoc]
[@entryLib.assoc assoc=assoc propfilter=filter includeallowableactions=includeAllowableActions/]

View File

@@ -23,6 +23,7 @@
[@pagingLib.links cursor/]
[/@feedLib.generic]
[@pagingLib.opensearch cursor/]
[@pagingLib.cmis cursor/]
[#list results as child]
[@entryLib.typedef child includePropertyDefinitions/]

View File

@@ -29,7 +29,14 @@ script:
// depth
var depth = args[cmis.ARG_DEPTH];
model.depth = (depth === null) ? 1 : parseInt(depth);
if (depth == 0)
{
status.code = 500;
status.message = "Depth cannot be 0";
status.redirect = true;
break script;
}
model.depth = (depth === null) ? -1 : parseInt(depth);
// handle property definitions
var includePropertyDefinitions = args[cmis.ARG_INCLUDE_PROPERTY_DEFINITIONS];

View File

@@ -168,7 +168,8 @@ public class ContentSet extends AbstractWebScript
ContentReader reader = contentService.getReader(nodeRef, propertyQName);
if (reader != null)
{
throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Content already exists.");
// error code as per CMIS specification
throw new WebScriptException(HttpServletResponse.SC_CONFLICT, "Content already exists.");
}
}