Tips and Tricks for using Alfresco 3 Business Solutions


Alfresco 3 Business Solutions

Alfresco 3 Business Solutions

Practical implementation techniques and guidance for delivering business solutions with Alfresco

  • Deep practical insights into the vast possibilities that exist with the Alfresco platform for designing business solutions.
  • Each and every type of business solution is implemented through the eyes of a fictitious financial organization - giving you the right amount of practical exposure you need.
  • Packed with numerous case studies which will enable you to learn in various real world scenarios.
  • Learn to use Alfresco's rich API arsenal with ease.
  • Extend Alfresco's functionality and integrate it with external systems.


        Read more about this book      

(For more resources on Alfresco, see here.)

Node references are important.
Tip: Node references are used to identify a specific node in one of the stores in the repository. You construct a node reference by combining a Store Reference such as workspace://SpacesStore with an identifier.
The identifier is a Universally Unique Identifier (UUID) and it is generated automatically when a node is created. A UUID looks something like this: 986570b5-4a1b-11dd-823c-f5095e006c11 and it represents a 128-bit value. A complete Node Reference looks like workspace://SpacesStore/986570b5-4a1b-11dd-823c-f5095e006c11.
The node reference is one of the most important concepts when developing custom behavior for Alfresco as it is required by a lot of the application interface methods.

Avoid CRUD operations directly against the database.
Tip: One should not do any CRUD operations directly against the database bypassing the foundation services when building a custom solution on top of Alfresco. This will cause the code to break in the future if the database design is ever changed. Alfresco is required to keep older APIs available for backward compatibility (if they ever change), so it is better to always use the published service APIs.
Query the database directly only when:

  • The customization built with available APIs is not providing acceptable performance and you need to come up with a solution that works satisfyingly
  • Reporting is necessary
  • Information is needed during development for debugging purposes
  • For bootstrapping tweaking, such as when you want to run a patch again

Executing patches in a specific order
Tip: If we have several patches to execute and they should be in a specific order, we can control that with the targetSchema value. The fixesToSchema value is set to Alfresco's current schema version (that is, via the version.schema variable), which means that this patch will always be run no matter what version of Alfresco is being used.

It is a good idea to export complex folder structures into ACP packages.
Tip: When we set up more complex folder structures with rules, permission settings, template documents etc, it is a good idea to export them into Alfresco Content Packages (ACP) and store them in the version control system. The same is true for any Space Templates that we create. These packages are also useful to include in releases.

Deploying the Share JAR extension
Tip: When working with Spring Surf extensions for Alfresco Share it is not necessary to stop and start the Alfresco server between each deployment. We can set up Apache Tomcat to watch the JAR file we are working with and tell it to reload the JAR every time it changes.
Update the tomcat/conf/context.xml configuration file to include the following line:


Now every time we update this Share extension, JAR Tomcat will reload it for us and this shortens the development cycle quite a bit. The Tomcat console should print something like this when this happens:

INFO: Reloading context [/share]

To deploy a new version of the JAR just run the deploy-share-jar ant target:

C:\3340_03_Code\bestmoney\alf_extensions\trunk>ant -q deploy-share-jar
[echo] Packaging extension JAR file for share.war
[echo] Copies extension JAR file to share.war WEB-INF lib

Total time: 0 seconds

Debugging AMP extensions
Tip: To debug AMP extensions, start the Alfresco server so that it listens for remote debugging connections; or more correctly, start the JVM so that it listens for remote debugging connection attempts. This can be done by adding the following line to the operating system as an environment variable: -Xdebug -


This means that any Alfresco installation that we have installed locally on our development machine will be available for debugging as soon as we start it.
Change the address as you see fit according to your development environment.
With this setting we can now debug both into Alfresco's source code and our own source code at the same time.

        Read more about this book      

(For more resources on Alfresco, see here.)

NTLM authentication
Tip: NTLM has mostly been replaced by Kerberos as authentication protocol for Microsoft domain-based scenarios. However, Kerberos is a trusted third-party scheme and cannot be used when there is no trusted third party. For example, a server that is not part of the domain, local Windows accounts, and resources is in an un-trusted domain. In these cases, NTLM authentication has to be used.

Alfresco WebDAV
Tip: CIFS is a very chatty protocol and when we have clients connecting remotely they might experience problems uploading files and browsing through the repository. Also, in installations with thousands of users Alfresco CIFS can experience performance problems and occasional interruptions. Further on, if you are using a virtualized application environment like Citrix XenApp, it can be a configuration challenge to get CIFS working.
The solution in these cases is to turn to WebDAV, which communicates with Alfresco via the familiar HTTP protocol and is much easier to get up and running, and to test that it is working.

Nothing happens in Alfresco when trying to login via CIFS
Tip: There are Windows 2000 or later clients that will try and login via Native SMB and that does not work when running Alfresco CIFS server in parallel with Windows CIFS server. Only one server can listen to port 445 at a time and that is the Windows CIFS Server in this case.
Close down Windows CIFS Server to get around the problem. Usually, you have to stop the Printer and File Sharing service.
Also, make sure there is no firewall blocking the connection, try and telnet to the server and port.

Using CIFS or WebDAV to set up folders
Tip: Using a mapped drive via the CIFS interface or WebDAV interface is a good starting point when creating folders as it is easy and very fast to create folders this way. We can also easily copy similar folder hierarchies via a mapped drive. However, as soon as we want to set metadata for folders, configure permissions, set up rules, change icon, and so on we need to use one of the Alfresco Uis.

Content modeling manageability
Tip: As in all programming and software development it is not advisable to have code and definitions that are not actually used, as this causes confusion for anyone looking at it and trying to understand. As far as possible try and avoid having any type, aspect, association, or property in the content model definition that is not actually used. Better to add it later on, if needed.

The WCM systems
Tip: The traditional Alfresco WCM system comes with an AVM store that supports advanced folder versioning and change sets, which is not supported by the DM store (i.e. workspace://SpacesStore). From the traditional WCM system you can manage deployments of web application files to many different target systems: web servers, other alfresco systems, or the local DM system. There is also a newer WCM system supported by Alfresco that is called Alfresco Web Quick Start (WQS). The WQS system is managed via Alfresco Share and provides a starter web application so it is easier to get going. The traditional WCM system only manages a web application and requires you to import a web application before you can do anything.

Alfresco Share
Tip: If a Share site does not show up in the e-mail client after we have selected it as an IMAP favorite in Alfresco Share, then we need to manually force an update of the folder list. In Outlook, we can do that by right-clicking on the account name and then selecting Update Folder List.


This article took a look at some tips and tricks for using Alfresco 3 Business Solutions.

Further resources on this subject:

You've been reading an excerpt of:

Alfresco 3 Business Solutions

Explore Title