Presentation is loading. Please wait.

Presentation is loading. Please wait.

Portlets in uPortal Presenter Info: Ken Weiner 310.414.6760 x216 “Portlets in uPortal”

Similar presentations


Presentation on theme: "Portlets in uPortal Presenter Info: Ken Weiner 310.414.6760 x216 “Portlets in uPortal”"— Presentation transcript:

1 Portlets in uPortal Presenter Info: Ken Weiner kweiner@unicon.net 310.414.6760 x216 “Portlets in uPortal”

2 Portlets in uPortal Overview Portlet Specification Jakarta Pluto Portlets in uPortal 2.3 Portlets vs. Channels Portlet Development uPortal Portlet Roadmap

3 Portlets in uPortal Portlet Specification

4 Portlets in uPortal JSR 168: Portlet Specification Java Community Process http://www.jcp.org/en/jsr/detail?id=168 Led by Sun and IBM 1.0 Final Release Oct 27, 2003 Interoperability between Portlets/Portals Set of APIs addressing areas of aggregation, personalization, presentation and security.

5 Portlets in uPortal Future of Portlet Specification Portlet filters Inter-portlet event-style communication Portlets produce and influence markup outside of the portlet fragment

6 Portlets in uPortal Jakarta Pluto

7 Portlets in uPortal Apache Portals Project Pluto –Portlet Container –Reference implementation of JSR 168 WSRP4J –Reference implementation of Oasis WSRP Spec –Producer/consumer interfaces –Consumer Portlet proxy Jetspeed-2 –Enterprise portal –JSR-168 compliant http://portals.apache.org/

8 Portlets in uPortal Jakarta Pluto Status –Apache Incubator –Apache Portals Contents –Portlet API (JSR 168) –Portlet Container –Portal Driver –Test Suite Portlet http://portals.apache.org/pluto/

9 Portlets in uPortal Portlets Pluto Component Relationships Portlet API Portlet Container Portal javax.portlet org.apache.pluto.core.impl org.apache.pluto org.apache.pluto.om org.apache.pluto.services org.apache.pluto.portalImpl Pluto Portal Driver Portlet org.jasig.portal.container uPortal Implements Live in Use

10 Portlets in uPortal Pluto Object Model Servlet org.apache.pluto.om.servlet –Web application, servlet definition Portlet org.apache.pluto.om.portlet –Portlet application definition, portlet definition Entity org.apache.pluto.om.entity –Portlet application entity, portlet entity Window org.apache.pluto.om.window –Portlet window Common org.apache.pluto.om.common –Names, descriptions, preferences, etc.

11 Portlets in uPortal Pluto Services Information provider service –Static information provider Portlet definition registry –Dynamic information provider Portlet Modes, Portlet Window States, etc. Factory manager service –Obtains an implementation through a factory Log service –Defines a logging facility

12 Portlets in uPortal Portlets in uPortal 2.3

13 Portlets in uPortal Pluto Portlet Application Portlet Adapter uPortal Portlet Web Proxy Channel Portlet Adapter Channel Custom Channel Portlet Adapter Channel Portlet Application Portlet

14 Portlets in uPortal Portlet Adapter Java class name –org.jasig.portal.channels.portlet.CPortletAdapter IMultithreadedCharacterChannel –Produces character output rather than XML IMultithreadedPrivileged –Has access to HttpServletRequest and HttpServletResponse IMultithreadedCacheable –Utilizes uPortal content caching

15 Portlets in uPortal Portlet File Structure All resources are packaged into a web application archive (WAR) web.xml –Specifies web application resources portlet.xml –Specifies portlet resources

16 Portlets in uPortal Deploying Portlets Deployer tool org.jasig.portal.container.deploy.Deployer –Required for Pluto container –Rewrites web.xml Inserts servlet definitions which wrap portlets Ant target –Deploy one Portlet or all Portlets (in lib/portlets directory) ant deployPortletApp -DportletApp=C:/TEMP/myPortlet.war ant deployPortletApp –DportletApp=all

