If you want to add your custom aspect to Alfresco 4 then you have to follow the following simple steps

1. Rename /tomcat/shared/classes/alfresco/extension/custom-model-context.xml.sample to custom-model-context.xml and customModel.xml.sample to customModel.xml. These two files define your custom aspect.

2. Open the customModel.xml file and add above the “</model>” tag your aspect definition

Open customModel.xml file and add your custom aspect at the end of the file, right above “</model>”. For e.g. you can add the following, this will add a custom aspect called DocumentDetails

<aspects> 
<aspect name="custom:DocumentDetails"> 
<title>Document Details</title> 
<properties> 
<property name="custom:DocumentName"> 
<title>Document Name</title> 
<type>d:text</type> 
<protected>false</protected> 
<mandatory>true</mandatory> 
<multiple>false</multiple> 
</property> 
<property name="custom:DocumentDescription"> 
<title>Document Description</title> 
<type>d:text</type> 
</property> 
</properties> 
</aspect> 
</aspects>

3, Modify web-client-config-custom.xml file in the extension folder (/tomcat/shared/classes/alfresco/extension). This will enable the new aspect to appear in the web interface of the alfresco application

Add the following XML code at the end of the file, right above </alfresco-config>. This will list our custom aspect in the business rules “Set action values” page.

<config evaluator="string-compare" condition="Action Wizards"> 
<aspects> 
<aspect name="custom:DocumentDetails"/> 
</aspects> 
</config>
 4. Add the following right after the above code block. The code below will ensure that the custom properties will be displayed in the content’s view details page.

<config evaluator="aspect-name" condition="custom:DocumentDetails">
<property-sheet> 
<separator name="sepDocument1" display-label="Document Details" component-generator="HeaderSeparatorGenerator" /> 
<show-property name="custom:DocumentName"/> 
<show-property name="custom:DocumentDescription"/> 
</property-sheet> 
</config>
 5. Add the following right after the above code block. This code will ensure that the properties of the new aspect will appear to the advance search
<config evaluator="string-compare" condition="Advanced Search">
 <advanced-search>
 <custom-properties>
 <meta-data aspect="custom:DocumentDetails" property="custom:DocumentName" />
 <meta-data aspect="custom:DocumentDetails" property="custom:DocumentDescription" />
 </custom-properties>
 </advanced-search>
 </config>

By admin