How to create Liferay Plugin Portlets


1. How to Create plugin portlet by own

Navigate to your portlets directory inside your pluginsSDK

Eg.

/home/kanakarajr/liferaypluginsSDK5.2.1/portlets

use ./create.sh “portletname” “portletdisplayname”

Eg.

/home/kanakarajr/liferaypluginsSDK5.2.1/portlets> ./create.sh “MyPluginPortletTest” “My Liferay Plugin Portlet Test Work”

Now you have created files necessary to create plugin portlet.

2. How to import portlet directory in your Eclipse IDE

Navigate to your pluginportlet directory .. just created

/home/kanakarajr/liferaypluginsSDK5.2.1/portlets/MyPluginPortletTest> ant setup-eclipse

This will create eclipse project files

Import this into your workspace as project.

Using File-> Import -> Existing Projects Into WorkSpace -> Browse your directory -> Finish

3.How to deploy these portlets

3.1 Create build file

Inside your pluginsSDK modify build.properties by making copy of build.properties, rename the file to build.user.properties.

Eg. build.kanakarajr.properties

location: /home/kanakarajr/liferaypluginsSDK5.2.1/

3.2 Configure server location in build.user.properties

Specify liferay tomcat location

Eg.

app.server.dir=/home/kanakarajr/software/liferay/tomcat

3.3 Specify Auto Deploy directory for your plugin portlets

Eg.

auto.deploy.dir=/home/kanakarajr/works/liferayautodeploy

3.4 How to build portlets

Navigate to your pluginportlet directory and use “ant deploy” to build portlets

Eg.

/home/kanakarajr/liferaypluginsSDK5.2.1/portlets/MyPluginPortletTest> ant deploy

finally you will get message like this ..

12:16:45,642 INFO  [PortletHotDeployListener:351] 1 portlet1 for MyPluginPortletTest-5.2.0.1 are available for use

Now you know how to build liferay plugin portlets and how to use it in EclipseIDE and finally how to deploy the developed portlets into liferay

-live

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s