In this article I will be discussing a sample Eclipse project for making Alfresco Share customizations. This sample project will be used in later articles discussing various ways to customize Share.


There is an ant build file along with a and file. You will need to adjust the file paths in the file to fit your development environment. The alfresco.web.dir should point to your exploded Alfresco Share war file in your application server. The alfresco.mmt.dir is the location of the alfresco-mmt.jarfile where the Alfresco Module Management Tool is contained. Finally thealfresco.war.path is the location of your Alfresco Share war file in your application server. The alfresco.mmt.dir and alfresco.war.path properties are only necessary for deploying the project as an AMP file. The project is set up to extend Alfresco core files rather than overwriting them. This is considered a best practice as you should not overwrite Alfresco core files without a good reason to do so. The /bin and /build directories are used as working directories for building the project and should not be changed or used when developing Share customizations. The majority of customizations will go in the /configand /web directories.

The "web" Directory

The /web directory is where any files that need to be accessed from the browser reside such as client side JavaScript, CSS, and image files.

The "config" Directory

The /config directory is where your customizations will go along with any Alfresco core files that will be overridden. The contents of this directory will be deployed to the /share/WEB-INF/classes/alfresco directory in your application server. Share extensions go in the/share/WEB-INF/classes/alfresco/web-extension directory which will override any files of the same name and path in the /share/WEB-INF/classes/alfresco directory.

The "web-extension" Directory

In the /config/web-extension directory there are many different sub-directories which I will explain now. The /config/web-extension/messages directory is where properties files go for internationalization and localization of your customizations. The /config/web-extension/site-data directory is where Spring Surf files, such as pages, templates-intances, and components, will go. The /config/web-extension/site-webscripts directory is where any webscripts you develop will go, which includes any webscripts backing a custom component. The /config/web-extension/templates directory is where Spring Surf templates files go, I'm not sure why they don't go in the /config/web-extension/site-data directory but they don't.

Wrap Up

I won't dive into any more detail here since the sample project contains README.txt files in each directory to give more explanation on the types of files that belong there. The only other note is that both the /config/web-extension/templates and /config/web-extension/site-webscripts directories are normally built out in standard Java packaging naming conventions. If you are overriding an Alfresco core file you would use org.alfresco.* in addition to your own packaging directory structure. The build file in this project is loosely based on the Antbuild.xml found in the Alfresco Developer Guide written by Jeff Potts of Metaversant.

Here is a link to the sample Alfresco Share Customization Eclipse project.

Update: I have revised the Alfresco Share Customization Eclipse project. The link to version 1 is still active although it is recommended that you use version 2. Changelog.



Loading Conversation