cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Child-Association using jcr

sanatmastan
Champ in-the-making
Champ in-the-making
Hi,
I am trying to create child-association using jcr api remotely using jcr-rmi. can anyone please throw some light on what is the process??

here is my model definition:

      <type name="ppb1:ContentContract">
         <title>ContentContract</title>
         <parent>ppb1Smiley TonguePBaseModel</parent>
         <associations>
            <child-association  name="ppb1:ContentSpecRefAssociation">
               <title>ContentSpecRef Association</title>
               <source>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>ppb1:ContentSpecRef</class>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </target>
            </child-association>
            <child-association  name="ppb1:ContentInstanceAssociation">
               <title>Content Instance Association</title>
               <source>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>ppb1:ContentInstance</class>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </target>
            </child-association>
         </associations>
      </type>

I want to know how to create child-associations for type ContentContract using JCR API???

And also how can i relate foundation api with JCR api???

Thanks In Advance
Sanat.
1 REPLY 1

sanatmastan
Champ in-the-making
Champ in-the-making
I think i figured out this. "child-association" is creating a child node using addNode method, where as simple "association" is just setting the property of the node using setProperty("propname", NodeRef); where as NodeRef is a reference to existing node.