cancel
Showing results for 
Search instead for 
Did you mean: 

Change type using API

vikrantkorde
Champ in-the-making
Champ in-the-making
Hi Experts,

I have created a custom type as below

<type name="my:ins">
         <title>Insurance documents</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:maturityDate">
               <type>d:datetime</type>
            </property>
            <property name="my:insuranceNumber">
               <type>d:text</type>
            </property>
            <property name="my:beneficiaryName">
               <type>d:text</type>
            </property>
            <property name="my:sumAssured">
               <type>d:int</type>
            </property>
         </properties>
      </type>

In file /u01/AlfrescoDMS/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file this type is associated to cm:content as below
      <types>
         <type name="cm:content">
         <subtype name="my:ins" />
         </type>

When i go to Details page for any file and click on "Change Type" link from right side of page (Image attached) I can see the type as "type.my_ins". If i select this type and click on OK then it shows success message and also the properties which i have added in the respective model.xml file, are visible in "Edit Properties" page.

So i believe the changes i have made to add additional properties are working fine. The question is when i add new file in the repository i want to change the type of that file to "type.my_ins" through API and then i also want to set the values in those additional properties. How can i do that?

Regards,
Vikrant Korde
2 REPLIES 2

vikrantkorde
Champ in-the-making
Champ in-the-making
Screen shot attached

vikrantkorde
Champ in-the-making
Champ in-the-making
Change Type screen shot