Create new document type in Alfresco

Alfresco have many options to extend their document management system and one of them is to create a new document type as seen in the picture below. The new document is a Whitepaper, but we could have added other document types like a functional specification, meeting minutes, risk matrix and whatever that tingles our needs.

All documents that are uploaded or created in alfresco is by default marked as “content”, a generic term that can encompass everything. To create a document type is an easy way of setting documents apart/a way of categorizing and structuring the content itself. A developer can add certain functionality/behavior to a document type like a doc type having certain metadata connected to it, workflow (review, acceptance, publish), add versioning, that certain people shall be notified of changes or add permission so that only specific people can create and edit the document. One can add advanced search capabilities like searching for a specific document type.


So, down to the gritty details. First one have to define the document type (custom content model) (config/extension/model/whitepaper.xml):

<?xml version="1.0" encoding="UTF-8"?>

<!-- Definition of new Model -->
<model name="mb:mybusiness.whitepaper.model" xmlns="">
    <description>My business Whitepaper</description>
    <author>Helene Klungvik</author>

		Imports are required to allow references to definitions in other
		<!-- Import Alfresco System Definitions -->
		<import uri="" prefix="sys"/>
		<!-- Import Alfresco Dictionary Definitions -->
		<import uri="" prefix="d" />
		<!-- Import Alfresco Content Domain Model Definitions -->
		<import uri="" prefix="cm" />

		<namespace uri="mybusiness.whitepaper.model" prefix="mb" />

		<type name="mb:doc">


Then create a spring bean that imports the whitepaper model (config/alfresco/extension/module-context.xml):

<?xml version="1.0" encoding="UTF-8"?>
    Document   : module-context.xml
    Created on : March 11, 2009, 10:00 AM
    Author     : Helene Klungvik
        Define a new document type for whitepapers

    <bean id="mybusiness.dictionaryBootstrap"
        parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">

And that’s it.

About Haridasi

integrity - the state of being whole, entire, or undiminished.
This entry was posted in Technology and tagged . Bookmark the permalink.

6 Responses to Create new document type in Alfresco

  1. pietro says:

    Do you know how to add custom fields to your doctype?

  2. Sufie says:


    Thanks for the post. Do you know how I can load word templates to a document library? I want to be able to instantiate a new document into my template based on a word template.



  3. Hi Sufie,

    I’m sorry, but I no longer work with Alfresco 🙁

  4. Necip AKCA says:

    hi i am try to use on weblogic and i did what you wrote but it does not work for me why i dont know there is no log error,info nothing i think it relate weblogic by the way my developer platform is win2008R2,oracle 11rR2 and alfresco 3.4 enterprise

    i am stuck here and not add any content type to alfresco.
    Do you have any idea abouth this problem?

    Good Works

  5. Necip AKCA says:

    hi helene,
    I am trying to use alfresco 3.4 enterprise on oracle weblogic and i did what you wrote and a lot of examples which i found at wiki alfresco or another but all of them does not work for me.It is not appear at new content or add content,there is no log error or warning nothing i could not find any solution for this situation :(:(

    i tihink this is relate weblogic,
    Do you have any idea ?
    Necip AKCA

  6. Dear Necip,

    I’m sorry, but I can’t help you. It’s about two years since I worked with Alfresco.

Leave a Reply

Your email address will not be published. Required fields are marked *