How to get all Child associations with a specific Association Type Alfresco (Java)
i'm a total newbie to java and Alfresco and i have this simple problem: i need to get all child Associations of a noderef with Association Type = "risposteAssociate". In Javascript i do something like:
var risposte = node.childAssocs["crl:risposteAssociate"];
In Java i have to do something like:
List<ChildAssociationRef> risposteAssociate = nodeService.getChildAssocs(node,....);
I've looked at the docs Here but i don't fully understand them.
EDIT - If i can get the child associations, to iter开发者_StackOverflow社区ate over them i can use
for (ChildAssociationRef childAssocRef : risposteAssociate) {
// do something with each document in the workflow package
NodeRef risposta = childAssocRef.getChildRef();
}
Thanx in advance
I think you want the getChildAssocs(NodeRef,QName,QName) nodeservice call. Something like:
nodeService.getChildAssocs(parentNodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
精彩评论