Create custom datalist in Alfresco

In previous blog I have introduced you to the details in this article we will see how to create datalist of custom type. For instance you want to create datlist which could hold the list of trains with details like train name, train number, Source, Destination, Time etc..

These are the steps which you will have to follow in-order to create it.

Step 1:

Create your custom content model and define your new datalist Item.

To get more details on custom content model you could refer this article.

You datalist Item will look like this

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

<!-- Custom Model -->

<!-- Note: This model is pre-configured to load at startup of the Repository.  So, all custom -->
<!--       types and aspects added here will automatically be registered -->

<model name="custom:customModel" xmlns="">

   <!-- Optional meta-data about the model -->   
   <description>Custom Model</description>

   	  <!-- Import Alfresco Dictionary Definitions -->
      <import uri="" prefix="d"/>
      <!-- Import Alfresco Content Domain Model Definitions -->
      <import uri="" prefix="cm"/>
	  <import uri=""	prefix="dl" />

   <!-- Introduction of new namespaces defined by this model -->
   <!-- NOTE: The following namespace custom.model should be changed to reflect your own namespace -->
      <namespace uri="custom.model" prefix="custom"/>
  	<type name="custom:trainListItem">
			<title>Train List Item</title>
			    <property name="custom:trainName">
					<title>Train Name</title>
				<property name="custom:trainNumber">
					<title>Train Number</title>
			    <property name="custom:sourceStation">
					<title>Source Station</title>
				<property name="custom:destinationStation">
				<property name="custom:trainTime">
					<title>Train Time</title>

Step 2:

Then add that datalist Item to share user interface. To achieve that you need to edit your share-config-custom.xml file.

Your entries into share-config-custom.xml will look like this.

<config evaluator="node-type" condition="custom:trainListItem">




<show id="cm:name" />

<show id="custom:trainName" />

<show id="custom:sourceStation" />

<show id="custom:destinationStation" />

<show id="custom:trainTime" />

<show id="custom:trainNumber" />





<!-- Data Grid view -->

<form id="datagrid">


<show id="cm:name" />

<show id="custom:trainName" />

<show id="custom:sourceStation" />

<show id="custom:destinationStation" />

<show id="custom:trainTime" />

<show id="custom:trainNumber" />





Step 3:

Restart the server and login to alfresco share

Step 4:

Create new site and go to datalist tab from top right corner.

Click on create new datalist. It will open up new popup where you should be able to see your new datalist available in the list. To enable datalist in site refer this post

Select that and create new data list.

Train SampleList1

Step 5:

Now you will be able to see that new datalist and when you click on “new Item” it will open up popup form where you could feed in all details of train and can add details related to new train in the datalist.

Train New Item

This is how you could create new datalist based on your requirements. It will be more convenient to handle all those items here because all the items will appear together in form of data grid.

Train Datalist
Looking for quality Alfresco Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , | Posted under Alfresco | RSS 2.0

Author Spotlight


I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.

5 Comments on Create custom datalist in Alfresco

  1. sami says:

    Hi mitpatoliya,
    Please how we can rename the columns headers of the datagrid view ?

    • mitpatoliya says:

      By default it fetches property titles from content model file. One option is to create property file and externalize those titles from content model xml file. Other option is to use “appearance” tag in form config where you can explicitly define header for field.

  2. Christian says:

    Hello mitpatoliya!

    Thank you for Sharing your Knowledge to us!

    Please can explain where to store the new file ?
    and which name should it have? i

    I use Alfresco CE 5.0.d.0

    Thanks in Advance

    Greetings from Austria

  3. Thirumal says:

    To get all the datalist [“/api/classes/dl_dataListItem/subclasses”)]
    To get custom datalist, I need to create subclass or [“/api/classes/custom.model/subclasses”)]

Leave a Reply to mitpatoliya Cancel reply

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