Saturday 1 December 2012

Creating A Portlet Using Eclipse IDE And Deploying into Liferay Portal

1.For Step to Integration of Liferay Portal and SDK Plug in with Eclipse  Click Here.

2.After successfully  Integration of  Liferay portal with SDK Plug in with Eclipse.

3.Set for Liferay prospective, for this click on Window-->Open prospective-->Other--> liferay.

4.Than after this Start Liferay Server, by right clicking on sever-->start

5.Than Click on file-->new-->Liferay Project, Liferay Project creation wizard will open.
                                                  Fig-1. Liferay Project Creation Wizard

6.In the project creation window (Figure-1)Enter the Project name and select plug in type is Portlet. (and importantly check in configuration is pointed to SDK plugin and  Liferay portal).


7. after step 6 click on next, than will get next window as bellow, in that select portlet frame work as Liferay MVC in Select portlet framework and in additional option section checked the option of create custom portlet class. than click next.
                                                                      Figure-2

8.After clicking next, the next window as shown bellow will come,in that enter the name of portlet class, java package and select super class MVCPorlet or GenericPortlet class.(the difference between these two class is MVCPortlet class extends GenericPortlet class, Generic Portlet Class is Implements Portlet Interface). after this click next
                                                                          Fig-3

9.after step 8, will get next window show bellow, in that enter the portlet name,Display name, Title in portlet info section, you can select the portlet mode in portlet modes section and also you can select the Liferay modes also if you want in liferay portlet mode section, and in resource section checked the create jsp file and create resource bundle file,after that click next
Note: all the entry what you enter is available in portlet.xml
                                     
                                                                        Fig-4
10. after step-9, in the next window shown bellow, file the Liferay Portlet info and Liferay Display section,in Liferay display section you mention the category in which your portlet should display or you enter your category name also inside the text filed(drop down), in liferay portlet info section you can make your portlet as multiple instances in single page or single instance by checking or unchecking check box.
Note:1. Liferay Portlet info section entry what you enter is available in Liferay-portlet.xml
           2.Liferay Display section entry avilable in Liferay-display.xm


                                                                  Fig-5
11.after in the next window click on finish.

12. after in your project navigate to docroot-->html-->(folder name you enter in fig-4)-->view.jsp.
      in side view.jsp write helloword or if you want create a form.
      Note: if create form in view.jsp, write the process action method inside portlet class if your class extend MVCportlet class, or if your class extend Generic Portlet write logic in process action method.

13.after this do ant build and than log in to portal server and add your portlet to you portal page, by clicking on add-->more--->your category-->your portlet.

                                                                     Fig-6

No comments:

Post a Comment