17 Portlets in uPortal Publishing Portlets: Getting Portlet GUID Identify Portlet Definition –Need to know the Portlet Definition GUID Portlet Preferences –Zero or more name-value pairs can be specified –Overrides Preferences specified in portlet.xml testsuite.war portlet.xml testsuite.TestPortlet1 TestPortlet1

18 Portlets in uPortal Publishing Portlets: Channel Type

19 Portlets in uPortal Publishing Portlets: Portlet Definition and Prefs Enter zero or more portlet preference name-value pairs. Enter Portlet Definition GUID

20 Portlets in uPortal Sample Portlets in uPortal: Test Suite Test Suite Portlet –Distributed with Pluto –Tests Render Request Render Response Portlet Session Portlet Context Portlet URL Portlet modes Portlet window states Resource loading Portlet actions Preferences persistence

21 Portlets in uPortal Sample Portlets in uPortal: RSS Portlet RSS Portlet –Available at POST –Written by Plumtree Software –Displays RSS content –User can choose content with drop-down –User can edit the list of RSS source URLs –Supports RSS 1.0 and 2.0

22 Portlets in uPortal Sample Portlets in uPortal: Google Portlet Google Portlet –Available at POST –Written by Plumtree Software –Allows search with Google Web APIs –Communicates with Google Web Service using SOAP –Requires license key configuration

23 Portlets in uPortal User Information Available as of uPortal 2.3.2 Map user info in Portlet Application’s portlet.xml User Given Name user.name.given Configure uPortal’s PersonDirs.xml FIRST_NAME user.name.given Add code to Portlet Map userInfo = (Map)request.getAttribute(PortletRequest.USER_INFO); String givenName = (String)userInfo.get("user.name.given"); String lastName = (String)userInfo.get("user.name.last");

24 Portlets in uPortal P3P User Information Attributes Platform for Privacy Preferences 1.0 W3C –http://www.w3c.org/TR/P3P Same attribute names used in WSRP Examples: –user.gender –user.name.given –user.home-info.postal.city –user.business-info.postal.name

25 Portlets in uPortal Portlet Modes Portal must support… –view Display current state of Portlet Mandatory for Portlet –edit Allows user to customize Portlet Optional for Portlet –help Provide help information about Portlet Optional for Portlet Declaration in portlet.xml text/html help

26 Portlets in uPortal Custom Portlet Modes Custom Portlet Mode examples –about –config –edit_defaults –preview Not implemented yet Declaration in portlet.xml config Admin functions

27 Portlets in uPortal Portlet Window States Portal must support… –normal Portlet may be sharing page with other Portlets Portlet should restrict size of rendered output –maximized Only Portlet being rendered on the portal page Portlet may generate richer content –minimized Portlet should render minimal out put or no output at all

28 Portlets in uPortal Custom Portlet Window States Custom Portlet Mode examples –detach –half-page Not implemented yet Declaration in portlet.xml half-page 1/2 a page

29 Portlets in uPortal Portlet Caching uPortal caches all Portlet content the same way A Portlet screen is cached until the Portlet needs to change state… –User clicks on a link or button within Portlet –User clicks on a button within the Portlet control bar, i.e. Edit, Help, About, etc. –Portlet is focused or unfocused, i.e. the Portlet alternates between being and not being the root of the layout –PortletEvent is sent to the Portlet Optional expiration caching mechanism not implemented. See PLT.18 of Portlet Spec.

30 Portlets in uPortal Servlet Container Requirements Servlet Specification 2.3 or higher Cross context capability –In Tomcat… Avoid Tomcat 5.0.19 –Tomcat Bug 27309 – NPE in ApplicationHttpRequest.java

31 Portlets in uPortal Portlets vs. Channels

32 Portlets in uPortal Channel Interfaces IChannel IMultithreadedChannel IPrivilegedChannel IMultithreadedPrivileged ICacheable IMultithreadedCacheable org.jasig.portal…

33 Portlets in uPortal IChannel Interface package org.jasig.portal; public interface IChannel { public void setStaticData (ChannelStaticData sd); public void setRuntimeData(ChannelRuntimeData rd); public void receiveEvent(PortalEvent ev); public ChannelRuntimeProperties getRuntimeProperties(); public void renderXML (DocumentHandler out); }

