Merged CMIS063 to HEAD

Resolve merge issues.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17272 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2009-10-30 22:34:54 +00:00
parent e27a2b6f56
commit 9cafc890c4
10 changed files with 77 additions and 134 deletions

View File

@@ -32,7 +32,8 @@ package org.alfresco.cmis;
public enum CMISAllowedActionEnum implements EnumLabel
{
// navigation services
CAN_GET_DESCENDANTS("canGetDescendants"),
CAN_GET_DESCENDANTS("canGetDescendants"),
CAN_GET_FOLDER_TREE("canGetFolderTree"),
CAN_GET_CHILDREN("canGetChildren"),
CAN_GET_FOLDER_PARENT("canGetFolderParent"),
CAN_GET_OBJECT_PARENTS("canGetObjectParents"),
@@ -48,7 +49,6 @@ public enum CMISAllowedActionEnum implements EnumLabel
CAN_UPDATE_PROPERTIES("canUpdateProperties"),
CAN_MOVE_OBJECT("canMoveObject"),
CAN_DELETE_OBJECT("canDeleteObject"),
CAN_DELETE_TREE("canDeleteTree"),
CAN_SET_CONTENT_STREAM("canSetContentStream"),
CAN_DELETE_CONTENT_STREAM("canDeleteContentStream"),
@@ -63,7 +63,7 @@ public enum CMISAllowedActionEnum implements EnumLabel
CAN_GET_ALL_VERSIONS("canGetAllVersions"),
// relationship services
CAN_GET_RELATIONSHIPS("canGetRelationships"),
CAN_GET_OBJECT_RELATIONSHIPS("canGetObjectRelationships"),
// policy services
CAN_APPLY_POLICY("canApplyPolicy"),

View File

@@ -83,13 +83,6 @@ public enum CMISDataTypeEnum implements EnumLabel
return DataTypeDefinition.TEXT;
}
},
XML("xml")
{
public QName getDefaultDataType()
{
return DataTypeDefinition.TEXT;
}
},
HTML("html")
{
public QName getDefaultDataType()

View File

@@ -41,34 +41,34 @@ public interface CMISDictionaryModel
public static CMISTypeId POLICY_TYPE_ID = new CMISTypeId(CMISScope.POLICY, CMISMapping.POLICY_QNAME, CMISMapping.CMIS_MODEL_NS + ":" + CMISMapping.POLICY_QNAME.getLocalName(), CMISMapping.POLICY_QNAME);
// CMIS properties
public static String PROP_OBJECT_ID = "cmis:ObjectId";
public static String PROP_BASE_TYPE_ID = "cmis:BaseTypeId";
public static String PROP_OBJECT_TYPE_ID = "cmis:ObjectTypeId";
public static String PROP_CREATED_BY = "cmis:CreatedBy";
public static String PROP_CREATION_DATE = "cmis:CreationDate";
public static String PROP_LAST_MODIFIED_BY = "cmis:LastModifiedBy";
public static String PROP_LAST_MODIFICATION_DATE = "cmis:LastModificationDate";
public static String PROP_CHANGE_TOKEN = "cmis:ChangeToken";
public static String PROP_NAME = "cmis:Name";
public static String PROP_IS_IMMUTABLE = "cmis:IsImmutable";
public static String PROP_IS_LATEST_VERSION = "cmis:IsLatestVersion";
public static String PROP_IS_MAJOR_VERSION = "cmis:IsMajorVersion";
public static String PROP_IS_LATEST_MAJOR_VERSION = "cmis:IsLatestMajorVersion";
public static String PROP_VERSION_LABEL = "cmis:VersionLabel";
public static String PROP_VERSION_SERIES_ID = "cmis:VersionSeriesId";
public static String PROP_IS_VERSION_SERIES_CHECKED_OUT = "cmis:IsVersionSeriesCheckedOut";
public static String PROP_VERSION_SERIES_CHECKED_OUT_BY = "cmis:VersionSeriesCheckedOutBy";
public static String PROP_VERSION_SERIES_CHECKED_OUT_ID = "cmis:VersionSeriesCheckedOutId";
public static String PROP_CHECKIN_COMMENT = "cmis:CheckinComment";
public static String PROP_CONTENT_STREAM_LENGTH = "cmis:ContentStreamLength";
public static String PROP_CONTENT_STREAM_MIME_TYPE = "cmis:ContentStreamMimeType";
public static String PROP_CONTENT_STREAM_FILENAME = "cmis:ContentStreamFileName";
public static String PROP_CONTENT_STREAM_ID = "cmis:ContentStreamId";
public static String PROP_PARENT_ID = "cmis:ParentId";
public static String PROP_PATH_NAME = "cmis:PathName";
public static String PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS = "cmis:AllowedChildObjectTypeIds";
public static String PROP_SOURCE_ID = "cmis:SourceId";
public static String PROP_TARGET_ID = "cmis:TargetId";
public static String PROP_POLICY_TEXT = "cmis:PolicyText";
public static String PROP_OBJECT_ID = "cmis:objectId";
public static String PROP_BASE_TYPE_ID = "cmis:baseTypeId";
public static String PROP_OBJECT_TYPE_ID = "cmis:objectTypeId";
public static String PROP_CREATED_BY = "cmis:createdBy";
public static String PROP_CREATION_DATE = "cmis:creationDate";
public static String PROP_LAST_MODIFIED_BY = "cmis:lastModifiedBy";
public static String PROP_LAST_MODIFICATION_DATE = "cmis:lastModificationDate";
public static String PROP_CHANGE_TOKEN = "cmis:changeToken";
public static String PROP_NAME = "cmis:name";
public static String PROP_IS_IMMUTABLE = "cmis:isImmutable";
public static String PROP_IS_LATEST_VERSION = "cmis:isLatestVersion";
public static String PROP_IS_MAJOR_VERSION = "cmis:isMajorVersion";
public static String PROP_IS_LATEST_MAJOR_VERSION = "cmis:isLatestMajorVersion";
public static String PROP_VERSION_LABEL = "cmis:versionLabel";
public static String PROP_VERSION_SERIES_ID = "cmis:versionSeriesId";
public static String PROP_IS_VERSION_SERIES_CHECKED_OUT = "cmis:isVersionSeriesCheckedOut";
public static String PROP_VERSION_SERIES_CHECKED_OUT_BY = "cmis:versionSeriesCheckedOutBy";
public static String PROP_VERSION_SERIES_CHECKED_OUT_ID = "cmis:versionSeriesCheckedOutId";
public static String PROP_CHECKIN_COMMENT = "cmis:checkinComment";
public static String PROP_CONTENT_STREAM_LENGTH = "cmis:contentStreamLength";
public static String PROP_CONTENT_STREAM_MIME_TYPE = "cmis:contentStreamMimeType";
public static String PROP_CONTENT_STREAM_FILENAME = "cmis:contentStreamFileName";
public static String PROP_CONTENT_STREAM_ID = "cmis:contentStreamId";
public static String PROP_PARENT_ID = "cmis:parentId";
public static String PROP_PATH = "cmis:path";
public static String PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS = "cmis:allowedChildObjectTypeIds";
public static String PROP_SOURCE_ID = "cmis:sourceId";
public static String PROP_TARGET_ID = "cmis:targetId";
public static String PROP_POLICY_TEXT = "cmis:policyText";
}

