From 45f141740b4ddba281ed1e5ef86329a1ece39f12 Mon Sep 17 00:00:00 2001 From: David Caruana Date: Fri, 1 May 2009 19:56:39 +0000 Subject: [PATCH] Merged DEV/CMIS0_61 to HEAD (part 1) 13973 Replace CMIS XSDs / Sample XML files with 0.6 versions. - fix issues with some of the samples - CMISSchemaTest passes 13981 AtomPub binding complies with CMIS v0.6 XSDs and Namepaces. - Tests passing 13982 Running list of implemented changes between CMIS v0.5 and v0.6 13986 AtomPub binding comply with CMIS v0.6 data model & API (part 1) - Tests are passing git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14172 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/cmis-api-context.xml | 2 +- config/alfresco/model/cmisModel.xml | 24 ++++---- .../alfresco/cmis/CMISDictionaryModel.java | 8 +-- .../alfresco/cmis/CMISFullTextSearchEnum.java | 60 ------------------- .../alfresco/cmis/CMISPropertyDefinition.java | 42 ++++++------- .../java/org/alfresco/cmis/CMISQueryEnum.java | 6 +- .../org/alfresco/cmis/CMISQueryService.java | 5 -- .../org/alfresco/cmis/CMISTypeDefinition.java | 4 +- source/java/org/alfresco/cmis/CMISTypeId.java | 4 +- .../CMISAbstractTypeDefinition.java | 4 +- .../alfresco/cmis/mapping/CMISMapping.java | 7 +-- .../cmis/search/CMISQueryServiceImpl.java | 13 +--- 12 files changed, 51 insertions(+), 128 deletions(-) delete mode 100644 source/java/org/alfresco/cmis/CMISFullTextSearchEnum.java diff --git a/config/alfresco/cmis-api-context.xml b/config/alfresco/cmis-api-context.xml index ab97ee43e8..5cc5e56633 100644 --- a/config/alfresco/cmis-api-context.xml +++ b/config/alfresco/cmis-api-context.xml @@ -10,7 +10,7 @@ - 0.5 + 0.6 workspace/SpacesStore/Company Home diff --git a/config/alfresco/model/cmisModel.xml b/config/alfresco/model/cmisModel.xml index 81e02a2f77..f1ab89ba70 100644 --- a/config/alfresco/model/cmisModel.xml +++ b/config/alfresco/model/cmisModel.xml @@ -9,7 +9,7 @@ - + @@ -56,7 +56,7 @@ - + Object Id @@ -146,8 +146,8 @@ - - cmis:Object + + cmis:object Name @@ -163,10 +163,10 @@ - + Document Document Type - cmis:FileSystemObject + cmis:filesystemobject Is Immutable @@ -319,10 +319,10 @@ - + Folder Folder Type - cmis:FileSystemObject + cmis:filesystemobject Parent Id @@ -347,10 +347,10 @@ - + Relationship Relationship Type - cmis:Object + cmis:object Source Id @@ -373,10 +373,10 @@ - + Policy Policy Type - cmis:Object + cmis:object Policy Name diff --git a/source/java/org/alfresco/cmis/CMISDictionaryModel.java b/source/java/org/alfresco/cmis/CMISDictionaryModel.java index 3d92d9e4e4..6b5f5ac57f 100644 --- a/source/java/org/alfresco/cmis/CMISDictionaryModel.java +++ b/source/java/org/alfresco/cmis/CMISDictionaryModel.java @@ -37,22 +37,22 @@ public interface CMISDictionaryModel /** * Type id for CMIS documents, from the spec. */ - public static String DOCUMENT_OBJECT_TYPE = "Document"; + public static String DOCUMENT_OBJECT_TYPE = "document"; /** * Type is for CMIS folders, from the spec. */ - public static String FOLDER_OBJECT_TYPE = "Folder"; + public static String FOLDER_OBJECT_TYPE = "folder"; /** * Type Id for CMIS Relationships, from the spec. */ - public static String RELATIONSHIP_OBJECT_TYPE = "Relationship"; + public static String RELATIONSHIP_OBJECT_TYPE = "relationship"; /** * Type Id for CMIS Policies, from the spec. */ - public static String POLICY_OBJECT_TYPE = "Policy"; + public static String POLICY_OBJECT_TYPE = "policy"; // TODO: spec issue - objectTypeEnum is lower cased - object type ids are repository specific in spec public static CMISTypeId DOCUMENT_TYPE_ID = new CMISTypeId(CMISScope.DOCUMENT, DOCUMENT_OBJECT_TYPE.toLowerCase(), ContentModel.TYPE_CONTENT); diff --git a/source/java/org/alfresco/cmis/CMISFullTextSearchEnum.java b/source/java/org/alfresco/cmis/CMISFullTextSearchEnum.java deleted file mode 100644 index 60d57c458d..0000000000 --- a/source/java/org/alfresco/cmis/CMISFullTextSearchEnum.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.cmis; - -/** - * CMIS Full Text Search Enum - * - * @author andyh - */ -public enum CMISFullTextSearchEnum implements EnumLabel -{ - NO_FULL_TEXT("none"), - FULL_TEXT_ONLY("fulltextonly"), - FULL_TEXT_AND_STRUCTURED("fulltextandstructured"); - - - private String label; - - /** - * Construct - * - * @param label - */ - CMISFullTextSearchEnum(String label) - { - this.label = label; - } - - /* (non-Javadoc) - * @see org.alfresco.cmis.EnumLabel#label() - */ - public String getLabel() - { - return label; - } - - public static EnumFactory FACTORY = new EnumFactory(CMISFullTextSearchEnum.class, null, true); -} diff --git a/source/java/org/alfresco/cmis/CMISPropertyDefinition.java b/source/java/org/alfresco/cmis/CMISPropertyDefinition.java index 24577e087f..5fc320d953 100644 --- a/source/java/org/alfresco/cmis/CMISPropertyDefinition.java +++ b/source/java/org/alfresco/cmis/CMISPropertyDefinition.java @@ -76,27 +76,6 @@ public interface CMISPropertyDefinition */ public CMISCardinalityEnum getCardinality(); - /** - * For variable length properties, get the maximum length allowed. Unsupported. - * - * @return - */ - public int getMaximumLength(); - - /** - * For properties of type CMISPropertyType.XML the schema to which the property must conform. Unsupported - * - * @return - the schema URI - */ - public String getSchemaURI(); - - /** - * For properties of type CMISPropertyType.XML the encoding used for the property value - * - * @return the encoding - */ - public String getEncoding(); - /** * Get the choices available as values for this property TODO: not implemented yet * @@ -145,7 +124,28 @@ public interface CMISPropertyDefinition * @return */ public boolean isOrderable(); + + /** + * For variable length properties, get the maximum length allowed. Unsupported. + * + * @return + */ + public int getMaximumLength(); + /** + * For properties of type CMISPropertyType.XML the schema to which the property must conform. Unsupported + * + * @return - the schema URI + */ + public String getSchemaURI(); + + /** + * For properties of type CMISPropertyType.XML the encoding used for the property value + * + * @return the encoding + */ + public String getEncoding(); + /** * Gets the property accessor (for reading / writing values) * diff --git a/source/java/org/alfresco/cmis/CMISQueryEnum.java b/source/java/org/alfresco/cmis/CMISQueryEnum.java index 6f85a665f2..8dea4d7746 100644 --- a/source/java/org/alfresco/cmis/CMISQueryEnum.java +++ b/source/java/org/alfresco/cmis/CMISQueryEnum.java @@ -34,9 +34,9 @@ public enum CMISQueryEnum implements EnumLabel NONE("none"), METADATA_ONLY("metadataonly"), FULLTEXT_ONLY("fulltextonly"), - BOTH("both"); - - + BOTH_SEPERATE("bothseperate"), + BOTH_COMBINED("bothcombined"); + private String label; /** diff --git a/source/java/org/alfresco/cmis/CMISQueryService.java b/source/java/org/alfresco/cmis/CMISQueryService.java index 51b94d9104..46fd638cfd 100644 --- a/source/java/org/alfresco/cmis/CMISQueryService.java +++ b/source/java/org/alfresco/cmis/CMISQueryService.java @@ -60,11 +60,6 @@ public interface CMISQueryService */ public CMISJoinEnum getJoinSupport(); - /** - * Get the full text search support level in queries. - */ - public CMISFullTextSearchEnum getFullTextSearchSupport(); - /** * Can you query Private Working Copies of a document. * diff --git a/source/java/org/alfresco/cmis/CMISTypeDefinition.java b/source/java/org/alfresco/cmis/CMISTypeDefinition.java index 0b438120c9..46b0d4eae9 100644 --- a/source/java/org/alfresco/cmis/CMISTypeDefinition.java +++ b/source/java/org/alfresco/cmis/CMISTypeDefinition.java @@ -79,11 +79,11 @@ public interface CMISTypeDefinition public Collection getSubTypes(boolean descendants); /** - * Get the root type + * Get the base type * * @return */ - public CMISTypeDefinition getRootType(); + public CMISTypeDefinition getBaseType(); /** * Get the description for the type diff --git a/source/java/org/alfresco/cmis/CMISTypeId.java b/source/java/org/alfresco/cmis/CMISTypeId.java index fec1c69dd2..ad7457fd5a 100644 --- a/source/java/org/alfresco/cmis/CMISTypeId.java +++ b/source/java/org/alfresco/cmis/CMISTypeId.java @@ -86,10 +86,10 @@ public class CMISTypeId implements Serializable } /** - * Get the root type id + * Get the base type id * @return */ - public CMISTypeId getRootTypeId() + public CMISTypeId getBaseTypeId() { switch (scope) { diff --git a/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java b/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java index 595268ef01..2f51436616 100644 --- a/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java +++ b/source/java/org/alfresco/cmis/dictionary/CMISAbstractTypeDefinition.java @@ -172,7 +172,7 @@ public class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializa logger.debug("Type " + objectTypeId + ": parent=" + (parentType == null ? "" : parentType.getTypeId()) + ", internal parent=" + (internalParentType == null ? "" : internalParentType.getTypeId())); - CMISTypeId rootTypeId = objectTypeId.getRootTypeId(); + CMISTypeId rootTypeId = objectTypeId.getBaseTypeId(); if (rootTypeId != null) { rootType = registry.objectDefsByTypeId.get(rootTypeId); @@ -288,7 +288,7 @@ public class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializa * (non-Javadoc) * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getRootType() */ - public CMISTypeDefinition getRootType() + public CMISTypeDefinition getBaseType() { return rootType; } diff --git a/source/java/org/alfresco/cmis/mapping/CMISMapping.java b/source/java/org/alfresco/cmis/mapping/CMISMapping.java index 80ced517ec..e862e80f62 100644 --- a/source/java/org/alfresco/cmis/mapping/CMISMapping.java +++ b/source/java/org/alfresco/cmis/mapping/CMISMapping.java @@ -38,7 +38,6 @@ import org.alfresco.cmis.CMISDictionaryModel; import org.alfresco.cmis.CMISPropertyId; import org.alfresco.cmis.CMISScope; import org.alfresco.cmis.CMISTypeId; -import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; import org.alfresco.service.ServiceRegistry; @@ -67,7 +66,7 @@ public class CMISMapping implements InitializingBean /** * The Alfresco CMIS model URI. */ - public static String CMIS_MODEL_URI = "http://www.alfresco.org/model/cmis/0.5"; + public static String CMIS_MODEL_URI = "http://www.alfresco.org/model/cmis/0.6"; /** * The Alfresco CMIS Model name. @@ -80,8 +79,8 @@ public class CMISMapping implements InitializingBean public static QName CMIS_MODEL_QNAME = QName.createQName(CMIS_MODEL_URI, CMIS_MODEL_NAME); // CMIS Internal Types - public static String OBJECT_OBJECT_TYPE = "Object"; - public static String FILESYSTEM_OBJECT_TYPE ="FileSystemObject"; + public static String OBJECT_OBJECT_TYPE = "object"; + public static String FILESYSTEM_OBJECT_TYPE ="filesystemobject"; // CMIS Data Types public static QName CMIS_DATATYPE_ID = QName.createQName(CMIS_MODEL_URI, "id"); diff --git a/source/java/org/alfresco/cmis/search/CMISQueryServiceImpl.java b/source/java/org/alfresco/cmis/search/CMISQueryServiceImpl.java index 5d9319dcf1..3c0f406741 100644 --- a/source/java/org/alfresco/cmis/search/CMISQueryServiceImpl.java +++ b/source/java/org/alfresco/cmis/search/CMISQueryServiceImpl.java @@ -29,7 +29,6 @@ import java.util.Map; import java.util.Set; import org.alfresco.cmis.CMISDictionaryService; -import org.alfresco.cmis.CMISFullTextSearchEnum; import org.alfresco.cmis.CMISJoinEnum; import org.alfresco.cmis.CMISQueryEnum; import org.alfresco.cmis.CMISQueryOptions; @@ -164,17 +163,7 @@ public class CMISQueryServiceImpl implements CMISQueryService */ public CMISQueryEnum getQuerySupport() { - return CMISQueryEnum.BOTH; - } - - /* - * (non-Javadoc) - * - * @see org.alfresco.cmis.search.CMISQueryService#getFullTextSearchSupport() - */ - public CMISFullTextSearchEnum getFullTextSearchSupport() - { - return CMISFullTextSearchEnum.FULL_TEXT_AND_STRUCTURED; + return CMISQueryEnum.BOTH_COMBINED; } /*