X hits on this document

PDF document

WebSphere Portal Server and - page 8 / 22

66 views

0 shares

0 downloads

0 comments

8 / 22

WebSphere Portal Server and Web Services

Portlets

Portlets are pluggable components runnung inside a portal’s portlet container, similar to servlets in many aspects. Portlets are written to a portlet API similar to the servlet API. However, portlets run in a portal environment, while servlets run stand-alone in a servlet container. While servlets communicate directly with their clients, portlets are invoked indirectly via the portal application. In order to properly run in the context of a portal, portlets must produce content that is suited for aggregation in larger pages, i.e. portlets should produce markup-fragments adhering to guidelines that assure that the content generated by many different portlets can be aggregated.

When the portal receives a servlet request, it generates and dispatches events for any portlet affected by parameters in the request and then invokes all portlets that have to be displayed trough the portlet invocation interface in a second step (see Figure 7).

Portlet Archive File

Servlet

Portlet

Request

Portal

Request

Servlet

Portlet

Response

Response

Portlet Invocation Interface

D

i s

p

a t

c h

e r

Portlet

XML Descriptor

Command

Model

Controller

View

e.g. JSPs, Stylesheets, ...

Content

or

Local Apps

or

Web Services

or

...

Standard Portlet Service Interfaces

Persistence

...

Location

Provider

Service

User Info Provider

LDAP

DB

Figure 7: The Portlet Concept

While portlets must implement the invocation methods required by the Portlet API, internally they may be implemented differently. A pattern that has proven very suitable for portlet programming is the Model-View-Controller pattern. It separates the portlet functionality into a controller receiving incoming requests, invoking commands operating on a model that encapsulates application data and logic and finally calling views for presentation of the results.

Portlets have access to portal related functions and data through Portlet Service Interfaces. These interfaces provide portlets with functions including access to user profile information, persistent per-portlet instance data, action handling, etc. Apart from portal specific functions, portlets can use all the J2EE services that are available to servlets as well as vendor-provided connectors to access back-end data and applications or even services in the Internet.

For easier deployment, portlets can be grouped in Portlet Applications packaged into Portlet Archive files containing a deployment descriptor, Java classes, jar files, and resources.

8

Document info
Document views66
Page views66
Page last viewedTue Jan 17 13:48:03 UTC 2017
Pages22
Paragraphs486
Words6216

Comments