The purpose of this tutorial is to show you how to create a module that contains a Java-backed web script, and show how you can lay out your project within Eclipse. The web script that will be used is the Folder Listing web script developed in this tutorial.
The web script used in this tutorial has a controller implemented in Java.
Creating the project in Eclipse is more convenient, as Eclipse can allow you to identify compile time errors quickly, as well as providing all the convenience of an IDE.
- Download and install the Alfresco SDK that matches the version of Alfresco you are running. You will need to link against libraries found in this distribution.
- Download and install the Spring Framework. You will need to link against libraries found in this distribution.
- Start Eclipse.
- Create a new Java Project in Eclipse. In this tutorial it is called FolderListingModule.
- In the Eclipse Package Explorer, create a new Source Folder called config.
- Create a new package in the config folder called alfresco.extension.templates.webscripts.com.alfresco.tutorials. This package will contain the web script description file and web script FreeMarker template file.
Create a new package in the config folder called
This package will contain the important
module-context.xml file and the
module.properties file. Attention: In this tutorial javadir is the module ID.
In Eclipse, in the src folder create a new package
This package will contain the Java web script controller class.
At this point the basic directory structure will be in place. You can use the following image as a guide (you will populate the directory structure with files in the following tasks):