cancel
Showing results for 
Search instead for 
Did you mean: 

Custom model and aspects

nowhere
Champ in-the-making
Champ in-the-making
Hi all,
I'm trying to create custom model and I have a very stupid question:

I have defined my model as follow:


<types>
      <type name="my:perscontent">
         <title>My job document </title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:dataPianificazione">
               <type>d:datetime</type>
            </property>
            <property name="my:type">
               <type>d:text</type>
            </property>
         </properties>
       </type>
</types>
<aspects>
  <aspect name="my:responsible">
            <associations>
                <association name="my:resp">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </association>
            </associations>
        </aspect>
   </aspects>


I'd like the "responsible aspect" to be automatically added when I create my content "perscontent" and choose my responsible among Alfresco users (just as bpmAssignee in workflow) when I define other content properties in webclient UI. Is there a way to automatically attach the aspect to the content when it's created?
Hope you can help me Smiley Happy
Greetings,
NW
1 REPLY 1

nowhere
Champ in-the-making
Champ in-the-making
Hi again,
I solved my problem in this way instead:



<types>
      <type name="my:perscontent">
         <title>My job document </title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:dataPianificazione">
               <type>d:datetime</type>
            </property>
            <property name="my:type">
               <type>d:text</type>
            </property>
         </properties>
         <associations>
           
            <association name="my:respq">
               <source>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association> 
         </associations>
      </type>

So, every job document, that is my custom content, should have a responsible… but I don't know if this is an accettable solution. What do you think?
Anyway, I'm still wondering about my previous question, if you can help me to solve it: "Is there a way to automatically attach the aspect to the content when it's created?" (I mean, without defining a rule).
Thanks in advance!