The Liferay Plugins SDK is a development environment that helps in the development of all types of plugins for Liferay including:
This development environment is based on the popular Apache Ant tool so that it can be integrated with all the popular IDEs or used directly from the command line.
The preparation can be done in a few minutes. Follow these steps:
The most common tasks can be performed executing ant tasks. Those tasks can be executed either from the root directory to apply to all the plugins, from the themes|portlets|layouttpl directories to apply only to the themes, portlets or layout templates, or within the directory of a single plugin to apply only to it.
Here are the most common tasks along with the associated ant target
ant compile
ant war
ant deploy
create newtheme "My New Theme"or, on Linux/Mac:
./create.sh newtheme "My New Theme"(Where newtheme is the name of the folder for your theme and "My New Theme" the display name)
If you want your theme to be developed from another existing theme, you can modify the file build.xml (inside the folder of the theme) and change the parent.theme attribute to the id of the theme you want it to be copied from (for example, classic) and then deploy again. Your modifications to the theme should go into the custom.css file in the _diffs folder. All the changes you make in other css files will be overwritten when you deploy the theme again.
create newportlet "My New Portlet"or, on Linux/Mac:
./create.sh newportlet "My New Portlet"(Where newportlet is the name of the folder for your portlet and "My New Portlet" the display name)
Liferay uses the Plugins SDK to develop the plugins that come with Liferay. This includes a lot of examples that you may want to use as a basis for your development. You can download them from Sourceforge and also browse and download the code in Liferay's Subversion repository
Put all the jar files found in the /lib directory of the new plugin to the build path and export it.
The SDK is ready to use.
The build.xml files work only in the other structure so we need to change them. Examples:
Theme plugin:
<?xml version="1.0"?>
<project name="theme" basedir="." default="deploy">
<property name="project.dir" value="../liferay-plugins-sdk" />
<import file="${project.dir}/themes/build-common-theme.xml" />
<property name="theme.parent" value="_styled" />
</project>
Layout plugin:
<?xml version="1.0"?>
<project name="layouttpl" basedir="." default="deploy">
<property name="plugin.version" value="1" />
<property name="project.dir" value="../liferay-plugins-sdk" />
<import file="${project.dir}/layouttpl/build-common-layouttpl.xml" />
</project>
Hooks:
<?xml version="1.0"?>
<project name="hook" basedir="." default="deploy">
<property name="project.dir" value="../liferay-plugins-sdk" />
<import file="${project.dir}/hooks/build-common-hook.xml" />
</project>
2 Attachments | Average (0 Votes) ![]() ![]() ![]() ![]() |