cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript and associations

ale_carraro
Champ in-the-making
Champ in-the-making
Hi to all, I've been using Alfresco for a month and now I'm starting to extend it. I'm trying to create a new aspect and I'm using the JS api to test my model.

The model contains the following

      <aspect name="bw:sign">
         <title>Sign a document</title>
         <properties>
            <property name="bw:signDate">
               <type>d:date</type>
            </property>
         </properties>
         <associations>
            <association name="bw:signedBy">
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </aspect>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


I want that 0 or many people could sign a document. With the js api I was able to set the signDate attribute. However, I've no idea what kind of the syntax to use… I've tried with
document.properties["bw:signedBy"] = person‍
but I'm nearly sure it is wrong as the signedBy property should be a List and not a Person.

Finally, another 2 little questions:
1) Where can I find the model of the Person?
2) Is there a place where people put his custom model? May be there could be already this kind of model

Thanks for your replay

Alex
1 REPLY 1

ale_carraro
Champ in-the-making
Champ in-the-making
Hi to all, I've been using Alfresco for a month and now I'm starting to extend it. I'm trying to create a new aspect and I'm using the JS api to test my model.

The model contains the following
…‍
I want that 0 or many people could sign a document. With the js api I was able to set the signDate attribute. However, I've no idea what kind of the syntax to use… I've tried with
document.properties["bw:signedBy"] = person‍
but I'm nearly sure it is wrong as the signedBy property should be a List and not a Person.
Someone has recently answered this. It is impossible as the associations are read only in Alfresco 2.0. This feature has been added since the 2.1 release.
Finally, another 2 little questions:
1) Where can I find the model of the Person?
Found: in contentModel.xml file in the war
2) Is there a place where people put his custom model? May be there could be already this kind of model
Still open..  :wink: