Thursday, August 4, 2011

Alfresco 3 Cookbook: what it covers?

Chapter 1, Getting Started
Chapter introducing alfresco with brief demonstration of the alfresco Explorer application. Get alfresco downloaded and installed in your machine, and finally be acquainted with the default distribution and architecture of alfresco.

Chapter 2, Creating and Organizing Contents
Understand how to use alfresco as the Content Management System, how to upload or create contents, how to apply tagging or categorization of content, understand content metadata, use the document versioning capability of alfresco.

Chapter 3, Securing and Searching Contents
Be familiar with another important aspect of the Content Management System – Security. Understand how to secure your contents and folders. How to create users and user groups – and assign permissions for who can do what. You will also know about the search capabilities offered by alfresco, how to search contents and how search works in alfresco.

Chapter 4, Rules – the Smart Spaces
Learn how to make your alfresco repository dynamic, how to implement your business requirements that works automatically in the repository. You will understand how to create and apply rules in the repository; you will also be familiar with different actions that can be performed via a rule.

Chapter 5, Administering Alfresco
Chapter with recipes for administering alfresco, demonstrating how to manage users, user groups, create taxonomies, manage content categories. You will also be aware of how to use the alfresco Node Browser to view and search contents stored in the repository. You will also know how to manage your alfresco explore r dashboard.

Chapter 6, Customizing Alfresco Web Client
Alfresco offers customization of the Web Client application via a number of XML configuration files. This chapter elaborates various recipes for changing the view and appearance of the web client, customizing the application as per your requirements etc.

Chapter 7, Alfresco Content Model
Designing and modelling the content properties and architecture is one of the important requirements in a Content Management System. Alfresco offers pretty much dynamic capabilities for designing the content models. Using these recipes you will be able to understand the core architecture of alfresco content models, create your own custom content models, use your custom models in the alfresco explorer application.

Chapter 8, Alfresco JavaScript API
Alfresco offers the repository functionalities in form of JavaScript APIs. In this chapter you will understand the API structure and available features offered. Several example recipes would help you implement various functionalities. You will also learn how to write and execute scripts, how to debug scripts written using the APIs.

Chapter 9, Freemarker Templates
Freemarker Template is the presentation layer technology used in alfresco applications. The recipes of this chapter would help you understand the technologies and model behind the Freemarker templates in alfresco. Several template examples are included for commonly used functions such as displaying folder contents, showing workflow tasks, showing contents recursively, displaying content properties and details etc.

Chapter 10, Web Scripts
Alfresco Web Scripts provide RESTful APIs of the repository services and functions. The chapter elaborates all related concepts, knowledge and how-to recipes that would help you writing, deploying, debugging, using web scripts. You will also know the usage of default web scripts library that come with alfresco. Several sample web scripts are included, for example sending emails using templates, searching and displaying documents etc.

Chapter 11, Working with Workflows
Workflow implementation is one of the major requirements in a Content Management System in a business. This chapter would help you understand alfresco business process engine in detail. You will understand how the workflows are implemented in alfresco repository along with various components of the workflow engine. Several detailed examples and recipes are included to guide you create custom workflows, custom task models, specific resource bundles, customizing the web client to render the custom tasks and workflows properly. You will also be able to use the alfresco workflow console interface which is useful for debugging the task execution within the BPM engine.

Chapter 12, Integrating with MS Outlook and MS Office
Alfresco can be used from several other applications and interfaces. Being a content management system it is quite important to have the alfresco repository accessibility from some popular content authoring applications such as Microsoft Office. This chapter helps you integrate the alfresco repository with MS Word, Excel and PowerPoint. Recipes are also included for communicating with repository directly from any standard email client application such as MS Outlook.

Chapter 13, Configuring Alfresco E-mail and File Servers
The alfresco repository can act has file servers as well and you can expose the repository using several other standard protocols such as FTP, CIFS, WebDAV etc. These recipes are step-by-step guide to configure these protocols and using the content repository from different systems. From this chapter you will also be able to use alfresco as email server, and emails sent to some specific address will be landed directly into the repository.

Chapter 14, Building Alfresco
Until now you have used Alfresco as the binary bundle provided and downloaded. Now you can compile and build alfresco source code also. Recipes in this chapter will guide you to get the source from alfresco source code repository, compile and build the source code. You can modify Alfresco source code as your will; of course as per Alfresco license, you should contribute your changes back to alfresco community.

Thursday, July 28, 2011

Alfresco 3 Cookbook: for whom?

Alfresco 3 Cookbook – Recipes for Practical Usage of Alfresco.

The book is a collection of knowledge articles and recipes stating and demonstrating the most important, useful and imperative concepts and functionalities of Alfresco.

The book is designed purely for Alfresco Developers and System Integrators - from beginner to advanced level.

  • If you are a software developer, interested in content management systems, want to work in alfresco or already experienced in alfresco, you need very objective set of instructions on how to perform certain tasks in Alfresco.
    Alfresco 3 Cookbook is a developer’s friend to start working on alfresco quickly, getting complete understanding, writing custom implementations and achieving the expertise very easily.
  • As alfresco administrator and architect, you will know how to compile, deploy, install, configure and customize alfresco.
  • If you are a system integrator, you will be able to establish alfresco as a corporate enterprise content management solution.

The book is written for software developers who needs to know more on Alfresco, write applications and extensions on alfresco, very quickly, in order to implement their own ECM system.

The book is structured as a collection of recipes for real-world problems and requirements. Each recipe includes the problem/requirement definition, step-by-step instructions to fulfill the requirement (How to do it) and a complete analysis (How it works) of the solution. Corresponding screenshots and complete code segments are also included.

Step-by-step instructions are given on how to compile, build, deploy, install and configure alfresco.

As a developer or architect you can follow the guidelines, implement the scenario by yourself, understand how it is working and finally gain expertise on mostly all aspects of alfresco development and customization.

Wednesday, July 27, 2011

Alfresco 3 Cookbook: Credits

