Creating an Ext plugin
Ext plugins are stored within the ext directory of the Plugins SDK. Navigate to this directory in a terminal and enter the following command to create a new Ext plugin (Linux and Mac OS X):
./create.sh example "Example"
On Windows enter the following instead:
create.bat example "Example"
You should get a BUILD SUCCESSFUL message from Ant, and there will now be a new folder inside of the ext folder in your Plugins SDK. Notice that the Plugins SDK automatically appends "-ext" to the project name when creating this folder.
Once the target has been executed successfully you will find a new folder called example-ext with the following structure:
The most significant directories in this structure are the ones inside the docroot/WEB-INF directory. In particular you should be familiar with the following directories:
ext-impl/src: Contains the portal-ext.properties configuration file, custom implementation classes, and in advanced scenarios, classes that override core classes within portal-impl.jar.
ext-lib/global: Place here any libraries that should be copied to the global classloader of the application server upon deployment of the ext plugin.
ext-lib/portal: Place here any libraries that should be copied inside Liferay's main application. Usually these libraries are needed because they are invoked from the classes added within ext-impl/src.
ext-service/src: Place here any classes that should be available to other plugins. When using Service Builder, it will put the interfaces of each service here. Also in advanced scenarios, this directory will contain classes that overwrite the classes of portal-service.jar.
ext-web/docroot: Contains configuration files for the web application, including WEB-INF/struts-config-ext.xml which will allow customizing Liferay's own core struts actions. You can also place any JSPs needed by your customizations here.
Other: ext-util-bridges, ext-util-java and ext-util-taglib are only needed in advanced scenarios in which you need to customize the classes of three libraries provided with Liferay: util-bridges.jar, util-java.jar and util-taglib.jar respectively. In most scenarios you can just ignore these directories.
By default, several files are added to the plugin. Here are the most significant ones:
Tip: after creating an Ext plugin, remove all of the files added by default that are not necessary for the extension. This is important because Liferay keeps track of the files deployed by each Ext plugin and it won't allow deploying two Ext plugins if they override the same file to avoid collisions. By removing any files not really necessary from an ext plugin it will be easier to use along with other Ext plugins.