presenter name facility name rob allan portal tutorial 2 nd generation portals second-generation...
TRANSCRIPT
Presenter Name
Facility NameRob Allan
Portal Tutorial
2nd Generation Portals
Second-generation Grid portals are being developed to overcome the limitations of first generation portals, portlets have been introduced and promoted for use in building second-generation Grid portals. Currently, portlets are receiving increasing attention from both the Grid community and industry.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlets
From a user's perspective, a portlet is a window in a portal that provides a specific service, for example, a calendar or news feed. From an application development perspective, a portlet is a software component written in Java, managed by a portlet container, which handles user requests and generates dynamic contents. Portlets, as pluggable user interface components, can pass information to a presentation layer of a portal system. The content generated by a portlet is also called a fragment. A fragment is a chunk of markup language (e.g., HTML, XHTML) adhering to certain rules and can be aggregated with other fragments to form a complete document. The content of a portlet is normally aggregated with the content of other portlets to form the portal page. A portlet container manages the lifecycle of portlets in a portal.
Presenter Name
Facility NameRob Allan
Portal Tutorial
What is a Portlet (in a nutshell)?
• A Java technology based Web component, managed by a Portlet container, that processes requests and generates dynamic content;
• Used by Portals as pluggable user interface components that provide a presentation layer;
• The content generated by a Portlet is also called a fragment– A piece of markup (e.g., HTML, XHTML, WML) adhering to
certain rules and can be aggregated with other fragments to form a complete document
• The content of a Portlet is normally aggregated with the content of other portlets to form the Portal page;
• The lifecycle of a Portlet is managed by the Portlet container;• Integration component between applications and Portals that
enables delivery of an application through a Portal;• Eliminates vendor specific Portlet API;• Applications can be delivered through any Portal almost
immediately.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Client-Portlet Interaction
• Web clients interact with Portlets via a request/ response paradigm implemented by the Portal;
• Normally, users interact with content produced by Portlets– example by following links or submitting forms– resulting in Portlet actions being received by the Portal,
which are forwarded by it to the Portlets targeted by the user's interactions
• The content generated by a Portlet may vary from one user to another depending on the user configuration for the Portlet;
• Portlet contains an implementation of Model-View-Control (MVC) pattern.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlet MVC Pattern
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlets vs. Servlets
Portlets are a specialized and more advanced form of Java Servlets. They run in a portlet container inside of a Servlet container, which is a layer that runs on top of an application server. Like Java Servlets, portlets process HTTP requests and produce HTML output, e.g. with JSP. But their HTML output is only a small part of a Web page. The portal server fills in the rest of the page with headers, footers, menus, and other portlets.
Compared with Java servlets, portlets are administered in a dynamic and flexible way. The following updates can be applied without having to stop and restart the portal server.
• A portlet application, consisting of several portlets, can be installed and removed using the portal’s administrative user interface;
• An administrator with the appropriate access rights can change the settings of a portlet;
• Portlets can be created and deleted dynamically.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlets differ from Servlets
• Portlets can not:– send redirects– send errors to browsers directly– forward requests– write arbitrary markup to the output stream to assure that
they don’t distract the Portal Web application which uses them
• Portlets rely on Portal specific infrastructure functions:– access to user profile information
• Portlets are administrated more dynamically than Servlets
Presenter Name
Facility NameRob Allan
Portal Tutorial
Advantages
Portlets also have many standard features that are not available to Java servlets. One key feature is the built-in support to automatically use different JSP interfaces with different user devices. This allows users to write portlets that work on many devices, such as desktop computers with modern Web browsers, or palmtop computers with limited Web browsers, or alternatively Personal Digital Assistants (PDAs), or Web-enabled wireless phones. Users do not need to provide portability via the lowest common denominator. By reusing the same underlying business logic, the portal server will choose the most appropriate rendering for each client. Users can even have multiple portlet controllers, which allows different page/ action sequences to be used for each device type.
Presenter Name
Facility NameRob Allan
Portal Tutorial
JSR-168 Portlet Specification
• Developed as part of the Java Community Process• Released August 2003• Specification: http://www.jcp.org/en/jsr/detail?id=168• Enables interoperability among Portlets and Portals• Defines a set of APIs for Portlets• Addresses standardization for
– Preferences– User information– Portlet requests and responses– Deployment packaging– Security
Presenter Name
Facility NameRob Allan
Portal Tutorial
What is the Portlet Specification?
Defines:
• Portlet Container and Porlet Life cycle management• Definition of window states and Portlet modes• Portlet preferences management• User information• Packaging and deployment• Security• JSP tags to aid Portlet development
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlet Life Cycle
The basic lifecycle of a portlet includes the following three parts:• Initialisation, using the init class to initialise a portlet and put
it into service. • Request Handling, processing different kinds of actions and
rendering content for different clients.• Termination, using the destroy class to remove a portlet from
a portal page.The portlet receives requests based on the user interaction with
the portlet or portal page. The request processing is divided into two phases:
• Action processing: If a user clicks on a link in a portlet, an action is triggered. The action processing must be finished before any rendering of the portlets on the page is started. In the action phase, the portlet can change the state of the portal.
• Rendering content: In the rendering phase, the portlet produces its markup content to be sent back to the client. Rendering should not change any state of the portlet. It refreshes a page without modifying the portlet state. Rendering multiple portlets on a page can be performed in parallel.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlet Events
The typical sequence of events to access a Web page via portlets is given below.
1. A client (e.g., a Web browser) after being authenticated makes an HTTP request to a portal.
2. The portal receives the request. 3. The portal determines if the request contains an action
targeted to any of the portlets associated with the portal page. 4. If there is an action targeted to a portlet, the portal requests
the portlet container to invoke the portlet to process the action. 5. A portal invokes portlets, through the portlet container, to
obtain content fragments that can be included in the resulting portal page.
6. The portal aggregates the output of the portlets in the portal page and sends the portal page back to the client.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Life Cycle Methods
init()– Called when the Portlet is instantiated by the container– Intended to contain logic that prepares the Portlet to serve
requestsdestroy()
– Called when the container destroys the Portlet– to contain logic that cleans up when Portlet is no longer
needed or the server shuts downprocessAction()
– Called after the user submits changes to a Portlet– to process input from a user action
render()– Called whenever the Portlet is redrawn by the desktop
Presenter Name
Facility NameRob Allan
Portal Tutorial
The Portlet Container
A portlet container provides a runtime environment in which portlets are instantiated, executed, and finally destroyed. Portlets rely on the overall portal infrastructure to access user profile information, participate in window and action events, and communicate with other portlets, access remote content, lookup credentials, and store persistent data. A portlet container manages and provides persistent storage mechanisms for portlets.
A portlet container is not a stand-alone container like a Java Servlet container; instead, it is implemented as a layer on top of the Java Servlet container and reuses the functionality provided by the Servlet container.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Architecture Picture
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlet Container Architecture
Presenter Name
Facility NameRob Allan
Portal Tutorial
Portlet Deployment
Presenter Name
Facility NameRob Allan
Portal Tutorial
WSRP
Web Services for Remote Portals (WSRP) defines a standard for interactive, user-facing Web services that plug and play with portals.
• WSRP is designed to allow developers to write programs in several languages, including Java, C# and .Net maybe C, Python and Perl in future
• JSR-168 Portlets run on the same server as the Web Portal, whereas WSRP Portlets would run on a different server than the Web Portal
• Fragile Portlet could damage an entire Portal server and because they claim to get better scalability with WSRP
• Java aficionados believe the opposite and claim that JSR 168 allows for greater scalability
References• WSRP Specification
http://www.oasis-open.org/committees/wsrp• Open Source implementation of WSRP is called OASIS
http://www.oasis-open.org/
Presenter Name
Facility NameRob Allan
Portal Tutorial
Potted History
Apache JetSpeed Portal
WebServices
Web Service User Interface
JCP - Java Portlet APIJSR 168
OASIS TCWeb Service for Remote Portals
1999 2000 2001 2002 2003Very rough timeline…
OASIS TCWeb Service for Interactive Applications
OASIS TCWSIA Family
WSRP as the initial spec.
uPortal WebService channel
Presenter Name
Facility NameRob Allan
Portal Tutorial
Overview
• WSRP defines:– A WSDL interface description for invocation of WSRP services– How to Publish, Find, Bind WSRP services and metadata– Markup Fragment Rules for markup emitted by WSRP services– Applicable Security Mechanisms, Billing information ?, ...
• Companies involved in WSRP:– Bea, Bowstreet, Divine, Epicentric, Factiva, France Telecom,
Fujitsu, HP, IBM, Interwoven, Lexis-Nexis, Lotus, Moravia IT, Netegrity, Oracle, Peoplesoft, Plumtree, Silverstream, Stellent, SUN, Sybase, Tibco, WebCollage, SAP Portals, SeeBeyond
• Committee Draft – went to OASIS vote July 2003– BEA, IBM, Oracle, Plumtree, SAP, Vignette
Presenter Name
Facility NameRob Allan
Portal Tutorial
WSRP and Portlet API(s)
Web Services for Remote Portals (WSRP)
Java Portlet API (JSR 168)
C# „Portlet API“
(.NET). . .
Platform Independent Web ServiceInterface
Platform specific, local Portlet APIs
Portlet APIs may be defined for different programming languages; WSRP can bridge between the different platforms, leveraging platform independence of Web services
Goal:Portlets written to Portlet API can be published as WSRP servicesWSRP services can be integrated through Portlet Proxies written to Portlet API
WSRP Impl. onplain J2EE or .NET
platform
Presenter Name
Facility NameRob Allan
Portal Tutorial
WSRP Services Plug&Play with Portals
PortalsWSRPServicesPortalsPortals
PortalsPortalsClientsClients
WebClientsWeb
ClientsWeb
ClientsWeb
ClientsWeb
ClientsWeb
ClientsWeb
ClientsWeb
ClientsWeb
ClientsWeb
Clients
PortalsPortals
Registry
PortalsPortalsPortals
PublishFind
WSRPServicesPortalsPortals
Bind
WSRPServices
e.g.
Presenter Name
Facility NameRob Allan
Portal Tutorial
WSRP and related Standards
WSRP
SOAP(Invocation)
WSDL(Description)
UDDI(Publish,Find&Bind)
WSIAWSRP/WSIA
Common Base
(X)HTML WMLVoiceXML
cHTML ...
Presenter Name
Facility NameRob Allan
Portal Tutorial
Local and Remote Portlets
JetS
peed
AP
IuP
ort
al A
PI
JSR
16
8 e
tc.
Web
Ser
vice
Ser
ver
WebServiceClient
UDDI
SOAP
Publish via WSRP
Access remote portlet via WSRP
Other portals and VRE clients
Presenter Name
Facility NameRob Allan
Portal Tutorial
Simple WSRP Service – View only
Presenter Name
Facility NameRob Allan
Portal Tutorial
Interactive WSRP Service with transient conversational State
• API– getMarkup– performInteraction/performBlockingInteraction– releaseSessions– initCookies
Presenter Name
Facility NameRob Allan
Portal Tutorial
Interactive WSRP Service with persistent Entity
• API– clonePortlets– getMarkup– performInteraction/performBlockingInteraction– initCookies– releaseSessions– destroyPortlets
Presenter Name
Facility NameRob Allan
Portal Tutorial
Persistent Entity and Session State
Presenter Name
Facility NameRob Allan
Portal Tutorial
Other API
• Portlet Entity Properties– getPortletPropertyDescription– getPortletProperties– setPortletProperties
• cf OGSI ServiceData
• Non anonymous consumers (e.g. authentication)– register– deregister– modifyRegistration
• Metadata (e.g. requires ssl, uses cookies etc)– getPortletEntityDescription– getServiceDescription
Presenter Name
Facility NameRob Allan
Portal Tutorial
Overview of WSRP
Allocate new Instance
Destroy instance
Perform Portlet Action
Destroy Portlet Instance
Create Portlet Instance
WSRP Consumer(Portal)
WSRP Producer(Service)Adds
Portlet
RemovesPortlet
ClicksAction
Get Portlet MarkupI S
S
User
ViewsPortlet
Generate Markup,(opt: create Session)
Action Handling(opt: create Session)
I
I
A
I A
I
I A
I
I S
I I
AS
I A
Presenter Name
Facility NameRob Allan
Portal Tutorial
Full WSRP API Overview
• Markup– getMarkup– performBlockingInteraction– releaseSessions– initCookies
• Registration– register– deregister– modifyRegistration
• ServiceDescription– getServiceDescription
• Portlet Management– getPortletDescription– clonePortlet– destroyPortlets– getPortletPropertyDescription– getPortletProperties– setPortletProperties
Presenter Name
Facility NameRob Allan
Portal Tutorial
JSR-168 and WSRP
• JSR-168 aligns closely with the WSRP
• Both standards, which emerged at the same time, released open source implementations capable of all necessary functions described in the respective specifications
• Both standards strive to work well together– The Portlet container can run WSRP Portlets as a consumer
as well as a producer– A Portal must be able to run multiple Portlet containers in
one Portal– A Portlet container can be instantiated multiple times and,
more importantly, it can be instrumented in different ways– Each Portlet container, therefore, can use different
implementations for SPIs
Presenter Name
Facility NameRob Allan
Portal Tutorial
WSRP and JSR-168
Although they are being governed by different standards bodies and review processes, WSRP and JSR-168 are complementary specifications. While JSR 168 defines a standard Portlet API that is specific to Java-based portals, WSRP defines a universal API that allows portals of any type to consume portlets of any type. They can be used together in the following two ways:
• Portlets written with the Java Portlet API may be wrapped as WSRP services and published in UDDI directories.
• WSRP services can be exposed as portlets with the Java Portlet API to aggregate them in portals.
Whereas JSR-168 defines a set of Java APIs that allows portlets to run on any compliant portals, WSRP allows Web services to be exposed as portlets in a plug-and-play fashion.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Distributed Portlets
Presenter Name
Facility NameRob Allan
Portal Tutorial
GridSphere
GridSphere is an open source research project from the EU GridLab project. It provides a portlet implementation framework based upon the IBM Portlet API and an infrastructure for supporting the development of re-usable portlet services. GridSphere allows developers to create and package third-party portlet-based Web applications that can be executed and administered within the GridSphere portlet container.
GridSphere includes a set of core portlets and services that provide the basic infrastructure needed for developing and administering Web portals. A key feature of GridSphere is that it builds upon the Web Application Repository (WAR) deployment model to support third-party portlets. In this way, developers can distribute and share their work with other projects that use GridSphere to support their portal development.
The current GridSphere release provides a portal, a portlet container, and a core set of portlets including user and group management, as well as layout customization and subscription.
Presenter Name
Facility NameRob Allan
Portal Tutorial
Extending the Model