2 Replies Latest reply: Nov 17, 2010 11:54 AM by RudiAcikgoz RSS

    Creating and deploying Custom Content types

    RudiAcikgoz Community Member

      Hi,

       

      I have installed LiveCycle ES2 with ContentSpace module. I need to create my own content type, which includes custom metadata fields to be defined as string, date, integer, document..etc type. I could not find a way to do it, could anyone help on the same please ?

       

      thanks in advance

        • 1. Re: Creating and deploying Custom Content types
          Raghu A Community Member

          Hi Rudi,

           

          For a detailed understanding on how to create new custom types you can take a look at:- http://wiki.alfresco.com/wiki/Step-By-Step:_Creating_A_Custom_Model

           

          Also  find below an example of custom Content Model (OrganizationModel.xml).

          Example creates a new type "employee". This new type derives from the existing cm:folder type in Content Services (<parent>cm:folder</parent>). In case you want the objects of your custom types to be visible in the content space UI you should derive them from either cm:folder or cm:cmcontent. Also, this type defines 2 properties namely employeeCode and designation both of them of text type.

           

          To deploy this custom type

          1.       Go to ContentServices UI @ http://<LCServer>:<Port>/contentspace    .

          2.       Browse to Company Home -> Data Dictionary -> Models.

          3.       Add Content.

          4.       Make sure Modify all properties when page closes is checked.

          5.       Select Activate Model.

          ContentServicesImage.JPG

          Once your model is activated you can see it from Workbench in the list of nodeTypes for operations like StoreContent (see image).

           

           

          Here is the text of OrganizationModel.xml for your ease.

           

           

          <model name="org:OrganizationModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
          
          <imports>
          <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
          <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
          <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
          </imports>
          
          <!--Introduction of new namespaces defined by this model -->
          <namespaces>
               <namespace uri="http://www.adobe.com/lc/organization/1.0" prefix="org" />
          </namespaces>
          
          <data-types/>
          <constraints/>
          
          <types>
               <!--<type name="org:company">
                     <parent>cm:folder</parent>
                     <archive>false</archive>
                    <properties>
                      <property name="org:CompanyName">
                          <title>CompanyName</title>
                          <description>CompanyName</description>
                          <type>d:text</type>
                          <mandatory>true</mandatory>
                          <multiple>false</multiple>
                          <index enabled="true">
                          <atomic>true</atomic>
                          </index>
                          <constraints/>
                      </property>
                      <property name="org:cmmLevel">
                           <title>cmmLevel</title>
                          <description>cmmLevel</description>
                          <type>d:text</type>
                          <mandatory>true</mandatory>
                         <multiple>false</multiple>
                      </property>
                    </properties>
                    <associations/>
                    <overrides/>
                    <mandatory-aspects/>
               </type>-->
               <type name="org:employee">
                     <parent>cm:folder</parent>
                     <archive>false</archive>
                    <properties>
                      <property name="org:employeeCode">
                          <title>employeeCode</title>
                          <description>employeeCode</description>
                          <type>d:text</type>
                          <mandatory>true</mandatory>
                          <multiple>false</multiple>
                          <index enabled="true">
                          <atomic>true</atomic>
                          </index>
                          <constraints/>
                      </property>
                      <property name="org:designation">
                           <title>designation</title>
                          <description>designation</description>
                          <type>d:text</type>
                          <mandatory>true</mandatory>
                         <multiple>true</multiple>
                      </property>
                    </properties>
                    <associations>
                    <!--<association name="org:employedBy">
                         <target>
                            <class>org:company</class>
                            <mandatory>true</mandatory>
                            <many>false</many>
                         </target>
                    </association>-->
                     </associations>
                    <overrides/>
                    <mandatory-aspects/>
               </type>
          </types>
          <aspects/>
          </model>
          
          • 2. Re: Creating and deploying Custom Content types
            RudiAcikgoz Community Member

            Hi Raghu,

             

            I tried the solution and it works fine... thank you very much