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:
@@ -127,6 +127,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
||||
Map<CMISTypeId, CMISAbstractTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISAbstractTypeDefinition>();
|
||||
Map<CMISTypeId, CMISTypeDefinition> typeDefsByTypeId = new HashMap<CMISTypeId, CMISTypeDefinition>();
|
||||
Map<String, CMISTypeDefinition> typeDefsByTable = new HashMap<String, CMISTypeDefinition>();
|
||||
List<CMISTypeDefinition> baseTypes = new ArrayList<CMISTypeDefinition>();
|
||||
|
||||
// Property Definitions Index
|
||||
Map<String, CMISPropertyDefinition> propDefsById = new HashMap<String, CMISPropertyDefinition>();
|
||||
@@ -212,6 +213,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("DictionaryRegistry[");
|
||||
builder.append("Types=").append(typeDefsByTypeId.size()).append(", ");
|
||||
builder.append("Base Types=").append(baseTypes.size()).append(", ");
|
||||
builder.append("Properties=").append(propDefsByPropId.size());
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
@@ -307,6 +309,15 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
||||
CMISTypeDefinition typeDef = getRegistry().typeDefsByTable.get(tableName.toLowerCase());
|
||||
return typeDef;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.CMISDictionaryService#getBaseTypes()
|
||||
*/
|
||||
public Collection<CMISTypeDefinition> getBaseTypes()
|
||||
{
|
||||
return Collections.unmodifiableCollection(getRegistry().baseTypes);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -446,11 +457,20 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
||||
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
|
||||
registryMap.put(tenantService.getCurrentUserDomain(), registry);
|
||||
|
||||
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 void testBasicTypes()
|
||||
public void testAllTypes()
|
||||
{
|
||||
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()
|
||||
{
|
||||
for (CMISTypeDefinition type : cmisDictionaryService.getAllTypes())
|
||||
|
Reference in New Issue
Block a user