In this article I will be discussing a sample Eclipse project for making Alfresco Repository customizations. This sample project will be used in later articles discussing various ways to customize the Alfresco Repository, often in conjunction with customizations to Alfresco Share .
OverviewThere is an ant build file along with a build.properties.sample and build.properties file. You will need to adjust the file paths in the build.properties file to fit your development environment. You will need to download the SDK for your version of Alfresco. The
alfresco.sdk.remote.dirshould point to the /lib/remote directory in the SDK. The
alfresco.sdk.server.dirshould point to the /lib/server directory in the SDK. The
alfresco.web.dirshould point to your exploded Alfresco war file in your application server. Finally the
alfresco.war.pathis the location of your Alfresco war file in your application server. The
alfresco.war.pathproperty is 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 Alfresco repository customizations. The majority of customizations will go in the /config and /src directories.
The "src" DirectoryThe /src/java directory is where any java source files will go. This includes any Java backed webscripts and Java workflow source files. The /src/web directory is where files such as JSF, JSP, and image files will reside.
The "config" DirectoryThe /config directory is where many of your customizations will go along with any Alfresco core files that will be overridden. The contents of this directory will be deployed to the/alfresco/WEB-INF/classes/alfresco directory in your application server. Alfresco repository extensions go in the /alfresco/WEB-INF/classes/alfresco/extension directory which will override any files of the same name and path in the /alfresco/WEB-INF/classes/alfrescodirectory.
The "extension" DirectoryIn the /config/alfresco/extension directory there are many different sub-directories which I will explain now. The /config/alfresco/extension/messages directory is where properties files go for internationalization and localization of your customizations. The/config/alfresco/extension/model directory is where any custom content model files will go. The /config/alfresco/extension/templates directory is where any webscripts you develop will go.
Wrap UpI won't dive into any more detail here since the sample project contains
README.txtfiles in each directory to give more explanation on the types of files that belong there. The only other note is that both the /config/alfresco/extension/templates and /src/java 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 Ant
build.xmlfound in the Alfresco Developer Guide written by Jeff Potts of Metaversant.
Here is a link to the sample Alfresco Repository Customization Eclipse project.
Update: I have revised the Alfresco Repository Customization Eclipse project. The link to version 1 is still active although it is recommended that you use version 2. Changelog.