cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Model

tytanix
Champ in-the-making
Champ in-the-making
Hello! I have a question, how can I define properties for a custom type? Do i have to implement an aspect? Or can I declare properties for a type?

An example

<blockcode>
<types>
      
      <!– Enterpriese-wide tipo di documento generico –>
      <type name="tr:doc">
         <title>Documento Trilogis</title>
         <parent>cm:content</parent>
         <associations>
            <association name="tr:relatedDocument">
               <title>Documenti Correlati</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>ture</many>
               </source>
               <target>
                  <class>tr:doc</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
         
         <mandatory-aspects>
            <aspect>cm:generalclassifiable</aspect>
         </mandatory-aspects>
         
      </type>
      
      <type name="tr:trilogisoffer">
         <title>Documento Offerta Trilogis</title>
         <parent>tr:doc</parent>
         
         <properties>
            <property name="tr:client">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </type>
      
   </types>
</blockcode>

I've declared properties for type "trilogisoffer", but the model isn't shown in alfresco. If i delete type "trilogisoffer" the model will be shown. Why?

Thanks
5 REPLIES 5

mitpatoliya
Star Collaborator
Star Collaborator
You have added the custom property correctly for type  "trilogisoffer".
Yes you can add custom properties that way.

Now I think your issue is you are not able to see that on interface.
For that you need to configure it in either share-config-custom.xml(for Alfresco Share) or in web-clinet-config-custom.xml(for Alfresco Explorer)

tytanix
Champ in-the-making
Champ in-the-making
Ok, I have done that but nothing. Then I've tried to delete the added type e then rewrote them again. After that all has gone ok. I can't  understand what could be the problem but now all work ok.
Another question: is it normal that, after changing document type, i'm not able to change it again?
For example, i have set a document as Article. Then, if i click on change type again, the combobox in the popup is empty.

mitpatoliya
Star Collaborator
Star Collaborator
Normally it is not advisable and also not required to change type of document. I have not checked that scenario but I think you should be able to do it. any errors in logs?

tytanix
Champ in-the-making
Champ in-the-making
There are no errors related to this issue in the log. Now i've noticed that i can't remove the aspect too.
Could this problem be caused by my custom content model?

mitpatoliya
Star Collaborator
Star Collaborator
Aspect remove should defiantly work I am very sure about it. Are you able to do other operations like create update delete?