AnsweredAssumed Answered

Alfresco platform - JAVA - get custom node association

Question asked by gawel on Dec 5, 2017
Latest reply on Dec 5, 2017 by gawel

Hi,

On alfresco V5.2 how get a custom model association on a node?

My model work fine (Alfresco share found node association) so on java I tryed all this functions :

 

LOGGER.debug("*** CUSTOM : " + nodeService.getChildAssocs(nodeRef, CustomModel.ASSOC_PRODUIT_SITE, RegexQNamePattern.MATCH_ALL));

 

LOGGER.debug("*** CATEGORIES : " + nodeService.getChildAssocs(nodeRef, ContentModel.ASSOC_CATEGORIES, RegexQNamePattern.MATCH_ALL).toString());
LOGGER.debug("*** CHILD : " + nodeService.getChildAssocs(nodeRef, ContentModel.ASSOC_CHILDREN, RegexQNamePattern.MATCH_ALL).toString());
LOGGER.debug("*** CONTAINS : " + nodeService.getChildAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL).toString());
LOGGER.debug("*** MEMEBRES : " + nodeService.getChildAssocs(nodeRef, ContentModel.ASSOC_MEMBER, RegexQNamePattern.MATCH_ALL).toString());
LOGGER.debug("*** REF : " + nodeService.getChildAssocs(nodeRef, ContentModel.ASSOC_REFERENCES, RegexQNamePattern.MATCH_ALL).toString());
LOGGER.debug("*** SUB : " + nodeService.getChildAssocs(nodeRef, ContentModel.ASSOC_SUBCATEGORIES, RegexQNamePattern.MATCH_ALL).toString());

 

List<ChildAssociationRef> assocWithSiteTrt = nodeService.getChildAssocs(nodeRef, CustomModel.ASSOC_PRODUIT_SITE, RegexQNamePattern.MATCH_ALL);
LOGGER.debug("assocWithSiteTrt : " + assocWithSiteTrt.toString());
List<ChildAssociationRef> assocWithSiteTrt2 = nodeService.getChildAssocs(nodeRef, RegexQNamePattern.MATCH_ALL, CustomModel.ASSOC_PRODUIT_SITE);
LOGGER.debug("assocWithSiteTrt2 : " + assocWithSiteTrt2.toString());

 

LOGGER.debug("Array properties : " + nodeService.getProperties(nodeRef).toString());
LOGGER.debug("Array properties2 : " + nodeService.getChildAssocs(nodeRef));
LOGGER.debug("Array ASSOC : " + nodeService.getProperty(nodeRef, CustomModel.ASSOC_PRODUIT_SITE));

 

All this method return null value or empty value or not interesting value....

 

So, if i check this node on Alfresco console node Brower : my association is really exist :

 

Associations (1)

TypeRéférence de la cibleType d'association
st:siteworkspace://SpacesStore/ded70eb7-3fde-47a0-90aa-9189e7091a8ecustom:folderProduit_siteTrt_assoc

 

I will be crazy, I have any idea?

Outcomes