cancel
Showing results for 
Search instead for 
Did you mean: 

access associations in an aspect?

esource
Champ on-the-rise
Champ on-the-rise
An aspect with associations is attached to a node such as following:


       <aspect name="my:someAspect">
           <title>Some Aspect</title>
         <associations>
            <association name="my:someAssociation">
               <title>SOME Association</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>my:someFile</class>
                  <mandatory>false</mandatory>
                  <many>false</many>   
               </target>
            </association>
         </associations>            
        </aspect>


How can I access the associations in this aspect?  Are they treated the same as other aspects on the node?
2 REPLIES 2

targa2000
Champ in-the-making
Champ in-the-making
You can access all associations on a node via the node itself:

node.getAssociations();

neilm
Champ in-the-making
Champ in-the-making
Yes, you can access aspect-defined associations in the same way as any other associations. So from the node itself as child associations, or from any of the children as parent associations.
Associations defined on aspects are not 'special' at the services API level. You can use them as you would any other assocs.