How to get all Child associations with a specific Association Type Alfresco (Java)

笑着哭i 提交于 2019-12-20 02:39:20

问题


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);


来源:https://stackoverflow.com/questions/5934517/how-to-get-all-child-associations-with-a-specific-association-type-alfresco-jav

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!