Hopefully this will give you some general guidance. It's a guide I created for personal use: Custom Content Creation in Alfresco is managed by creating .xml and .properties files in the $JBOSS_HOME/server/default/conf/alfresco/extension folder. Required files are the following:
* ___-model-context.xml (A file defining the context for your model) o Creates a customized spring bean by extending the existing dictionary o Includes a call to include your file __Model.xml
* __Model.xml o Allows you to define the name, description, author, and version of the model as custom meta-data for the model o Must import Alfresco Dictionary Definitions (<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />) and Alfresco Content Domain Model Definitions (<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />) o Should introduce the new namespace defined by the model (<namespace uri="http://www.burrislogistics.com/model/content/1.0" prefix="bl" />) o When defining data types, it's recommended to go ahead and create an enterprise-wide generic data type, in case features are needed across types you've created. o Each type is creamed with the following declaration form: + <type name="bl:doc"> <title>Burris Logistics Document</title> <parent>cm:content</parent> </type> o In addition to types, this file also contains any aspects that you'll need. (Think interfaces / fields) + Here's an example of creating an expireable aspect with two properties, a boolean and a date + <aspect name="bl:expireable"> <title>Expirable</title> <properties> <property name="bl:expired"> <type>d:boolean</type> <mandatory>true</mandatory> </property> <property name="bl:expirationdate"> <type>d:date</type> <mandatory>true</mandatory> </property> </properties> </aspect>
* web-client-config-custom.xml o In order to correctly configure both your types and aspects, they must be added to the appropriate portions of the web-client interface. Here are the portions: + The custom aspect properties must be added to the property sheet # <config evaluator="aspect-name" condition="bl:expireable"> <property-sheet> <show-property name="bl:expired" display-label-id="expired" read-only="true"/> <show-property name="bl:expirationdate" display-label-id="expirationdate"/> </property-sheet> </config> + The custom types must be added to the content type list # <config evaluator="string-compare" condition="Content Wizards"> <content-types> <type name="bl:dl"/> </content-types> </config> + The list of aspects to the add/remove features action # <config evaluator="string-compare" condition="Action Wizards"> <aspects> <aspect name="bl:expireable"/> </aspects> <subtypes> <type name="bl:dl"/> </subtypes> # The custom types must be added to the specialise type action # <specialise-types> <type name="bl:atr" /> <type name="bl:app"/> </specialise-types> </config> + The custom types and custom properties must be added to the advanced search query # <config evaluator="string-compare" condition="Advanced Search"> <advanced-search> <content-types> <type name="bl:dl"/> </content-types> <custom-properties> <meta-data aspect="bl:expireable" property="bl:expired" display-label-id="expired" read-only="true"/> <meta-data aspect="bl:expireable" property="bl:expirationdate" display-label-id="expirationdate" /> </custom-properties> </advanced-search> </config>
* webclient.properties o This file configures the text that appears next to the fields for the custom aspect on the web-client interface o Fields must be configured for each custom aspect. Here's an example: + #bl:expired expired=Is Expired expirationdate=Expiration Date
General Notes:
* When changing any of these files, shutdown and restart JBoss. * Additionally, before adding mandatory meta-data aspects, make sure no existing content of the modified type exists, or you will force all existing content of that type into a state where it can not be deleted, as it does not contain the mandatory aspect fields. * If encountering difficulty in compiling the .xml files, open them in an internet browser, and ensure that the .xml code passes through the browser correctly. This should help debug errors presented when Alfresco is started.