-->

How to get all Child associations with a specific

2019-02-25 06:09发布

问题:

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 iterate 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

回答1:

I think you want the getChildAssocs(NodeRef,QName,QName) nodeservice call. Something like:

nodeService.getChildAssocs(parentNodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);


标签: java alfresco