CMIS Relationship support in AtomPub binding

- getRelationships
- getRelationship
- createRelationship
- unit tests for above

TODO: delete relationship, includeRelationships flag

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14461 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2009-05-27 22:11:31 +00:00
parent 4980a463ee
commit d8c87a5abd
22 changed files with 637 additions and 112 deletions

View File

@@ -276,6 +276,10 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
else
{
typeDef = getRegistry().typeDefsByQName.get(clazz);
if (typeDef == null)
{
typeDef = getRegistry().assocDefsByQName.get(clazz);
}
}
// ensure matches one of provided matching scopes

View File

@@ -450,4 +450,30 @@ public class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializa
return Collections.emptyList();
}
@Override
public int hashCode()
{
return objectTypeId.hashCode();
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final CMISTypeDefinition other = (CMISTypeDefinition) obj;
if (objectTypeId == null)
{
if (other.getTypeId() != null)
return false;
}
else if (!objectTypeId.equals(other.getTypeId()))
return false;
return true;
}
}

View File

@@ -77,13 +77,13 @@ public class CMISRelationshipTypeDefinition extends CMISAbstractTypeDefinition
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
creatable = false;
queryable = false;
controllable = false;
if (assocDef == null)
{
// TODO: Add CMIS Association mapping??
creatable = false;
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
objectTypeQueryName = typeId.getId();
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
@@ -95,6 +95,7 @@ public class CMISRelationshipTypeDefinition extends CMISAbstractTypeDefinition
}
else
{
creatable = true;
displayName = (assocDef.getTitle() != null) ? assocDef.getTitle() : typeId.getId();
objectTypeQueryName = cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
parentTypeId = CMISDictionaryModel.RELATIONSHIP_TYPE_ID;