Wasim's Site

Alfresco Content Model Generator

Visually build an Alfresco customModel.xml — define namespaces, custom types, aspects, and properties, then export ready-to-deploy content model XML.

Model & Namespace

Add Type or Aspect

Generated Content Model XML

Building Alfresco Content Models

Every Alfresco customization starts with a content model — an XML definition that tells the repository about your custom types, aspects, and properties. Hand-writing customModel.xml is tedious and error-prone: one misplaced tag or wrong namespace and the dictionary fails to load on startup. This generator builds a valid model structure for you so you can focus on the data, not the DTD.

Anatomy of a Content Model

  • Namespaces: A prefix (e.g. my) bound to a URI. Everything you define is qualified by it.
  • Imports: Reference the built-in d (dictionary) and cm (content) models so you can extend them.
  • Types: First-class node definitions with a single parent (e.g. my:invoice extends cm:content).
  • Aspects: Reusable property bundles you can attach to any node (cross-cutting metadata).
  • Properties: Typed fields (d:text, d:date, d:int, …) with optional mandatory and multiple constraints.

How to Use This Generator

  1. Define the namespace: Set your prefix, URI, model name, author, and version.
  2. Add types and aspects: Choose the kind, give it a name and title. For types, set the parent (defaults to cm:content).
  3. Add properties: Pick which type/aspect to attach to, name the property, choose its data type, and flag it mandatory or multiple if needed.
  4. Copy or download: Grab the generated customModel.xml and drop it into your module's model/ folder.

Property Data Types

d:text — single-line string
d:mltext — multilingual text
d:content — binary content stream
d:int / d:long — integers
d:float / d:double — decimals
d:date / d:datetime — dates
d:boolean — true/false
d:noderef — reference to another node
d:qname — qualified name
d:category — classification category

Frequently Asked Questions

What is an Alfresco content model?
A content model is an XML file that defines custom types, aspects, properties, associations, and constraints for your Alfresco repository. It extends the out-of-the-box cm:content model so you can store domain-specific metadata (e.g. invoice number, contract date).
Where does customModel.xml go in my project?
In a repository AMP/JAR module it lives under src/main/resources/alfresco/module/<module-id>/model/ and is registered with a Spring bean (dictionaryBootstrap) or via a Share/Repo module-context.xml. The exact path varies by SDK version.
What is the difference between a type and an aspect?
A type defines what a node IS (it has a single parent type, e.g. my:invoice extends cm:content). An aspect is a reusable bundle of properties and behaviour you can attach to many types (e.g. cm:titled, my:reviewable). A node has exactly one type but can have many aspects.
Which property data types are supported?
Alfresco ships d:text, d:mltext, d:content, d:int, d:long, d:float, d:double, d:date, d:datetime, d:boolean, d:any, d:noderef, d:qname, d:category, and d:locale. This generator includes all of them in the type dropdown.
Does this tool validate against the Alfresco DTD?
It produces well-formed model XML following the standard structure (model → imports → namespaces → types → aspects → properties). Always test-deploy on a dev repository; Alfresco validates the model on startup and logs any dictionary errors.

Official Resources