Yesterday Packt Publishing published my first book on Alfresco titled Alfresco 3 Cookbook (

I would like to thank PucktPub for publishing.the book.

Here are the people whose contribution has made the book a success. I sincerely thank all of them and appreciate all their help and efforts.


Piergiorgio Lucidi
Adit Patel
Khazret Sapenov
Snehal Shah

Acquisition Editor

Steven Wielding

Development Editor

Alina Lewis

Technical Editor

Gauri Iyer

Copy Editor

Leonard D'Silva

Project Coordinator

Shubhanjan Chatterjee


Mario Cecere


Tejal Daruwale



Production Coordinator

Adline Swetha Jesuthas
Arvindkumar Gupta

Cover Work

Adline Swetha Jesuthas

Friday, July 15, 2011

Short Comparison of Alfresco flavors

Alfresco Team - "If you are looking to just get started with Alfresco or need a supported, departmental solution for content collaboration, then Alfresco Team is for you."

Here is a short and brief comparison of three different flavors of Alfresco (from Alfresco Mailing List).

Friday, February 18, 2011

Workflows for Deleted Sites in Share

You can very well delete a site in alfresco share. However, what happens to the workflows in progress in the site?

If you delete a site, the workflows remains as it is. For example, if you have document approval flow going on in a particular site, and then you delete the site - the workflow still stays, thus when you try to approve or reject the document, it behaves erratically.

The workflows should also be cancelled or deleted while you remove a site in alfresco.
Same applies to any space as well? It should first check if any workflow in going on in that space or sub-space.

Sunday, February 6, 2011

Alfresco Share Extra Dashlets

Wonderful effort by Will Abson.
Some interesting Alfresco Share extension dashlets can be found at

Saturday, February 5, 2011

Organization Hierarchy in Alfresco

Alfresco, as we know, does not support implementation of Organization Hierarchy.
For example, you cannot establish the hierarchy of your Organization via the user details in Alfresco.

Very often, you need setting up the user hierarchy in the ECM system, for example if you want to implement automatic assignment of tasks to your superior.

You, however, can use the owner property of the user object to store the superior's user-id. Thus you can have full parent-child relationships between users in alfresco.

You can also create a custom aspect having the properties reflecting hierarchy information, associate that with user type (cm:person), and hold the relevant data into that.

One interesting implementation of this is, if you have your organization hierarchy stored in your AD or LDAP, you directly import this information while synchronizing the user data with alfresco. In the post on Alfresco Authentication and Integration with Active Directory, I have given some example on synchronizing the LDAP attributes into alfresco like


You can add another custom synchronization setting along with these to import the Boss Id of the current user.

For Businesses

Implementing and Storing the Organization Hierarchy in an ECM system like Alfresco has quite a few business advantages. Implementing automatic workflows within departments requires the system to know the manager's id of the user.
You can implement the departments of your organization as Sites in Alfresco Share; however, the roles Collaborator, Contributor etc are not hierarchical, and thus unable to translate the pecking order of a particular organization. One way to implement this is to create groups and sub-groups as per departments.

Tuesday, January 25, 2011

Task Comments in Alfresco jBPM workflow as process variable

It is very powerful to have alfresco JavaScript APIs accesible in node event scripts in jBPM workflows.

Most of the workflow variables are accesible in jBPM process definition in alfresco.
Such as bpm:assignee is available as bpm_assignee, bpm:workflowDueDate is available as bpm_workflowDueDate, bpm:workflowPriority as bpm_workflowPriority etc

But the task Comments entered by the user is unfortunately not available directly. However, you can still access it by the following syntax in the script.

var comment = ""; 
if (token.comments.size() > 0) 
    comment = token.comments.get(0).message;

The comment variable is now available in your script.

Saturday, January 15, 2011

Alfresco Authentication and Integration with Active Directory

One of the main features of the Alfresco ECM System is the ability to integrate user authentication and synchronization with almost all popular LDAP directory servers, such as Microsoft Active Directory.

However, the integration is error prone and requires understanding of your LDAP environment settings and configuration. Moreover, as a warning, I must say the error messages you will face during the integration are most of the time mis-leading and subjective.

In this article, we will see how we can integrate alfresco with AD; and also how to synchronize alfresco users and groups with the existing entities of your AD. I have used alfresco 3.3.4 in this case.

Be prepared with the settings of your AD so that you can understand and configure your alfresco as well.

Alfresco Subsystems

There are a few subsystems offered in alfresco installation.
  1. Audit
  2. Authentication
  3. File Server
  4. IMAP
  5. Synchronization
  6. EMail
We will use the Authentication and Synchronization subsystems for this purpose.

Authentication Subsystem

For authentication purpose, alfresco can be configured with AD, LDAP, Kerberos, alfrescoNtlm or other external servers. You can configure alfresco to authenticate from a number of systems - this is known as Authentication Chain.
You define the authentication chain in file or in file.

By default, the authentication chain is defined as (in file)


Thus, only alfrescoNtlm authentication is activated.
For enabling AD authentication, we put it as


Now alfresco will try to authenticate the user first from the configured AD, and if the user is not present there, alfrescoNtlm will be tried. If you put only ldap-ad1:ldap-ad, alfresco local authentication will be fully stopped. In this way, you can integrate a number of systems into alfresco authentication chain.

Configuring Active Directory Authentication

In webapps\alfresco\WEB-INF\classes\alfresco\subsystems\Authentication, we have separate folders for separate servers. For our Active Directory integration, our settings should be populated in the file in ldap-ad folder.

This file is used to set the configurations on Authentication as well as Synchronization with AD.
This value should be true in order to make the authentication mode activated.
This value pattern will be used when users will put the user name in the alfresco login dialog and try to be authenticated. This value should be full User Principal Name (UPN) or DN.
No need to change this line. We use the default Sun Java LDAP libraries.<<server-name or ip>>:389
Put your AD server name or IP here. 389 is the default port for LDAP services, consult your administrator in case you have different port.
This value can be simple, digest-5 etc. Again, depends on your AD setup.

We won't change these values.

Put your administrator user name here.

These values and settings are enough to make alfresco authenticate against your Active Directory. However, we also need synchronization between your AD and alfresco, so that users and groups are imported into alfresco and you can manage the permissions and restrictions of the users.

Configuring Active Directory Synchronization

Same file is used to populate the synchronization settings.
True means alfresco will try to import AD users and groups into local system.,CN=Users,DC=domain,DC=com
Put your administrator user DN here.****
Put your user password here - in plain text.


We do not change these values for now.

The objectclass of your Groups in AD.

The objectclass of your Users in AD.

Pretty standard, change the objectclass only, if required.

Again pretty standard, change the objectclass of users only, if required.

Put your AD domain configuration here for Groups query search base. I have used a generic search base here, it would probably search everything.

Put your AD domain configuration here for Users query search base. I have used a generic search base here, it would probably search everything.


We won't change these values now. These are used to populate the user attributes from AD.


These values also may not be changed for now.

That's it!
Restart your server, alfresco should connect to your AD and import all users and groups. For authentication, it should go to your AD and validate the credentials.


In community version, you need to add this XMl tag in common-ldap-context.xml file in subsystems\Authentication folder.
Under the following tag -
<bean id="ldapInitialDirContextFactory">
<property name="initialDirContextEnvironment">

Add this entry -
<entry key="java.naming.referral">