Alfresco Content Model



Alfresco Content models are defined in the Data Dictonary as meta-model. The meta-model consists of two main structures - Content Types and Content Aspect.

Content modeling with Model Manager | Alfresco Documentation
Content Type is the fundamental Structure of a content item. It defines the composition of properties and behaviours of a content item. Much like in the object-oriented programming model where an object always has to be a defined class type, in Alfresco an item has to be a defined type also.

Types are like types or classes in the object-oriented world. They can be used to model business objects, they have properties, and they can inherit from a parent type. “Content”, “Person”, and “Folder” are three important types defined out-of-the-box.

There is a root content type defined in Alfresco, all other content types are created inheriting this root type - cm:content or {http://www.alfresco.org/model/content/1.0}content

There are two parts in defining the name
  • Namespace of the content type
  • Name of the content type
The namespace is used to differentiate the content type, much like our Java class packages.

Note: Normally, while creating your own custom content model, you use your own namespace - this will differentiate your types and Alfresco's default models.

Default Alfresco content Models:
    • Many examples “out-of-the-box” 
• Search for “*Model.xml” across the Alfresco source tree 
• Core model files (with defi...
  1. dictionaryModel.xml - The core and base model of Alfresco data. This defines all the basic data types that will be used for defining other content models.
  2. systemModel.xml - This defines the models used by Alfresco system and the most abstract models in alfresco. 
  3. contentModel.xml - This is the defination of all base objects and content types in alfresco repository. If defines bases content type as cm:content, space type as cm:folder, user as cm:person, category as cm:category and so on.
  4. bppModel.xml - This stores all the business process models in alfresco.
Content modeling specifies how nodes are stored in the content repository. Each model defines one or more types, where a type enumerates the properties and relationships that a node of that type can support. Models also define kinds of relationships, property data types, and value constraints.


Content Aspect is a resuable encapsulation of properties and behaviors. An Aspect can be applied or associated with any content both a design time as well as at runtime. This features follows the Aspect-Oriented Programming model.

Aspects “cross-cut” the content model with properties and associations by attaching them to content types (or even specific instances of content) when and where they are needed.
Aspects are nothing but set of properties which can be applied to multiple content types.

Properties are pieces of metadata associated with a particular type. For example, the properties of an Expense Report might include things like “Employee Name”, “Date submitted”, “Project”, “Client”, “Expense Report Number”, “Total amount”, and “Currency”.

Property types (or data types) describe the fundamental types of data the repository will use to store properties. Examples include things like strings, dates, floats, and booleans.

Image result for AlfrescoData Dictionary is a meta-model for describing one or more Content models. We refer to the dictionary meta-model as level M2, and a content model as level M1. The meta-model supports two primary constructs; Content Type and Content Aspect. Both provide the ability to describe a specific content structure including properties (meta-data) and associations to other content.


Best practices

  1. Do not change alfresco out-of-the-box content model
  2. Consider implementing a root scope type
  3. In the beginning add properties that you really need as it is hard to remove properties latter .
  4. Avoid unnecessary content depth
  5. Use aspect when you can
  6. Are empty types really necessary??
  7. Create multiple content models to keep them in order
  8. Implement one java class that corresponds with each of the custom models.

Comments

Popular posts from this blog

Install Alfresco Content Service 6.0 on ubuntu 16 using distribution zip

Lucene and fts-search

Call javascript webscript from contoller