Published using Google Docs
LIFERAY-TUTORIAL-Library-Portlet.docx
Updated automatically every 5 minutes

LIFERAY TUTORIAL

http://notarazi.blogspot.com


LIFERAY TUTORIAL – Library Records : Publisher and Book

1. Create New Project.
Name: library
Type:Portlet
Next

2. Choose Framework
Framework: Liferay MVC.

Create custom Portlet class: Tick

3.Create Portlet Class

Portlet class: PublisherPortlet
Java package: com.liferay.training.library.portlet
Superclass: com.liferay.util.bridges.mvc.MVCPortlet

4.Deployment Descriptor details,

Name: liferay-publisher

Display name: Liferay Publisher
Title: Liferay Publisher
Portlet Modes: View (yes) Edit (yes) Help(yes)

Resources: Create JSP files (yes)

JSP folder: /html/publisher

Create resource bundle file: yes

Next

5.Portlet Deployment descriptor details 2.
Category: category.training

6.Accept default and finish.

7.New portlet

8. Create New Liferay Portlet

Portlet class: BookPortlet
Java Package: com.liferay.training.portlet
superclass: com.liferay.util.bridges.mvc.MVCPortlet

9. Portlet deployment descriptor details.
Name: liferay-book
Display name: :iferay Book
Title: Liferay Book
Portlet Modes: view(yes) edit(yes) help(yes)
Resources: Create JSP files (yes)
JSP folder: /html/book

Create resource bundle file: yes
Next.

10.Portlet Deployment Descriptor details.
Category:category.training

Next.

11.Accept default and finish.

12. Create Liferay Service

13.Service details.

14. Edit Service.xml
Open Service.xml
Notice the default codes.


Edit as follows:
https://docs.google.com/document/pub?id=1_QEis_GX0KzMAsQJrrpbIp-95MPW78zu4ihZd66oeTM#h.2exf9zdfhzjj

Save.
15. Build Service.


16. Check in Console Window. New Java file generated.

17. Check  in Console Window. “BUILD SUCCESSFUL”.

18. [CTRL]+[SHIFT]+[t]
Search “PublisherLocalServiceImpl”

Open.


Copy: PublisherLocalServiceImpl.java

Copy: BookLocalServiceImpl.java

Build Service.

19. Edit Portlet.xml

Copy: portlet.xml 

20. Edit Web.xml

Copy: web.xml

21. Import Jar files

22. Edit liferay-plugin-package.properties

Copy: liferay-plugin-package.properties

23. Goto folder docroot/html/. Create init.jsp


Copy: init.jsp

24.Edit docroot/html/publisher/view.jsp

Copy: view.jsp

25. Add docroot/html/publisher/edit_publisher.jsp

Copy: edit_publisher.jsp

26. Edit docroot/html/publisher/edit.jsp

Copy: edit.jsp

27. Create docroot/html/publisher/publisher_actions.jsp

Copy: publisher_actions.jsp

28. Edit docroot/html/book/view.jsp

Copy: view.jsp

29. Create docroot/html/book/edit_books.jsp

Copy: edit_books.jsp

30. Create docroot/html/book/book_actions.jsp

Copy: book_actions.jsp

31. Import JAR file to docroot/WEB-INF/lib:

jstl-api.jar

Download

jstl-impl.jar

Download

32. Import JAR file to docroot/WEB-INF/tld:

c.tld

Download

THIS IS THE END OF LESSON 16

33. Add BookValidator.java to docroot/WEB-INF/src/com.liferay.training.library.portlet:

Copy: BookValidator.java

34. Add PublisherValidator.java to docroot/WEB-INF/src/com.liferay.training.library.portlet:

Copy: PublisherValidator.java

35. Add language.properties to docroot/WEB-INF/src/content:

Copy: language.properties

THIS IS THE END OF LESSON 17