34 Portlets in uPortal Portlet Interface package javax.portlet; public interface Portlet { public void init(PortletConfig config); public void render (RenderRequest request, RenderResponse response); public void processAction (ActionRequest request, ActionResponse response); public void destroy(); }

35 Portlets in uPortal Channel Base Classes BaseChannel –Start by overriding renderXML() BaseMultithreadedChannel –Maintains an internal state table which can be unlocked with the unique ID. The state contains the channel static data, runtime data, and a HashMap (analogous to an HttpServletSession object) org.jasig.portal…

36 Portlets in uPortal Portlet Base Class GenericPortlet –Dispatches request according to the Portlet Mode –Override doView(), doEdit(), or doHelp() javax.portlet…

37 Portlets in uPortal Channel Base Action URLs Get base action URL from ChannelRuntimeData Pass as XSLT parameter to transformation xslt.setStylesheetParameter( “baseActionURL”, runtimeData.getBaseActionURL()); Append request parameter name/value pairs Go to page 1

38 Portlets in uPortal Portlet URLs Redner URLs –RenderResponse.createRenderURL() Action URLs –RenderResponse.createActionURL() Example PortletURL url = response.createActionURL(); url.setParameter(“n1”, “v1”); url.setParameter(“n2”, “v2”); url.setWindowState(WindowState.MAXIMIZED); writer.print(“ ”);

39 Portlets in uPortal uPortal CSS Classes

40 Portlets in uPortal OASIS WSRP CSS Classes Fonts portlet-font, portlet-font-dim Messages portlet-msg-status, portlet-msg-info, portlet-msg-error, etc. Sections portlet-section-header, portlet-section-body, portlet-section-alternate, etc. Tables portlet-table-header, portlet-table-body, portlet-table-selected, etc. Forms portlet-form-label, portlet-form-input-field, portlet-form-button, etc. Menus portlet-menu, portlet-menu-item, portlet-menu-caption, etc.

41 Portlets in uPortal OASIS WSRP CSS Style Example Favorite color Other color: BlueGreenRedPink Submit.portlet-form-label.portlet-form-field-label.portlet-form-button.portlet-form-input-field.portlet-form-field

42 Portlets in uPortal Channel File Uploading Form must contain enctype attribute: enctype="multipart/form-data" Input element: Channel access to file: MultipartDataSource fileSource = ((MultipartDataSource[]) runtimeData.getObjectParameterValues ("uploadfile"))[0]; MultipartDataSource methods InputStream getInputStream() returns the actual file stream to save to disk/rdbms String getContentType() returns the mime type of the file String getName() returns the uploaded file’s name

43 Portlets in uPortal Portlet File Uploading Form must contain enctype attribute: enctype="multipart/form-data" Input element: Portlet access to file request.getParameter("uploadfile");

44 Portlets in uPortal Channel File Downloading Acquire resource URL in channel and pass to stylesheet: runtimeData.getBaseWorkerURL (UPFileSpec.FILE_DOWNLOAD_WORKER, true) Use of resource URL in stylesheet: default Filename

45 Portlets in uPortal Channel File Downloading Channel must implement org.jasig.portal.IMimeResponse Portal’s download worker will call the following IMimeResponse methods in the following sequence: 1)Call the channel’s setRuntimeData() method. Channel can retrieve any parameters appended to the resource URL (ie: filename=NAME_OF_FILE) 2)Call the getHeaders() from IMimeResponse 3)Call the getContentType() from IMimeResponse 4)Call the getInputStream() from IMimeResponse

46 Portlets in uPortal Portlet File Downloading No general solution yet Might be able to use separate servlet Portlet and Servlet can communicate via an application-scoped session attribute

47 Portlets in uPortal Channel ARchives (CAR) Packaging and deployment of channel code and resources WEB-INF/cars directory .car files Car resource worker –org.jasig.portal.car.CarResourceWorker CAR file is a zip containing channel sources, stylesheets, and resources such as images

48 Portlets in uPortal Portlet WAR All resources are packaged into a web application archive (WAR) web.xml –Specifies web application resources portlet.xml –Specifies portlet resources

49 Portlets in uPortal Portlet Development

