mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged CMIS063 to HEAD
15185: 0.62c upgrade: service document 15198: 0.62c upgrade: allowable actions 15228: 0.62c upgrade: types and properties git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17227 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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.mapping;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.cmis.CMISDictionaryModel;
|
||||
import org.alfresco.cmis.CMISScope;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Get the CMIS object type id property
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class BaseTypeIdProperty extends AbstractProperty
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param serviceRegistry
|
||||
*/
|
||||
public BaseTypeIdProperty(ServiceRegistry serviceRegistry)
|
||||
{
|
||||
super(serviceRegistry, CMISDictionaryModel.PROP_BASE_TYPE_ID);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.mapping.AbstractProperty#getValue(org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public Serializable getValue(NodeRef nodeRef)
|
||||
{
|
||||
QName type = getServiceRegistry().getNodeService().getType(nodeRef);
|
||||
return getServiceRegistry().getCMISDictionaryService().findTypeForClass(type).getBaseType().getTypeId().getId();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.mapping.AbstractProperty#getValue(org.alfresco.service.cmr.repository.AssociationRef)
|
||||
*/
|
||||
public Serializable getValue(AssociationRef assocRef)
|
||||
{
|
||||
QName type = assocRef.getTypeQName();
|
||||
return getServiceRegistry().getCMISDictionaryService().findTypeForClass(type, CMISScope.RELATIONSHIP).getBaseType().getTypeId().getId();
|
||||
}
|
||||
|
||||
}
|
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
package org.alfresco.cmis.mapping;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -45,7 +44,6 @@ import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.service.namespace.NamespaceException;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -64,9 +62,10 @@ public class CMISMapping implements InitializingBean
|
||||
protected static final Log logger = LogFactory.getLog(CMISMapping.class);
|
||||
|
||||
/**
|
||||
* The Alfresco CMIS model URI.
|
||||
* The Alfresco CMIS Namespace
|
||||
*/
|
||||
public static String CMIS_MODEL_URI = "http://www.alfresco.org/model/cmis/0.6";
|
||||
public static String CMIS_MODEL_NS = "cmis";
|
||||
public static String CMIS_MODEL_URI = "http://www.alfresco.org/model/cmis/0.62c";
|
||||
|
||||
/**
|
||||
* The Alfresco CMIS Model name.
|
||||
@@ -78,10 +77,6 @@ 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";
|
||||
|
||||
// CMIS Data Types
|
||||
public static QName CMIS_DATATYPE_ID = QName.createQName(CMIS_MODEL_URI, "id");
|
||||
public static QName CMIS_DATATYPE_URI = QName.createQName(CMIS_MODEL_URI, "uri");
|
||||
@@ -89,16 +84,16 @@ public class CMISMapping implements InitializingBean
|
||||
public static QName CMIS_DATATYPE_HTML = QName.createQName(CMIS_MODEL_URI, "html");
|
||||
|
||||
// CMIS Types
|
||||
public static QName OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, OBJECT_OBJECT_TYPE);
|
||||
public static QName FILESYSTEM_OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, FILESYSTEM_OBJECT_TYPE);
|
||||
public static QName DOCUMENT_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.DOCUMENT_OBJECT_TYPE);
|
||||
public static QName FOLDER_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.FOLDER_OBJECT_TYPE);
|
||||
public static QName RELATIONSHIP_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.RELATIONSHIP_OBJECT_TYPE);
|
||||
public static QName POLICY_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.POLICY_OBJECT_TYPE);
|
||||
public static QName OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, "object");
|
||||
public static QName FILESYSTEM_OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, "filesystemobject");
|
||||
public static QName DOCUMENT_QNAME = QName.createQName(CMIS_MODEL_URI, "Document");
|
||||
public static QName FOLDER_QNAME = QName.createQName(CMIS_MODEL_URI, "Folder");
|
||||
public static QName RELATIONSHIP_QNAME = QName.createQName(CMIS_MODEL_URI, "Relationship");
|
||||
public static QName POLICY_QNAME = QName.createQName(CMIS_MODEL_URI, "Policy");
|
||||
|
||||
// CMIS Internal Type Ids
|
||||
public static CMISTypeId OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, OBJECT_OBJECT_TYPE.toLowerCase(), OBJECT_QNAME);
|
||||
public static CMISTypeId FILESYSTEM_OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, FILESYSTEM_OBJECT_TYPE.toLowerCase(), FILESYSTEM_OBJECT_QNAME);
|
||||
public static CMISTypeId OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, OBJECT_QNAME, CMIS_MODEL_NS + ":" + OBJECT_QNAME.getLocalName(), OBJECT_QNAME);
|
||||
public static CMISTypeId FILESYSTEM_OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, FILESYSTEM_OBJECT_QNAME, CMIS_MODEL_NS + ":" + FILESYSTEM_OBJECT_QNAME.getLocalName(), FILESYSTEM_OBJECT_QNAME);
|
||||
|
||||
// Properties
|
||||
public static QName PROP_OBJECT_ID_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.PROP_OBJECT_ID);
|
||||
@@ -173,8 +168,8 @@ public class CMISMapping implements InitializingBean
|
||||
//
|
||||
|
||||
registerPropertyAccessor(new ObjectIdProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new FixedValueProperty(serviceRegistry, CMISDictionaryModel.PROP_URI, null));
|
||||
registerPropertyAccessor(new ObjectTypeIdProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new BaseTypeIdProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new DirectProperty(serviceRegistry, CMISDictionaryModel.PROP_CREATED_BY, ContentModel.PROP_CREATOR));
|
||||
registerPropertyAccessor(new DirectProperty(serviceRegistry, CMISDictionaryModel.PROP_CREATION_DATE, ContentModel.PROP_CREATED));
|
||||
registerPropertyAccessor(new DirectProperty(serviceRegistry, CMISDictionaryModel.PROP_LAST_MODIFIED_BY, ContentModel.PROP_MODIFIER));
|
||||
@@ -191,12 +186,12 @@ public class CMISMapping implements InitializingBean
|
||||
registerPropertyAccessor(new VersionSeriesCheckedOutByProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new VersionSeriesCheckedOutIdProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new CheckinCommentProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new FixedValueProperty(serviceRegistry, CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED, CMISContentStreamAllowedEnum.ALLOWED.toString()));
|
||||
registerPropertyAccessor(new ContentStreamLengthProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new ContentStreamMimetypeProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new ContentStreamIdProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new DirectProperty(serviceRegistry, CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME, ContentModel.PROP_NAME));
|
||||
registerPropertyAccessor(new ContentStreamUriProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new ParentProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new FixedValueProperty(serviceRegistry, CMISDictionaryModel.PROP_PATH_NAME, null));
|
||||
registerPropertyAccessor(new FixedValueProperty(serviceRegistry, CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS, null));
|
||||
registerPropertyAccessor(new SourceIdProperty(serviceRegistry));
|
||||
registerPropertyAccessor(new TargetIdProperty(serviceRegistry));
|
||||
@@ -205,39 +200,41 @@ public class CMISMapping implements InitializingBean
|
||||
// Action Evaluator Mappings
|
||||
//
|
||||
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE, PermissionService.DELETE_NODE));
|
||||
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_PARENTS, 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, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_VERSION, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_CONTENT, PermissionService.WRITE_PROPERTIES, PermissionService.WRITE_CONTENT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_MOVE_OBJECT, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_CONTENT_STREAM, PermissionService.WRITE_PROPERTIES, PermissionService.WRITE_CONTENT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CHECKOUT, PermissionService.CHECK_OUT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CANCEL_CHECKOUT, PermissionService.CANCEL_CHECK_OUT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CHECKIN, PermissionService.CHECK_IN));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_SET_CONTENT, PermissionService.WRITE_CONTENT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_SET_CONTENT_STREAM, PermissionService.WRITE_CONTENT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_ALL_VERSIONS, true));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new ParentActionEvaluator(new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_ADD_TO_FOLDER, PermissionService.LINK_CHILDREN)));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new ParentActionEvaluator(new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_ADD_OBJECT_TO_FOLDER, PermissionService.LINK_CHILDREN)));
|
||||
// Is CAN_REMOVE_FROM_FOLDER correct mapping?
|
||||
registerEvaluator(CMISScope.DOCUMENT, new ParentActionEvaluator(new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_REMOVE_FROM_FOLDER, true)));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_VIEW_CONTENT, PermissionService.READ_CONTENT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_ADD_POLICY, false));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new ParentActionEvaluator(new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_REMOVE_OBJECT_FROM_FOLDER, true)));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_CONTENT_STREAM, PermissionService.READ_CONTENT));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_POLICY, false));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_APPLIED_POLICIES, false));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_REMOVE_POLICY, false));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CREATE_RELATIONSHIP, true));
|
||||
|
||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_RENDITIONS, true));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_ACL, false));
|
||||
registerEvaluator(CMISScope.DOCUMENT, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
|
||||
|
||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_OBJECT, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_UPDATE_PROPERTIES, PermissionService.WRITE_PROPERTIES));
|
||||
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_PARENTS, 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));
|
||||
// Is CAN_MOVE correct mapping?
|
||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_MOVE, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_ADD_POLICY, false));
|
||||
// Is CAN_MOVE_OBJECT correct mapping?
|
||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_MOVE_OBJECT, PermissionService.DELETE_NODE));
|
||||
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_POLICY, false));
|
||||
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_APPLIED_POLICIES, false));
|
||||
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_REMOVE_POLICY, false));
|
||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_CHILDREN, PermissionService.READ_CHILDREN));
|
||||
@@ -245,20 +242,25 @@ 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));
|
||||
|
||||
registerEvaluator(CMISScope.RELATIONSHIP, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE, true));
|
||||
registerEvaluator(CMISScope.RELATIONSHIP, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_OBJECT, true));
|
||||
registerEvaluator(CMISScope.RELATIONSHIP, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_UPDATE_PROPERTIES, false));
|
||||
registerEvaluator(CMISScope.RELATIONSHIP, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_PROPERTIES, true));
|
||||
registerEvaluator(CMISScope.RELATIONSHIP, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_ACL, false));
|
||||
registerEvaluator(CMISScope.RELATIONSHIP, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
|
||||
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_DELETE_OBJECT, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_UPDATE_PROPERTIES, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_PROPERTIES, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_OBJECT_PARENTS, false));
|
||||
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_PARENTS, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_MOVE, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_ADD_TO_FOLDER, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_REMOVE_FROM_FOLDER, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_GET_ACL, false));
|
||||
registerEvaluator(CMISScope.POLICY, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -324,10 +326,10 @@ public class CMISMapping implements InitializingBean
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Malformed type id '" + typeId + "'; discriminator " + typeId.charAt(0) + " unknown");
|
||||
}
|
||||
QName typeQName = QName.resolveToQName(serviceRegistry.getNamespaceService(), typeId.substring(2).replace('_', ':'));
|
||||
QName typeQName = QName.resolveToQName(serviceRegistry.getNamespaceService(), typeId.substring(2));
|
||||
|
||||
// Construct CMIS Type Id
|
||||
return new CMISTypeId(scope, typeId, typeQName);
|
||||
return new CMISTypeId(scope, typeQName, typeId, typeQName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,11 +343,8 @@ public class CMISMapping implements InitializingBean
|
||||
CMISTypeId typeId = mapAlfrescoQNameToTypeId.get(typeQName);
|
||||
if (typeId == null)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder(128);
|
||||
builder.append(scope.getLabel());
|
||||
builder.append("/");
|
||||
builder.append(buildPrefixEncodedString(typeQName, false));
|
||||
return new CMISTypeId(scope, builder.toString(), typeQName);
|
||||
String typeIdStr = scope.getLabel() + "/" + typeQName.toPrefixString(serviceRegistry.getNamespaceService());
|
||||
return new CMISTypeId(scope, typeQName, typeIdStr, typeQName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -399,25 +398,9 @@ public class CMISMapping implements InitializingBean
|
||||
return null;
|
||||
}
|
||||
|
||||
public String buildPrefixEncodedString(QName qname, boolean upperCase)
|
||||
public String buildPrefixEncodedString(QName qname)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder(128);
|
||||
|
||||
if (!qname.getNamespaceURI().equals(CMIS_MODEL_URI))
|
||||
{
|
||||
Collection<String> prefixes = serviceRegistry.getNamespaceService().getPrefixes(qname.getNamespaceURI());
|
||||
if (prefixes.size() == 0)
|
||||
{
|
||||
throw new NamespaceException("A namespace prefix is not registered for uri " + qname.getNamespaceURI());
|
||||
}
|
||||
String resolvedPrefix = prefixes.iterator().next();
|
||||
|
||||
builder.append(upperCase ? resolvedPrefix.toUpperCase() : resolvedPrefix);
|
||||
builder.append("_");
|
||||
}
|
||||
|
||||
builder.append(upperCase ? qname.getLocalName().toUpperCase() : qname.getLocalName());
|
||||
return builder.toString();
|
||||
return qname.toPrefixString(serviceRegistry.getNamespaceService());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -612,18 +595,6 @@ public class CMISMapping implements InitializingBean
|
||||
return cmisTypeQName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CMIS property name from the property QName.
|
||||
*
|
||||
* @param namespaceService
|
||||
* @param propertyQName
|
||||
* @return
|
||||
*/
|
||||
public String getCmisPropertyName(QName propertyQName)
|
||||
{
|
||||
return buildPrefixEncodedString(propertyQName, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CMIS property type for a property
|
||||
*
|
||||
@@ -722,14 +693,7 @@ public class CMISMapping implements InitializingBean
|
||||
*/
|
||||
public String getCmisPropertyId(QName propertyQName)
|
||||
{
|
||||
if (propertyQName.getNamespaceURI().equals(CMIS_MODEL_URI))
|
||||
{
|
||||
return propertyQName.getLocalName();
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyQName.toString();
|
||||
}
|
||||
return propertyQName.toPrefixString(serviceRegistry.getNamespaceService());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -740,15 +704,15 @@ public class CMISMapping implements InitializingBean
|
||||
*/
|
||||
public AbstractProperty getPropertyAccessor(CMISPropertyId propertyId)
|
||||
{
|
||||
AbstractProperty propertyAccessor = propertyAccessors.get(propertyId.getName());
|
||||
AbstractProperty propertyAccessor = propertyAccessors.get(propertyId.getId());
|
||||
if (propertyAccessor == null)
|
||||
{
|
||||
QName propertyQName = propertyId.getQName();
|
||||
if (propertyQName == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Can't get property accessor for property id " + propertyId.getName() + " due to unknown property QName");
|
||||
throw new AlfrescoRuntimeException("Can't get property accessor for property id " + propertyId.getId() + " due to unknown property QName");
|
||||
}
|
||||
propertyAccessor = new DirectProperty(serviceRegistry, propertyId.getName(), propertyQName);
|
||||
propertyAccessor = new DirectProperty(serviceRegistry, propertyId.getId(), propertyQName);
|
||||
}
|
||||
return propertyAccessor;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.CMISContentStreamAllowedEnum;
|
||||
import org.alfresco.cmis.CMISDictionaryModel;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
@@ -48,8 +47,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
NodeRef folder = fileFolderService.create(rootNodeRef, "BaseFolder", ContentModel.TYPE_FOLDER).getNodeRef();
|
||||
Map<String, Serializable> properties = cmisService.getProperties(folder);
|
||||
assertEquals(folder.toString(), properties.get(CMISDictionaryModel.PROP_OBJECT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(CMISDictionaryModel.FOLDER_TYPE_ID.getId(), properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID));
|
||||
assertEquals(CMISDictionaryModel.FOLDER_TYPE_ID.getId(), properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID));
|
||||
assertEquals(authenticationComponent.getCurrentUserName(), properties.get(CMISDictionaryModel.PROP_CREATED_BY));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(authenticationComponent.getCurrentUserName(), properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY));
|
||||
@@ -68,36 +67,23 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertEquals(rootNodeRef.toString(), properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
}
|
||||
|
||||
private String createContentUri(NodeRef nodeRef)
|
||||
{
|
||||
String uri = "/api/node/" + nodeRef.getStoreRef().getProtocol() + "/" + nodeRef.getStoreRef().getIdentifier() + "/" + nodeRef.getId() + "/content";
|
||||
String name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
int dotIndex = name.indexOf('.');
|
||||
if (dotIndex != -1)
|
||||
{
|
||||
uri += "." + name.substring(dotIndex);
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
||||
public void testBasicDocument()
|
||||
{
|
||||
NodeRef content = fileFolderService.create(rootNodeRef, "BaseContent", ContentModel.TYPE_CONTENT).getNodeRef();
|
||||
|
||||
Map<String, Serializable> properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -116,11 +102,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
}
|
||||
@@ -131,8 +116,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
Map<String, Serializable> properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -151,11 +136,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -172,11 +156,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
long size = writer.getSize();
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), size);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "text/plain");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
}
|
||||
|
||||
public void testLock()
|
||||
@@ -185,8 +168,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
Map<String, Serializable> properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -205,11 +188,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -232,8 +214,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
properties = cmisService.getProperties(content);
|
||||
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -252,11 +234,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -268,8 +249,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
Map<String, Serializable> properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -288,11 +269,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -314,8 +294,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
properties = cmisService.getProperties(pwc);
|
||||
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), pwc.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -334,11 +314,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(pwc));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -347,8 +326,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -367,11 +346,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -393,8 +371,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
properties = cmisService.getProperties(pwc);
|
||||
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), pwc.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -413,11 +391,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(pwc));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -426,8 +403,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -446,11 +423,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -462,8 +438,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
Map<String, Serializable> properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -482,11 +458,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -495,8 +470,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -515,11 +490,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -541,8 +515,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
properties = cmisService.getProperties(pwc);
|
||||
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), pwc.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -561,11 +535,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(pwc));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -574,8 +547,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -594,11 +567,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -620,8 +592,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
properties = cmisService.getProperties(pwc);
|
||||
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), pwc.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -640,11 +612,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(pwc));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -656,8 +627,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString()+"/1.0");
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -676,11 +647,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), "Meep");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -702,8 +672,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
properties = cmisService.getProperties(pwc);
|
||||
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), pwc.toString());
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -722,11 +692,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), authenticationComponent.getCurrentUserName());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), pwc.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent (Working Copy)");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(pwc));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -738,8 +707,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
|
||||
properties = cmisService.getProperties(content);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_ID), content.toString()+"/1.1");
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.DOCUMENT_TYPE_ID.getId());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -758,11 +727,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID), null);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CHECKIN_COMMENT), "Woof");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED), CMISContentStreamAllowedEnum.ALLOWED.toString());
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH), 0L);
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE), "application/octet-stream");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME), "BaseContent");
|
||||
assertEquals(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_URI), createContentUri(content));
|
||||
assertNotNull(properties.get(CMISDictionaryModel.PROP_CONTENT_STREAM_ID));
|
||||
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_PARENT_ID));
|
||||
assertNull(properties.get(CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
@@ -772,8 +740,8 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
{
|
||||
NodeRef folder = fileFolderService.create(rootNodeRef, "BaseFolder", ContentModel.TYPE_FOLDER).getNodeRef();
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_OBJECT_ID), folder.toString());
|
||||
assertNull(cmisService.getProperty(folder, CMISDictionaryModel.PROP_URI));
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_OBJECT_TYPE_ID), CMISDictionaryModel.FOLDER_TYPE_ID.getId());
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_BASE_TYPE_ID), CMISDictionaryModel.FOLDER_TYPE_ID.getId());
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_CREATED_BY), authenticationComponent.getCurrentUserName());
|
||||
assertNotNull(cmisService.getProperty(folder, CMISDictionaryModel.PROP_CREATION_DATE));
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_LAST_MODIFIED_BY), authenticationComponent.getCurrentUserName());
|
||||
@@ -794,11 +762,10 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_BY);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_VERSION_SERIES_CHECKED_OUT_ID);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CHECKIN_COMMENT);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CONTENT_STREAM_ALLOWED);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CONTENT_STREAM_LENGTH);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CONTENT_STREAM_MIME_TYPE);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CONTENT_STREAM_FILENAME);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CONTENT_STREAM_URI);
|
||||
cmisService.getProperty(folder, CMISDictionaryModel.PROP_CONTENT_STREAM_ID);
|
||||
fail("Failed to catch invalid property on type folder");
|
||||
}
|
||||
catch(AlfrescoRuntimeException e)
|
||||
@@ -809,7 +776,7 @@ public class CMISPropertyServiceTest extends BaseCMISTest
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_PARENT_ID), rootNodeRef.toString());
|
||||
assertNull(cmisService.getProperty(folder, CMISDictionaryModel.PROP_ALLOWED_CHILD_OBJECT_TYPE_IDS));
|
||||
|
||||
assertEquals(cmisService.getProperty(folder, "NAME"), "BaseFolder");
|
||||
assertEquals(cmisService.getProperty(folder, "name"), "BaseFolder");
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_NAME.toUpperCase()), "BaseFolder");
|
||||
assertEquals(cmisService.getProperty(folder, CMISDictionaryModel.PROP_NAME.toLowerCase()), "BaseFolder");
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,6 @@ import org.alfresco.cmis.CMISRelationshipDirectionEnum;
|
||||
import org.alfresco.cmis.CMISScope;
|
||||
import org.alfresco.cmis.CMISServices;
|
||||
import org.alfresco.cmis.CMISTypeDefinition;
|
||||
import org.alfresco.cmis.CMISTypeId;
|
||||
import org.alfresco.cmis.CMISTypesFilterEnum;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
@@ -62,7 +61,6 @@ 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.service.namespace.QNamePattern;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.util.AbstractLifecycleBean;
|
||||
import org.springframework.beans.BeansException;
|
||||
@@ -591,7 +589,7 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
|
||||
Map<String, Serializable> values = new HashMap<String, Serializable>(propDefs.size());
|
||||
for (CMISPropertyDefinition propDef : propDefs.values())
|
||||
{
|
||||
values.put(propDef.getPropertyId().getName(), propDef.getPropertyAccessor().getValue(nodeRef));
|
||||
values.put(propDef.getPropertyId().getId(), propDef.getPropertyAccessor().getValue(nodeRef));
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ package org.alfresco.cmis.mapping;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.cmis.CMISDictionaryModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
@@ -36,16 +35,16 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*
|
||||
* @author andyh
|
||||
*/
|
||||
public class ContentStreamUriProperty extends AbstractProperty
|
||||
public class ContentStreamIdProperty extends AbstractProperty
|
||||
{
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* Construct
|
||||
*
|
||||
* @param serviceRegistry
|
||||
*/
|
||||
public ContentStreamUriProperty(ServiceRegistry serviceRegistry)
|
||||
public ContentStreamIdProperty(ServiceRegistry serviceRegistry)
|
||||
{
|
||||
super(serviceRegistry, CMISDictionaryModel.PROP_CONTENT_STREAM_URI);
|
||||
super(serviceRegistry, CMISDictionaryModel.PROP_CONTENT_STREAM_ID);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -54,19 +53,7 @@ public class ContentStreamUriProperty extends AbstractProperty
|
||||
*/
|
||||
public Serializable getValue(NodeRef nodeRef)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("/api/node/");
|
||||
sb.append(nodeRef.getStoreRef().getProtocol());
|
||||
sb.append("/");
|
||||
sb.append(nodeRef.getStoreRef().getIdentifier());
|
||||
sb.append("/");
|
||||
sb.append(nodeRef.getId());
|
||||
sb.append("/content");
|
||||
String name = (String)getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
if (name.lastIndexOf('.') != -1)
|
||||
{
|
||||
sb.append(name.substring(name.lastIndexOf('.')));
|
||||
}
|
||||
return sb.toString();
|
||||
return "cm:content";
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user