From 3e303a86d54e6b8e0852ee0c2d3ba2e6dae6755f Mon Sep 17 00:00:00 2001 From: David Caruana Date: Thu, 4 Sep 2008 11:08:13 +0000 Subject: [PATCH] Merge from SEAMIST3 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10730 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/cmis/atomentry.lib.atom.ftl | 5 +- .../org/alfresco/cmis/atomfeed.lib.atom.ftl | 1 + .../repository/repository.get.atom.ftl | 3 +- .../repository/repository.get.desc.xml | 1 + .../repository/repository.get.html.ftl | 63 +++ .../org/alfresco/repository/repository.get.js | 1 + .../store/children.get.atomfeed.ftl | 2 - .../web-scripts-application-context.xml | 13 +- .../alfresco/repo/cmis/rest/CMISScript.java | 15 +- .../alfresco/repo/cmis/rest/CMISService.java | 440 ------------------ .../org/alfresco/repo/cmis/rest/CMISTest.java | 20 +- .../org/alfresco/repo/cmis/rest/xsd/APP.xsd | 96 ++-- .../alfresco/repo/cmis/rest/xsd/CMIS-REST.xsd | 264 ++++------- .../rest/xsd/Example-AllowableActions.xml | 8 +- .../repo/cmis/rest/xsd/Example-Service.xml | 1 + .../repo/cmis/rest/xsd/Example-Type.xml | 12 +- 16 files changed, 237 insertions(+), 708 deletions(-) create mode 100644 config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.html.ftl delete mode 100644 source/java/org/alfresco/repo/cmis/rest/CMISService.java diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl index 5c991f3cd1..96a93c1cfd 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomentry.lib.atom.ftl @@ -36,7 +36,9 @@ ${xmldate(node.properties.modified)} ${node.nodeRef} ${node.properties.content.size} + ${node.name} document + document [#-- TODO --] ${node.properties.creator} ${node.properties.modifier} ${node.properties.content.mimetype} @@ -125,10 +127,11 @@ ${xmldate(node.properties.modified)} ${node.nodeRef} ${node.parent.nodeRef} + ${node.name} + document [#-- TODO --] folder ${node.properties.creator} ${node.properties.modifier} - ${node.name} [/#macro] diff --git a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl index 46d4d0679b..bc4b807812 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/cmis/atomfeed.lib.atom.ftl @@ -26,6 +26,7 @@ ${absurl(url.context)}/images/logo/AlfrescoLogo16.ico urn:uuid:${node.id} + [#nested] [#-- NOTE: Custom links --] ${node.name} ${xmldate(node.properties.modified)} diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl index 0563ffce48..6a03f60954 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.atom.ftl @@ -19,9 +19,10 @@ false true false - innerAndOuter <#-- TODO: check --> + noJoin fulltextandstructured + ${cmisVersion} diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml index 16f3d100c5..189cd08383 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.desc.xml @@ -2,6 +2,7 @@ Repository AtomPub Service Document Repository ATOM Publishing Service Document /api/repository + /api/cmis none CMIS diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.html.ftl new file mode 100644 index 0000000000..117428057e --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.html.ftl @@ -0,0 +1,63 @@ + + + + Alfresco CMIS v${cmisVersion} + + + + + + + + +
AlfrescoAlfresco CMIS v${cmisVersion} (REST Binding)
+
+ + +
Back to Web Scripts Home
+
+ Introduction + + + + +
The Content Management Interoperability Services (CMIS) standard defines a domain + model and set of API bindings, such as Web Services and REST/Atom that can be used + by applications to work with one or more Content Management repositories/systems.
+
+ REST Binding + + +
Alfresco's Content Repository provides the CMIS REST binding, an extension of the Atom Publishing Protocol. + All CMIS services are implemented as Web Scripts, + therefore support all Web Script capabilities such as authentication, content negotiation, tunelling etc.
+
+ CMIS Services + + +
A description of each CMIS service is available in the reference documentation.
+
+ CMIS Repository Information + + +
(also available as an APP Service Document)
+
+ + + + + + + + + + + + + + + + +
Repository Id:${server.id}
Repository Name:${server.name}
Repository Description:[none]
Vendor Name:Alfresco
Product Name:Alfresco Repository (${server.edition})
Product Version:${server.version}
Multifiling:true
Unfiling:false
VersionSpecificFiling:false
PWCUpdateable:true
AllVersionsSearchable:false
Join:noJoin
FullText:fulltextandstructured
VersionsSupported:${cmisVersion}
repositorySpecificInformation:[none]
+ + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.js b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.js index c6dd600647..4eb6324e4a 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/repository.get.js @@ -1 +1,2 @@ +model.cmisVersion = cmis.version; model.defaultRootFolderPath = cmis.defaultRootFolderPath; \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.get.atomfeed.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.get.atomfeed.ftl index 18656e9cc3..c66965b7ae 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.get.atomfeed.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/store/children.get.atomfeed.ftl @@ -10,7 +10,6 @@ [@feedLib.node node=node] [@pagingLib.links cursor=cursor/] - [@entryLib.folderCMISLinks node=node/] [#-- TODO: not part of 0.42 schema --] [/@feedLib.node] [#list results as child] @@ -24,7 +23,6 @@ [/#list] [@feedLib.hasMore more=cursor/] -[@entryLib.folderCMISProps node=node/] [#-- TODO: not part of 0.42 schema --] [@pagingLib.opensearch cursor=cursor/] diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml index 4ec2687fc9..1913bec0fa 100644 --- a/config/alfresco/web-scripts-application-context.xml +++ b/config/alfresco/web-scripts-application-context.xml @@ -394,21 +394,12 @@ cmis - + - - workspace/SpacesStore/Company Home - - - - - - - - + http://www.cmis.org/2008/05 diff --git a/source/java/org/alfresco/repo/cmis/rest/CMISScript.java b/source/java/org/alfresco/repo/cmis/rest/CMISScript.java index a20ac9042a..a3c6f16589 100644 --- a/source/java/org/alfresco/repo/cmis/rest/CMISScript.java +++ b/source/java/org/alfresco/repo/cmis/rest/CMISScript.java @@ -24,7 +24,8 @@ */ package org.alfresco.repo.cmis.rest; -import org.alfresco.repo.cmis.rest.CMISService.TypesFilter; +import org.alfresco.cmis.CMISService; +import org.alfresco.cmis.CMISService.TypesFilter; import org.alfresco.repo.jscript.BaseScopableProcessorExtension; import org.alfresco.repo.jscript.ScriptNode; import org.alfresco.repo.model.Repository; @@ -41,7 +42,7 @@ import org.alfresco.service.cmr.repository.NodeRef; * * @author davic */ -public class CMISScript extends BaseScopableProcessorExtension +public class CMISScript extends BaseScopableProcessorExtension { private static final TypesFilter defaultTypesFilter = TypesFilter.FoldersAndDocuments; @@ -91,6 +92,16 @@ public class CMISScript extends BaseScopableProcessorExtension this.cmisService = cmisService; } + /** + * Gets the supported CMIS Version + * + * @return CMIS version + */ + public String getVersion() + { + return cmisService.getCMISVersion(); + } + /** * Gets the default root folder path * diff --git a/source/java/org/alfresco/repo/cmis/rest/CMISService.java b/source/java/org/alfresco/repo/cmis/rest/CMISService.java deleted file mode 100644 index f9a3fa2e2d..0000000000 --- a/source/java/org/alfresco/repo/cmis/rest/CMISService.java +++ /dev/null @@ -1,440 +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.HashMap; -import java.util.List; -import java.util.Map; - -import org.alfresco.error.AlfrescoRuntimeException; -import org.alfresco.model.ContentModel; -import org.alfresco.repo.model.Repository; -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.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 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 + "\" " + - "-ASPECT:\"" + ContentModel.ASPECT_WORKING_COPY + "\""; - - 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 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(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() - { - public NodeRef doWork() throws Exception - { - return retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback() - { - 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 = null; - try - { - resultSet = searchService.query(params); - List results = resultSet.getNodeRefs(); - NodeRef[] nodeRefs = new NodeRef[results.size()]; - return results.toArray(nodeRefs); - } - finally - { - if (resultSet != null) 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 = null; - try - { - resultSet = searchService.query(params); - List results = resultSet.getNodeRefs(); - NodeRef[] nodeRefs = new NodeRef[results.size()]; - return results.toArray(nodeRefs); - } - finally - { - if (resultSet != null) resultSet.close(); - } - } - -} diff --git a/source/java/org/alfresco/repo/cmis/rest/CMISTest.java b/source/java/org/alfresco/repo/cmis/rest/CMISTest.java index 30d807e81e..6bdfcf1175 100644 --- a/source/java/org/alfresco/repo/cmis/rest/CMISTest.java +++ b/source/java/org/alfresco/repo/cmis/rest/CMISTest.java @@ -473,10 +473,7 @@ public class CMISTest extends BaseCMISWebScriptTest { // retrieve test folder for checkouts Entry testFolder = createTestFolder("testGetCheckedOut"); - Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); - Feed scope = getFeed(childrenLink.getHref()); - assertNotNull(scope); - CMISProperties props = scope.getExtension(CMISConstants.PROPERTIES); + CMISProperties props = testFolder.getExtension(CMISConstants.PROPERTIES); String scopeId = props.getObjectId(); assertNotNull(scopeId); @@ -497,10 +494,9 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for checkouts Entry testFolder = createTestFolder("testCheckout"); Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); - Feed scope = getFeed(childrenLink.getHref()); // create document for checkout - Entry document = createDocument(scope.getSelfLink().getHref(), "testCheckout"); + Entry document = createDocument(childrenLink.getHref(), "testCheckout"); Response documentRes = sendRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200, getAtomValidator()); assertNotNull(documentRes); String documentXML = documentRes.getContentAsString(); @@ -528,10 +524,9 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for checkouts Entry testFolder = createTestFolder("testCancelCheckout"); Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); - Feed scope = getFeed(childrenLink.getHref()); // create document for checkout - Entry document = createDocument(scope.getSelfLink().getHref(), "testCancelCheckout"); + Entry document = createDocument(childrenLink.getHref(), "testCancelCheckout"); Response documentRes = sendRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200, getAtomValidator()); assertNotNull(documentRes); String xml = documentRes.getContentAsString(); @@ -574,10 +569,9 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for checkins Entry testFolder = createTestFolder("testCheckIn"); Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); - Feed scope = getFeed(childrenLink.getHref()); // create document for checkout - Entry document = createDocument(scope.getSelfLink().getHref(), "testCheckin"); + Entry document = createDocument(childrenLink.getHref(), "testCheckin"); Response documentRes = sendRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200, getAtomValidator()); assertNotNull(documentRes); String xml = documentRes.getContentAsString(); @@ -648,10 +642,9 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for checkins Entry testFolder = createTestFolder("testUpdateOnCheckIn"); Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); - Feed scope = getFeed(childrenLink.getHref()); // create document for checkout - Entry document = createDocument(scope.getSelfLink().getHref(), "testUpdateOnCheckIn"); + Entry document = createDocument(childrenLink.getHref(), "testUpdateOnCheckIn"); Response documentRes = sendRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200, getAtomValidator()); assertNotNull(documentRes); String xml = documentRes.getContentAsString(); @@ -711,10 +704,9 @@ public class CMISTest extends BaseCMISWebScriptTest // retrieve test folder for checkins Entry testFolder = createTestFolder("testGetAllVersions"); Link childrenLink = testFolder.getLink(CMISConstants.REL_CHILDREN); - Feed scope = getFeed(childrenLink.getHref()); // create document for checkout - Entry document = createDocument(scope.getSelfLink().getHref(), "testGetAllVersions"); + Entry document = createDocument(childrenLink.getHref(), "testGetAllVersions"); Response documentRes = sendRequest(new GetRequest(document.getSelfLink().getHref().toString()), 200, getAtomValidator()); assertNotNull(documentRes); String xml = documentRes.getContentAsString(); diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd b/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd index 328653abd0..0f762b6ee7 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/APP.xsd @@ -1,55 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-REST.xsd b/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-REST.xsd index 27845229a0..6b38e0b1b2 100644 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-REST.xsd +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/CMIS-REST.xsd @@ -1,20 +1,15 @@ - + - - - + @@ -26,9 +21,7 @@ - - @@ -37,26 +30,24 @@ + - - + - - @@ -76,22 +67,23 @@ - + - + - - + + - - + + + @@ -108,7 +100,15 @@ - + + + + + + + + + @@ -117,18 +117,15 @@ - - + - @@ -138,52 +135,38 @@ - - - - - - - - - - + + + + - - - - - + - - - - + + @@ -201,9 +184,10 @@ + - @@ -212,7 +196,6 @@ - @@ -220,197 +203,140 @@ - + + - - + - - - - - - + + - - - + - - - + - - - - + - - - - - + + - - - + + - - + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + - - - - - - - + - - - - + + - - - - + + + - - + - + - - @@ -447,7 +370,6 @@ - @@ -458,8 +380,6 @@ - - @@ -470,7 +390,6 @@ - @@ -481,7 +400,6 @@ - @@ -492,7 +410,6 @@ - @@ -503,19 +420,16 @@ - - + - - @@ -526,18 +440,16 @@ - - + - - + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/Example-AllowableActions.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/Example-AllowableActions.xml index b9d7afdb2b..181d4d07db 100755 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/Example-AllowableActions.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/Example-AllowableActions.xml @@ -5,12 +5,12 @@ 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 CMIS-REST.xsd "> - - true - cmis:parentId http://tempuri.org + + + true true @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Service.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Service.xml index b0cfba562d..b8343ba592 100755 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Service.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Service.xml @@ -23,6 +23,7 @@ innerAndOuter fulltextandstructured + 0.43 Welcome to ACME 99 diff --git a/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Type.xml b/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Type.xml index d6b3a8130a..f1e2d4453a 100755 --- a/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Type.xml +++ b/source/java/org/alfresco/repo/cmis/rest/xsd/Example-Type.xml @@ -13,17 +13,21 @@ document The document type - true - true + true true - true true + true + allowed + + foo1 + propIdForFoo1 foo1 Description of foo1 + false String Single 64 @@ -36,4 +40,4 @@ true - + \ No newline at end of file