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

@@ -28,6 +28,7 @@ import java.io.Serializable;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
import org.mozilla.javascript.Scriptable;
@@ -85,6 +86,11 @@ public class Association implements Scopeable, Serializable
return assocRef.getTypeQName().toString();
}
public QName getTypeQName()
{
return assocRef.getTypeQName();
}
public ScriptNode getSource()
{
return (ScriptNode)new ValueConverter().convertValueForScript(this.services, this.scope, null, assocRef.getSourceRef());

View File

@@ -1361,13 +1361,14 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
* @param target Destination node for the association
* @param assocType Association type qname (short form or fully qualified)
*/
public void createAssociation(ScriptNode target, String assocType)
public Association createAssociation(ScriptNode target, String assocType)
{
ParameterCheck.mandatory("Target", target);
ParameterCheck.mandatoryString("Association Type Name", assocType);
this.nodeService.createAssociation(this.nodeRef, target.nodeRef, createQName(assocType));
AssociationRef assocRef = this.nodeService.createAssociation(this.nodeRef, target.nodeRef, createQName(assocType));
reset();
return new Association(this.services, assocRef);
}
/**