cancel
Showing results for 
Search instead for 
Did you mean: 

Access custom association value

farzad
Champ in-the-making
Champ in-the-making
Hi

I am tryin to access value of the "sign-off "association defined in SOP ,which is another document .I managed to reach until here:


NodeRef nodeRef = JCRNodeRef.getNodeRef(child);
QName type = nodeService.getType(nodeRef);
Map map=dictionaryService.getClass(type).getAssociations();
     for (Iterator it=map.values().iterator(); it.hasNext(); ) {
                AssociationDefinition assoc = AsociationDefinition)it.next();}

And get the name of the association(signOff) ,however I am not able to go further and reach the target document.I looked at this http://forums.alfresco.com/viewtopic.php?t=1526&highlight=association  as well ,but not working for me

Any hint is appreciated

Thanks
1 REPLY 1

farzad
Champ in-the-making
Champ in-the-making
Got it :twisted:

List<AssociationRef> assocs = registry.getNodeService().getTargetAssocs(nodeRef, RegexQNamePattern.MATCH_ALL);
         for (AssociationRef assocRef: assocs)
         {
            String assocName = assocRef.getTypeQName().toString();
            registry.getNodeService().getPath(assocRef.getTargetRef()));
          }