Please follow the steps below to create new aspects in Alfresco:

1. New aspects can be defined in defaultCustomModel.xml file located at ALFRESCO_TOMCAT_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/model/defaultCustomModel.xml.

2. Find <aspects> tag in defaultCustomModel.xml file. There is only one <aspects> tag and <aspects> tag can contain multiple <aspect> tag.

3. Each <aspect> tag defines a new custom aspect. For example look at the following code snippets:

<aspect name=”cm:algocustompayment”>
    <title>Payment Aspect</title>
    <properties>
        <property name=”cm:algopayment”>
            <title>Payment Amount</title>
            <type>d:text</type>
            <mandatory>false</mandatory>
            <index enabled=”true”>
            <atomic>true</atomic>
            <stored>true</stored>
            <tokenised>true</tokenised>
            </index>
        </property>
    </properties>
</aspect>

4. Each <aspect> tag has name attribute which is the name of the aspects.

5. Each <aspect> tag has <title> tag which is the human readable name of the aspect.

6. Each <aspect> tag has <properties> tag which defines the properties associated with that aspect.

7. Each <properties> tag can have multiple <property> tag. Each <property> tag defines a property associated with that aspect.

8. Each <property> tag has mandatory name attribute which defines the name of the property used within alfresco system to identify the property.

9. Each <property> tag has mandatory <title> child tag which is human readable name of the property.

10. Each <property> tag has <type> child tag which is used to define type of the property. The acceptable values are d:any, d:text, d:mltext, d:content, d:int, d:long, d:float, d:double, d:date, d:datetime, d:boolean, d:qname, d:noderef, d:childassocref, d:assocref, d:path, d:category, d:locale, d:version.

11. Each <property> tag has <mandatory> child tag which defines whether this property is mandatory or not. Acceptable values are true and false.

12. Each <property> tag has <index> tag which defines whether this property should be indexed by lucene or not.


« Open Source CMS Systems
Alfresco - How to display custom aspects on Advanced Search Screen »


Leave a Reply