Adding a Portlet to the Control Panel

Up to this point, you’ve created a fully-functional Guestbook portlet. You’ve written a service.xml file to define your application’s data model and used Service Builder to generate back-end code including model, service, and persistence layers. You’ve added custom service methods using the appropriate extension points: your entities’ *LocalServiceImpl classes. You’ve created a GuestbookPortlet class extending Liferay’s MVCPortlet class with action methods that call the corresponding service methods. And you’ve created a user interface using JSPs and Liferay’s tag libraries, including the AlloyUI tag library.

However, you’re missing some functionality. Although as an administrator, you can can use the Guestbook portlet to add new guestbooks, there’s no way to delete them. There’s also no way to update a guestbook’s name or to configure a guestbook’s permissions. In this learning path, you’ll add this functionality to a new portlet called the Guestbook Admin portlet which you’ll add to the Control Panel.


Figure 1: The Guestbook Admin portlet lives in Liferay’s Control Panel and allows administrators to add, edit, and delete guestbooks and to configure their permissions.

Creating an Admin Portlet

To create the Guestbook Admin portlet, you’ll use the New Liferay Portlet wizard. You used this wizard in an earlier learning path when you created the Guestbook portlet. The New Liferay Portlet...

Read More

Updating Your Service Layer

In an earlier learning path, you wrote an addGuestbook service method in GuestbookLocalServiceImpl. The addGuestbook method of GuestbookPortlet calls this service method. You can reuse the...

Read More

Defining Portlet Actions

You need to add action methods to the Guestbook Admin portlet for adding, updating, and deleting guestbooks. The portlet action methods call the corresponding service methods. Using Service Builder...

Read More

Creating a User Interface

It’s time to create the Guestbook Admin portlet’s user interface. The default view of the portlet should have a button for adding new guestbooks. It should also display a list of all the guestbooks...

Read More
0 (0 Votes)
Creating Action Buttons Previous