Tuesday, January 8, 2013

Working with Liferay EXT Plugin

Since Liferay 6.0 extension environment was moved to plugins, it transformed the way core functionalities can be overridden, but there are some best practices which justifies why ext development was moved to plugins.

The major reason why ext was moved to plugins was that in earlier versions of Liferay code had to be placed on the server to deploy ext, which was a major concern from potential customers. So if the customer uses Liferay 6.x version then best practice is NEVER keep source code on servers.

So one should use SSH for Linux servers or RDC for Windows Server to deploy the war files on the server.

As we all know that ext-plugin is still not 100% hot deployable and just because of this reason developers tend to use ant direct-deploy command to deploy ext on the servers. One more reason this command is used more frequently is that people find un-deploying ext-plugin difficult.

So following are some steps which will help in un-deploying the ext-plugin from the server:
Assuming the name of ext-plugin is "sample-ext"

1. Shut down server
2. Delete the folder sample-ext from "webapps" folder
3. Navigate to /webapps/ROOT/WEB-INF folder and delete the following files only:
a. liferay-display-ext.xml
b. liferay-portlet-ext.xml
c. portlet-ext.xml
d. tiles-defs.xml
e. ext-sample-ext.xml
4. Navigate to following location to delete only those jar files mentioned below:
a. ext-sample-ext-impl.jar
b. ext-sample-ext-util-bridges.jar
c. ext-sample-ext-util-java.jar
d. ext-sample-ext-util-taglib.jar
5. Navigate to following location to delete only the ext-sample-ext-service.jar file
6. Restart the server

By following the steps mentioned the ext changes are reverted back to original state once the server restarts and new version of ext can be re-deployed.

Note:
1. Avoid creating multiple ext-plugin in the same project to facilitate code manageability.
2. Using EXT Plugin should be avoided till its utmost necessary to modify any core features of Liferay.

No comments:

Post a Comment