concept portlet preference in category java

appears as: portlet preferences, portlet preferences, portlet preference
Portlets in Action

This is an excerpt from Manning's book Portlets in Action.

All portal servers (such as GateIn Portal, Liferay Portal, and WebSphere Portal) come with their own internal database, which contains the initial configuration data required by the portal server, the portal user information, the portlet preferences, and a lot more. As you add users, portlets, portlet preferences, and web content to your portal, the information is saved in the portal’s database. By default, Liferay Portal comes with an embedded HSQLDB database, which is lightweight and has a small memory footprint. HSQLDB isn’t meant to be used in production and is ideally suited for development purposes only. If you’re planning to use HSQLDB for development purposes (where multiple developers need to access the same HSQLDB database instance), running the HSQLDB in server mode is recommended. For more information regarding HSQLDB, see the HSQLDB website (www.hsqldb.org).

10.7.3. Defining portlet preferences in portlet.xml

Earlier in this chapter, you saw how you can define preferences on the fly, in the portlet code itself. Portlet preferences are similar to any other configuration option in the portlet.xml file—defining portlet preferences in portlet.xml informs the portlet deployer about the preferences supported by the portlet and their initial values.

You can define portlet preferences in the portlet deployment descriptor using the <preference> subelement of the <portletpreferences> element. The following listing shows how the Book Catalog portlet defines the maxNumOfBooks and greeting-Message preferences in the portlet.xml file.

Listing 10.15. Portlet preferences defined in portlet.xml
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest