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

<aspect name="custom:DocumentDetails"> 
<title>Document Details</title> 
<property name="custom:DocumentName"> 
<title>Document Name</title> 
<property name="custom:DocumentDescription"> 
<title>Document Description</title> 

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"> 
<aspect name="custom:DocumentDetails"/> 
 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">
<separator name="sepDocument1" display-label="Document Details" component-generator="HeaderSeparatorGenerator" /> 
<show-property name="custom:DocumentName"/> 
<show-property name="custom:DocumentDescription"/> 
 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">
 <meta-data aspect="custom:DocumentDetails" property="custom:DocumentName" />
 <meta-data aspect="custom:DocumentDetails" property="custom:DocumentDescription" />

By admin