14 Apr

Your Alfresco custom theme deployed as AMP or ZIP file

Alfresco ShareIn the various posts of this personal blog, the development of a custom theme of the Alfresco Share front end, is one of the most relevant and accessed. In a past tutorial, I share a simple way to develop your own theme for the Alfresco v4.2.c distribution.

In this post I would like to reach them same goal, but with an important improvement: the release of the theme in an AMP file or a ZIP file. All using an automatic solution based on a Java project managed by Eclipse IDE and Apache ANT.

Prerequisites

To understand how this solution works, you should have confidence with Eclipse IDE, Java projects, Git, Apache ANT and of course Alfresco (in particular with the AMP format). If you don’t have confidence with all of those things, this use case could be a way to improve your skills but, please, refer to the official documentations to learn how to use them before trying to test the content of this post.

Alle the source code described in this post has been tested in a Ubuntu 12.04 LTS operating system with Alfresco Community Edition v4.2.f on board, installed as bundle distribution. All the content should be valid for all the Alfresco distributions of the v4.2 family, both Community and Enterprise.

The git project my-first-alfresco-theme (on GitHub)

githubIn the repository below, you will find a Git repository called ‘my-first-alfresco-theme’, developing a copy of the ‘Green theme’ contained in the Alfresco vanilla installation. The developed theme is called ‘Alfresco themes – My first theme’.

The first task to do is to import the project from the repository, using Eclipse IDE at the link below:

https://github.com/fcorti/my-first-alfresco-theme.git

If you are not confident on how to import a project from Git, please refer to the web with a huge amount of tutorials or documentations. 😉

Once the project has been imported with success in your Eclipse IDE, in the ‘build’ folder you will find the two packages containing the theme: one in AMP format (‘alfrescoThemes_myFirstTheme.amp’) and one in ZIP format (‘alfrescoThemes_myFirstTheme.zip’).

If you want to re-build the packages after customizations, the build file (‘build.xml’) into the ANT view, is what you need for that purpose. If you are not confident on how to build a project with Apache ANT, please refer to the web with a huge amount of tutorials or documentations. 😉

How to deploy the theme in AMP format

The deployment using the AMP format should be preferred to the ZIP format. Below the step by step description of the task.

  • Open a terminal and go to the folder where Alfresco is installed (for example ‘/opt/alfresco-4.2.f’ on a linux platform).
  • Stop Alfresco (for example ‘./alfresco.sh stop’ on a linux platform).
  • Copy the AMP file from the ‘build’ folder of the project in the ‘amps-share’ folder (if you use an Alfresco bundle installation).
  • Go to the ‘bin’ subfolder and run ‘apply_amps’ script.
  • Go back to the Alfresco installation folder and start Alfresco again (for example ‘./alfresco.sh start’ on a linux platform).
  • Once Alfresco is started, open a browser with Alfresco Share, login as administrator and access to ‘Admin tools’ item in the menu.
  • In ‘Applications’, change the theme to your custom theme.

alfrescoCustomTheme1_en

That’s all!

How to deploy the theme in ZIP format

The deployment using the AMP format should be preferred to the ZIP format. Below the step by step description of the task.

  • Open a terminal and go to the folder where Alfresco is installed (for example ‘/opt/alfresco-4.2.f’ on a linux platform).
  • Stop Alfresco (for example ‘./alfresco.sh stop’ on a linux platform).
  • Unzip the ZIP file from the ‘build’ folder, directly in the Alfresco installation folder (you can merge the folders/subfolders/files to correctly install the theme).
  • Start Alfresco again (for example ‘./alfresco.sh start’ on a linux platform).
  • Once Alfresco is started, open a browser with Alfresco Share, login as administrator and access to ‘Admin tools’ item in the menu.
  • In ‘Applications’, change the theme to your custom theme, exactly in the same way is described in the picture before.

That’s all!

2 thoughts on “Your Alfresco custom theme deployed as AMP or ZIP file

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.