mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged CMIS063 to HEAD
15242: 0.62c update: Abdera extension / AtomPub tests passing (except query) 15277: 0.62c upgrade: AtomPub resources/links refactor 15290: 0.62c Upgrade: AtomPub resource/link compliance. Updated Test client / Custom Type test client / Abdera extension. 15293: 0.62 final Upgrade: Introduce schemas and examples 15318: 0.62 final upgrade: AtomPub server and tests updated 15321: Fixes for CMIS custom model tests. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17229 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<model name="cmis:cmismodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
|
<model name="cmis:cmismodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
|
||||||
|
|
||||||
<description>CMIS Model Definitions</description>
|
<description>CMIS Model Definitions</description>
|
||||||
<version>0.62c</version>
|
<version>0.62</version>
|
||||||
|
|
||||||
<imports>
|
<imports>
|
||||||
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
|
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</imports>
|
</imports>
|
||||||
|
|
||||||
<namespaces>
|
<namespaces>
|
||||||
<namespace uri="http://www.alfresco.org/model/cmis/0.62c" prefix="cmis" />
|
<namespace uri="http://www.alfresco.org/model/cmis/0.62" prefix="cmis" />
|
||||||
</namespaces>
|
</namespaces>
|
||||||
|
|
||||||
<data-types>
|
<data-types>
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
<type name="cmis:Document">
|
<type name="cmis:document">
|
||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
<description>Document Type</description>
|
<description>Document Type</description>
|
||||||
<parent>cmis:filesystemobject</parent>
|
<parent>cmis:filesystemobject</parent>
|
||||||
@@ -311,7 +311,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
<type name="cmis:Folder">
|
<type name="cmis:folder">
|
||||||
<title>Folder</title>
|
<title>Folder</title>
|
||||||
<description>Folder Type</description>
|
<description>Folder Type</description>
|
||||||
<parent>cmis:filesystemobject</parent>
|
<parent>cmis:filesystemobject</parent>
|
||||||
@@ -350,7 +350,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
<type name="cmis:Relationship">
|
<type name="cmis:relationship">
|
||||||
<title>Relationship</title>
|
<title>Relationship</title>
|
||||||
<description>Relationship Type</description>
|
<description>Relationship Type</description>
|
||||||
<parent>cmis:object</parent>
|
<parent>cmis:object</parent>
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
<type name="cmis:Policy">
|
<type name="cmis:policy">
|
||||||
<title>Policy</title>
|
<title>Policy</title>
|
||||||
<description>Policy Type</description>
|
<description>Policy Type</description>
|
||||||
<parent>cmis:object</parent>
|
<parent>cmis:object</parent>
|
||||||
|
@@ -47,7 +47,8 @@ public enum CMISAllowedActionEnum implements EnumLabel
|
|||||||
CAN_GET_CONTENT_STREAM("canGetContentStream"),
|
CAN_GET_CONTENT_STREAM("canGetContentStream"),
|
||||||
CAN_UPDATE_PROPERTIES("canUpdateProperties"),
|
CAN_UPDATE_PROPERTIES("canUpdateProperties"),
|
||||||
CAN_MOVE_OBJECT("canMoveObject"),
|
CAN_MOVE_OBJECT("canMoveObject"),
|
||||||
CAN_DELETE_OBJECT("canDelete"), // TODO: ISSUE - should be canDeleteObject
|
CAN_DELETE_OBJECT("canDeleteObject"),
|
||||||
|
CAN_DELETE_TREE("canDeleteTree"),
|
||||||
CAN_SET_CONTENT_STREAM("canSetContentStream"),
|
CAN_SET_CONTENT_STREAM("canSetContentStream"),
|
||||||
CAN_DELETE_CONTENT_STREAM("canDeleteContentStream"),
|
CAN_DELETE_CONTENT_STREAM("canDeleteContentStream"),
|
||||||
|
|
||||||
|
@@ -67,6 +67,11 @@ public interface CMISDictionaryService
|
|||||||
*/
|
*/
|
||||||
public CMISTypeDefinition findTypeForTable(String tableName);
|
public CMISTypeDefinition findTypeForTable(String tableName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Base Types
|
||||||
|
*/
|
||||||
|
public Collection<CMISTypeDefinition> getBaseTypes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all Types
|
* Get all Types
|
||||||
*
|
*
|
||||||
|
@@ -127,6 +127,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
|||||||
Map<CMISTypeId, CMISAbstractTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISAbstractTypeDefinition>();
|
Map<CMISTypeId, CMISAbstractTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISAbstractTypeDefinition>();
|
||||||
Map<CMISTypeId, CMISTypeDefinition> typeDefsByTypeId = new HashMap<CMISTypeId, CMISTypeDefinition>();
|
Map<CMISTypeId, CMISTypeDefinition> typeDefsByTypeId = new HashMap<CMISTypeId, CMISTypeDefinition>();
|
||||||
Map<String, CMISTypeDefinition> typeDefsByTable = new HashMap<String, CMISTypeDefinition>();
|
Map<String, CMISTypeDefinition> typeDefsByTable = new HashMap<String, CMISTypeDefinition>();
|
||||||
|
List<CMISTypeDefinition> baseTypes = new ArrayList<CMISTypeDefinition>();
|
||||||
|
|
||||||
// Property Definitions Index
|
// Property Definitions Index
|
||||||
Map<String, CMISPropertyDefinition> propDefsById = new HashMap<String, CMISPropertyDefinition>();
|
Map<String, CMISPropertyDefinition> propDefsById = new HashMap<String, CMISPropertyDefinition>();
|
||||||
@@ -212,6 +213,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
|||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("DictionaryRegistry[");
|
builder.append("DictionaryRegistry[");
|
||||||
builder.append("Types=").append(typeDefsByTypeId.size()).append(", ");
|
builder.append("Types=").append(typeDefsByTypeId.size()).append(", ");
|
||||||
|
builder.append("Base Types=").append(baseTypes.size()).append(", ");
|
||||||
builder.append("Properties=").append(propDefsByPropId.size());
|
builder.append("Properties=").append(propDefsByPropId.size());
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
@@ -307,6 +309,15 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
|||||||
CMISTypeDefinition typeDef = getRegistry().typeDefsByTable.get(tableName.toLowerCase());
|
CMISTypeDefinition typeDef = getRegistry().typeDefsByTable.get(tableName.toLowerCase());
|
||||||
return typeDef;
|
return typeDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see org.alfresco.cmis.CMISDictionaryService#getBaseTypes()
|
||||||
|
*/
|
||||||
|
public Collection<CMISTypeDefinition> getBaseTypes()
|
||||||
|
{
|
||||||
|
return Collections.unmodifiableCollection(getRegistry().baseTypes);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
@@ -446,11 +457,20 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
|||||||
typeDef.assertComplete();
|
typeDef.assertComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phase 5: register base types
|
||||||
|
for (CMISAbstractTypeDefinition typeDef : registry.objectDefsByTypeId.values())
|
||||||
|
{
|
||||||
|
if (typeDef.isPublic() && typeDef.getParentType() == null)
|
||||||
|
{
|
||||||
|
registry.baseTypes.add(typeDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// publish new registry
|
// publish new registry
|
||||||
registryMap.put(tenantService.getCurrentUserDomain(), registry);
|
registryMap.put(tenantService.getCurrentUserDomain(), registry);
|
||||||
|
|
||||||
if (logger.isInfoEnabled())
|
if (logger.isInfoEnabled())
|
||||||
logger.info("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Properties:" + registry.propDefsByPropId.size());
|
logger.info("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Base Types: " + registry.baseTypes.size() + ", Properties:" + registry.propDefsByPropId.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -30,7 +30,7 @@ import org.alfresco.cmis.mapping.BaseCMISTest;
|
|||||||
|
|
||||||
public class CMISDictionaryTest extends BaseCMISTest
|
public class CMISDictionaryTest extends BaseCMISTest
|
||||||
{
|
{
|
||||||
public void testBasicTypes()
|
public void testAllTypes()
|
||||||
{
|
{
|
||||||
for (CMISTypeDefinition type : cmisDictionaryService.getAllTypes())
|
for (CMISTypeDefinition type : cmisDictionaryService.getAllTypes())
|
||||||
{
|
{
|
||||||
@@ -38,6 +38,13 @@ public class CMISDictionaryTest extends BaseCMISTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBaseTypes()
|
||||||
|
{
|
||||||
|
for (CMISTypeDefinition type : cmisDictionaryService.getBaseTypes())
|
||||||
|
{
|
||||||
|
System.out.println(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
public void testSubTypes()
|
public void testSubTypes()
|
||||||
{
|
{
|
||||||
for (CMISTypeDefinition type : cmisDictionaryService.getAllTypes())
|
for (CMISTypeDefinition type : cmisDictionaryService.getAllTypes())
|
||||||
|
@@ -31,7 +31,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.alfresco.cmis.CMISActionEvaluator;
|
import org.alfresco.cmis.CMISActionEvaluator;
|
||||||
import org.alfresco.cmis.CMISAllowedActionEnum;
|
import org.alfresco.cmis.CMISAllowedActionEnum;
|
||||||
import org.alfresco.cmis.CMISContentStreamAllowedEnum;
|
|
||||||
import org.alfresco.cmis.CMISDataTypeEnum;
|
import org.alfresco.cmis.CMISDataTypeEnum;
|
||||||
import org.alfresco.cmis.CMISDictionaryModel;
|
import org.alfresco.cmis.CMISDictionaryModel;
|
||||||
import org.alfresco.cmis.CMISPropertyId;
|
import org.alfresco.cmis.CMISPropertyId;
|
||||||
@@ -65,7 +64,7 @@ public class CMISMapping implements InitializingBean
|
|||||||
* The Alfresco CMIS Namespace
|
* The Alfresco CMIS Namespace
|
||||||
*/
|
*/
|
||||||
public static String CMIS_MODEL_NS = "cmis";
|
public static String CMIS_MODEL_NS = "cmis";
|
||||||
public static String CMIS_MODEL_URI = "http://www.alfresco.org/model/cmis/0.62c";
|
public static String CMIS_MODEL_URI = "http://www.alfresco.org/model/cmis/0.62";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Alfresco CMIS Model name.
|
* The Alfresco CMIS Model name.
|
||||||
@@ -86,10 +85,10 @@ public class CMISMapping implements InitializingBean
|
|||||||
// CMIS Types
|
// CMIS Types
|
||||||
public static QName OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, "object");
|
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 FILESYSTEM_OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, "filesystemobject");
|
||||||
public static QName DOCUMENT_QNAME = QName.createQName(CMIS_MODEL_URI, "Document");
|
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 FOLDER_QNAME = QName.createQName(CMIS_MODEL_URI, "folder");
|
||||||
public static QName RELATIONSHIP_QNAME = QName.createQName(CMIS_MODEL_URI, "Relationship");
|
public static QName RELATIONSHIP_QNAME = QName.createQName(CMIS_MODEL_URI, "relationship");
|
||||||
public static QName POLICY_QNAME = QName.createQName(CMIS_MODEL_URI, "Policy");
|
public static QName POLICY_QNAME = QName.createQName(CMIS_MODEL_URI, "policy");
|
||||||
|
|
||||||
// CMIS Internal Type Ids
|
// CMIS Internal Type Ids
|
||||||
public static CMISTypeId OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, OBJECT_QNAME, CMIS_MODEL_NS + ":" + OBJECT_QNAME.getLocalName(), OBJECT_QNAME);
|
public static CMISTypeId OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, OBJECT_QNAME, CMIS_MODEL_NS + ":" + OBJECT_QNAME.getLocalName(), OBJECT_QNAME);
|
||||||
@@ -242,6 +241,7 @@ 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_FOLDER, PermissionService.CREATE_CHILDREN));
|
||||||
registerEvaluator(CMISScope.FOLDER, new PermissionActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_CREATE_RELATIONSHIP, PermissionService.CREATE_ASSOCIATIONS));
|
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 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_GET_ACL, false));
|
||||||
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
|
registerEvaluator(CMISScope.FOLDER, new FixedValueActionEvaluator(serviceRegistry, CMISAllowedActionEnum.CAN_APPLY_ACL, false));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user