Sunday, February 7, 2016

Liferay Custom Portlets Plugin Project

Environment:
Liferay 6.2
Liferay Tomcat 7

In this blog we will see how  to  create liferay  project of portlet plugin type,  and inside that project  how to create  liferay mvc portlet plugin. In one project  we can create ,more than one portlets plugin.

Creating liferay mvc portlet:

Step 1: In eclipse click on new liferay project from dropdown option as shown in below screen.


Step 2:  Give project name , in this example name is  “Sampleproject” and in build type select Ant(liferay plugin sdk)  as in this example we are using ant, after plugin type field there is one checkbox (include sample code) uncheck that field, if we check that field during project creation then one default portlet with project name will be created, as shown in below screen and click next

Step 3: Select liferay mvc , as shown in below screen, then click finish

Step 4: Now project  is created, below screen represents project folder structure.

Step 5: Now we will create portlet inside “Sampleproject”  project which we have created in above steps.
Right click on “Sampleproject” àNewàclick on  liferay portlet

Step 6: Give portlet Class/controller name, in this example class name is “Employeemanage” , java package is “com.test”, click next.

Step 7: Below screen represents portlet info like:  Name, Display name,Title, Portlet mode etc. Click next.

Step 8: Below screen represents Display category selected value, based on selected value after deployment portlet  will be available in that category, in this example selected value is Sample.
Click next.

Step 9 : Click Finish.

Step 10: Below screen represents  folder structure of created portlet    “Employeemanage”  inside “Sampleproject-portlet”  project.

Step 11:  Liferay project of portlet plugin type and inside that one liferay mvc custom portlet is created , now will see how to deploy this project.
Right click on project “Sampleproject-portlet”àliferayàsdkàdeploy 


Step 12: After deployment, go to your liferay  portal local url, in this example url is localhost:8080.If you are not logged in then logg in with your portal admin account, in this example admin account email :test@liferay.com  ,  pass: test
From left side menu click on add(+) .As shown in below screen.

Step 13:  In sample display category we can see that our created portlet  “Employeemanage”  is available, click on add link to add this portlet on portal page.

Step 14: In below screen we can see now our portlet  “Employeemanage” is added on portal page.



0 comments:

Post a Comment