50 Portlets in uPortal Pluto Eclipse Plugin Facilitates writing and deployment of JSR 168 Portlets in Pluto Wizards Context menu actions 1.0.0 alpha 2 release October 25, 2003 http://sourceforge.net/ projects/plutoeclipse

51 Portlets in uPortal Spring PortletMVC Framework for Portlet Development –Analogous to Spring Web MVC Flexible with respect to view technology –JSP –JSTL –XML/XSLT etc. Introduced to Spring Framework by Rutgers University –Bill Thompson –Dmitriy Kopylenko (“Dima”) Currently in Spring CVS “sandbox” Release planned for September 2004 Spring 1.1

52 Portlets in uPortal Portlet Open Source Trading Site (POST) A Portlet “Clearinghouse” Founded Sept 2003 by Plumtree, Documentum, BEA, and Sun Sections for JSR 168 and WSRP portlets Not very popular yet –5 Portlets available –7 people on mailing list http://portlet-opensrc.sourceforge.net/

53 Portlets in uPortal uPortal 3.0

54 Portlets in uPortal uPortal 3.0 Framework uPortal 2.3 Pluto uPortal Portlet Roadmap uPortal 2.3 –Support Portlets (JSR 168) via Portlet adapter uPortal 3.0 –Portlets become native portal component –Support Channels via Channel adapter Portlet Pluto Portlet Adapter Chan Portlet Framework PortletChan Adapter Chan

55 Portlets in uPortal New in uPortal 2.3 JSR 168 Portlet support Implementation of Pluto Portlet Container Layout fragment manager Pulled layout fragments Enhanced content subscriber Person attributes groups store (PAGS) Multi-valued person attributes support Just-in-time XSLT localization

56 Portlets in uPortal uPortal 2.4 Complete WSRP implementation –Apache Portals WSRP4J New RSS Channel –Easily supports multiple RSS versions

57 Portlets in uPortal uPortal 3.0 Overview Terminology and paradigm change: Channels replaced by Portlets Componentization of framework Modular rendering pipeline Clean separation of business logic and persistence layer Full support for uPortal 2.x Channels Upgrade tools

58 Portlets in uPortal uPortal Domain Objects Portlet Application Deployment Portlet Deployment –Information from portlet.xml file Portlet Application Definition Portlet Definition –Deployment + Preferences Portlet Application Entity Portlet Entity –Definition + Preferences Portlet Window –Instances of Portlet Entity painted on screen –Carries Portlet Window State

59 Portlets in uPortal uPortal 3.0 Data Access Data Access Objects (DAO) Transfer Objects Spring JDBC

60 Portlets in uPortal uPortal 3.0 Registries Communicate with DAO layer Utilize caching services Utilize domain object factories

61 Portlets in uPortal uPortal 3.0 Domain Object Architecture Database DAO’s Registries DAO Implementations e.g. Spring JDBC Caching uPortal Framework Domain objects Transfer objects Domain Object Factories

62 Portlets in uPortal uPortal 3.0 Rendering Architecture Context X Context A … Context Resolver Default Context Parameter processing Rendering pipeline Layout generator Transformer … Filter Serializer Selects a context to process the incoming request Parses request URL and initiates actions on: Portlets Rendering pipeline elements Generates initial user layout Aggregated layouts Simple layouts Chain of transformers and filters compiles presentation markup.

63 Portlets in uPortal Useful URL’s JSR 168 –http://www.jcp.org/en/jsr/detail?id=168 Apache Portals –http://portals.apache.org/ Jakarta Pluto –http://portals.apache.org/pluto/ Portlets in uPortal –http://www.uportal.org/implementors/portlets/ workingWithPortlets.html Portlet Open Source Trading Site (POST) –http://portlet-opensrc.sourceforge.net/

64 Portlets in uPortal Speaker: Ken Weiner Presentation Title: Portlets in uPortal Date: 6/22/2004 Time: 10:15 AM – 11:15 AM Room: Westminster Ballroom II Speaker Evaluation Info: The End Questions ?


Download ppt "Portlets in uPortal Presenter Info: Ken Weiner 310.414.6760 x216 “Portlets in uPortal”"

Similar presentations


Ads by Google