View File

@@ -138,20 +138,6 @@ public interface CMISPropertyDefinition
*/
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)
*

View File

@@ -71,8 +71,6 @@ public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Seria
private CMISDataTypeEnum propertyType;
private CMISCardinalityEnum cardinality;
private int maximumLength = -1;
private String schemaURI = null;
private String encoding = null;
private Collection<CMISChoice> choices = new HashSet<CMISChoice>();
private boolean isOpenChoice = false;
private boolean required;
@@ -239,26 +237,6 @@ public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Seria
return maximumLength;
}
/**
* For properties of type CMISPropertyType.XML the schema to which the property must conform. Unsupported
*
* @return - the schema URI
*/
public String getSchemaURI()
{
return schemaURI;
}
/**
* For properties of type CMISPropertyType.XML the encoding used for the property value
*
* @return the encoding
*/
public String getEncoding()
{
return encoding;
}
/**
* Get the choices available as values for this property TODO: not implemented yet
*
@@ -370,8 +348,6 @@ public class CMISBasePropertyDefinition implements CMISPropertyDefinition, Seria
builder.append("PropertyType=").append(getDataType()).append(", ");
builder.append("Cardinality=").append(getCardinality()).append(", ");
builder.append("MaximumLength=").append(getMaximumLength()).append(", ");
builder.append("SchemaURI=").append(getSchemaURI()).append(", ");
builder.append("Encoding=").append(getEncoding()).append(", ");
builder.append("Choices=").append(getChoices()).append(", ");
builder.append("IsOpenChoice=").append(isOpenChoice()).append(", ");
builder.append("Required=").append(isRequired()).append(", ");

View File

@@ -158,7 +158,6 @@ public class CMISMapping implements InitializingBean
mapAlfrescoToCmisDataType.put(DataTypeDefinition.TEXT, CMISDataTypeEnum.STRING);
mapAlfrescoToCmisDataType.put(CMIS_DATATYPE_ID, CMISDataTypeEnum.ID);
mapAlfrescoToCmisDataType.put(CMIS_DATATYPE_URI, CMISDataTypeEnum.URI);
mapAlfrescoToCmisDataType.put(CMIS_DATATYPE_XML, CMISDataTypeEnum.XML);
mapAlfrescoToCmisDataType.put(CMIS_DATATYPE_HTML, CMISDataTypeEnum.HTML);
//
@@ -189,7 +188,7 @@ public class CMISMapping implements InitializingBean
registerPropertyAccessor(new ContentStreamIdProperty(serviceRegistry));
registerPropertyAccessor(new DirectProperty(serviceRegistry, CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME, ContentModel.PROP_NAME));
registerPropertyAccessor(new ParentProperty(serviceRegistry));
registerPropertyAccessor(new PathNameProperty(serviceRegistry, cmisService));
registerPropertyAccessor(new PathProperty(serviceRegistry, cmisService));
registerPropertyAccessor(new FixedValueProperty(serviceRegistry, CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS, null));
registerPropertyAccessor(new SourceIdProperty(serviceRegistry));
registerPropertyAccessor(new TargetIdProperty(serviceRegistry));
@@ -201,7 +200,7 @@ public class CMISMapping implements InitializingBean
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_OBJECT, PermissionService.DELETE_NODE));
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_UPDATE_PROPERTIES, PermissionService.WRITE_PROPERTIES));
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_PROPERTIES, PermissionService.READ_PROPERTIES));
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_RELATIONSHIPS, true));
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_OBJECT_RELATIONSHIPS, true));
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_OBJECT_PARENTS, true));
// Is CAN_MOVE correct mapping?
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_MOVE_OBJECT, PermissionService.DELETE_NODE));
@@ -227,7 +226,7 @@ public class CMISMapping implements InitializingBean
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_UPDATE_PROPERTIES, PermissionService.WRITE_PROPERTIES));
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_FOLDER_TREE, PermissionService.READ_CHILDREN));
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_PROPERTIES, PermissionService.READ_PROPERTIES));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_RELATIONSHIPS, true));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_OBJECT_RELATIONSHIPS, true));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_OBJECT_PARENTS, true));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_FOLDER_PARENT, true));
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_DESCENDANTS, PermissionService.READ_CHILDREN));
@@ -241,7 +240,6 @@ public class CMISMapping implements InitializingBean
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CREATE_FOLDER, PermissionService.CREATE_CHILDREN));
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CREATE_RELATIONSHIP, PermissionService.CREATE_ASSOCIATIONS));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CREATE_POLICY, false));
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_TREE, PermissionService.DELETE_NODE));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_ACL, false));
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
@@ -258,7 +256,7 @@ public class CMISMapping implements InitializingBean
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_MOVE_OBJECT, false));
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_ADD_OBJECT_TO_FOLDER, false));
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_REMOVE_OBJECT_FROM_FOLDER, false));
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_RELATIONSHIPS, false));
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_OBJECT_RELATIONSHIPS, false));
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_ACL, false));
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
}

View File

@@ -44,7 +44,7 @@ public class CMISPropertyServiceTest extends BaseCMISTest
{
public void testBasicFolder()
{
NodeRef folder = fileFolderService.create(rootNodeRef, "BaseFolder", ContentModel.TYPE_FOLDER).getNodeRef();
NodeRef folder = fileFolderService.create(cmisService.getDefaultRootNodeRef(), "BaseFolder", ContentModel.TYPE_FOLDER).getNodeRef();
Map<String, Serializable> properties = cmisService.getProperties(folder);
assertEquals(folder.toString(), properties.get(CMISDictionaryModel.PROP_OBJECT_ID));
assertEquals(CMISDictionaryModel.FOLDER_TYPE_ID.getId(), properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID));
@@ -72,7 +72,7 @@ public class CMISPropertyServiceTest extends BaseCMISTest
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME));
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
assertEquals(rootNodeRef.toString(), properties.get(CMISDictionaryModel.PROP_PARENT_ID));
assertEquals(cmisService.getDefaultRootNodeRef().toString(), properties.get(CMISDictionaryModel.PROP_PARENT_ID));
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
}

View File

@@ -37,11 +37,11 @@ import org.alfresco.service.cmr.repository.Path;
import org.alfresco.service.cmr.repository.Path.ChildAssocElement;
/**
* Get the CMIS object id property.
* Get the CMIS path property.
*
* @author davidc
*/
public class PathNameProperty extends AbstractProperty
public class PathProperty extends AbstractProperty
{
private CMISServices cmisService;
@@ -50,9 +50,9 @@ public class PathNameProperty extends AbstractProperty
*
* @param serviceRegistry
*/
public PathNameProperty(ServiceRegistry serviceRegistry, CMISServices cmisService)
public PathProperty(ServiceRegistry serviceRegistry, CMISServices cmisService)
{
super(serviceRegistry, CMISDictionaryModel.PROP_PATH_NAME);
super(serviceRegistry, CMISDictionaryModel.PROP_PATH);
this.cmisService = cmisService;
}

View File

@@ -31,7 +31,6 @@ import java.util.Map;
import org.alfresco.cmis.CMISDictionaryModel;
import org.alfresco.cmis.CMISDictionaryService;
import org.alfresco.cmis.CMISPropertyDefinition;
import org.alfresco.cmis.mapping.CMISMapping;
import org.alfresco.repo.search.impl.lucene.LuceneFunction;
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
import org.alfresco.repo.search.impl.querymodel.FunctionArgument;