This JSR development tutorial shows how to master request-response programming using the PortletRequest and PortletResponse objects of the Portlet JSR (Portlet ) defines a lifecycle for events, so that eventing is name as defined in the previous code example in the portlet section of the file. Portlet Tutorial, Java Portlet, Portlet Example, Java Portlet Tutorial, What is Portlet , JSR has introduced the using of annotations for controlling things were.

Author: Dazil Zulujin
Country: Kazakhstan
Language: English (Spanish)
Genre: Environment
Published (Last): 21 March 2010
Pages: 81
PDF File Size: 11.11 Mb
ePub File Size: 8.95 Mb
ISBN: 835-5-25185-662-5
Downloads: 32985
Price: Free* [*Free Regsitration Required]
Uploader: Gardalmaran

For example, a page in a community site could have a calendar portlet for community events, an announcements portlet for important announcements, and a bookmarks portlet for links of interest to the community. Liferay Portal also contains an OSGi runtime.

Omit this tag if the portlet does not use this feature. For example, a filter can transform the content of portlet requests and portlet responses. InJava Portlet Specification 1. Another difference is that portlets run only in a portal server, like the one in Liferay Portal. It must contain the following information:. It is recommended to extend GenericPortlet for most cases. This is a mandatory parameter to define what’s the default page to display.

The code to be executed during an action has to be implemented in the processAction method of the portlet. All portlets must implement the javax. This software allows developers to write a portlet application as if it was a JSF application.

You can set up the run time environment for debugging portlets on the local development machine or on a remote server. Adding more features to the previous example. This parameter defines which page to display on the ‘help’ mode.


Portlets can be placed on pages by users or portal administrators, who can place several different portlets on a single page. If you are not using wizards to develop portlets, the following topics describe the mechanics of building portlte simple portlet. This avoids having one XML tag within another. If defined it should redirect to the hello. Portlets handle requests in multiple phases. Maven This example is using Maven to compile and build the web archive.

We simply pass the parameter to the render phase: The third method mixes form submission and action request. If you are familiar with the web. Again, a temporary tktorial is used to put the created URL into. You can place multiple portlets on a single page.

Application Monitoring Filter supports four lifecycle phases as the order below: I thought Liferay Portal was standards-compliant? The portlet information directory is not part porrtlet the public document tree of the application.

For porflet, you can develop your portlet with strictly standards-compliant frameworks and APIs, package it in a WAR file, and then deploy it on any standards-compliant portal container. This sample is used in the following examples. This makes portlets much more flexible than servlets. A portal can portket considered as a series of web pages with different areas within them.

Creating a simple portlet

These descriptors are defined by the Jave EE web. GenericPortlet This is the mandatory descriptor files for portlets. The portlet API portlwt a convenient implementation of this interface. For example, the Edit mode of a weather portlet could let you choose a location to retrieve weather data from. Each portlet phase executes different operations: Each portlet phase executes different operations:.


Creating a simple portlet

On a portal server running on Windows, installing a WAR file with a name that is more than 25 characters will result in an error. A parameter is also added directly to the URL. This entry attempts to obtain the value of the render parameter named yourname. The portlet can be on a page that contains other portlets. The portlet is provided along with the source in the IBM Portlet Tutoriao package, which is available from the portlet catalog by searching for navcode 1WPZ.

The path to the global portlet.

Portlet interface uses the javax. In the response, thtorial portlet returns content e. Compile your Java source files. Portlet window states control the amount of space a portlet takes up on a page. Minimized A portlet may show very little information, or none at all.

This makes it easier to support the standard portlet modes.

Portlets – Liferay – Liferay Developer Network

The Global metadata is declared in the portlet. If you suspect a classloading problem, ensure that the required classes are in the appropriate classpath according to the classloading hierarchy.

The resources can be images, JSP files, Writing the portlet descriptorsand property files containing translated message text. The generic portlet that is inherited dispatches the tutkrial views to the methods:

Back to top