Presentation is loading. Please wait.

Presentation is loading. Please wait.

INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 1 Develop and Deploy JSR-168 Portlets Presented by:

Similar presentations


Presentation on theme: "INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 1 Develop and Deploy JSR-168 Portlets Presented by:"— Presentation transcript:

1 INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 1 Develop and Deploy JSR-168 Portlets Presented by: Bob Mitchell, Indiana University Purdue University Fort Wayne April 14, 2008 Course ID 0542

2 2 Session Rules of Etiquette Please turn off or silence your cell phone/pager If you must leave the session early, please do so as discreetly as possible Please avoid side conversations during the session Thank you for your cooperation!

3 3 Course ID 0542 Agenda What and Why Developing Portlets Deploying Portlets in Luminis

4 INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 4 What and Why And maybe why not

5 5 Course ID 0542 What are Portlets Standard Java Technology for the component of a portal Same basic functionality as Channels Defined by the Java Community Process JSR-168 Next generation currently being defined in JSR-286

6 6 Course ID 0542 Portlets in Luminis New feature of Luminis IV Implementation Container framework is Pluto 1.0.1 (RC2) uPortal 2.5.3 portal side implementation (PortletChannel) Open Source Implementation

7 7 Course ID 0542 Why Use Portlets Standard Abstraction of Features Security uPortal/Luminis Evolution: Currently channels primary Future uPortal release will make Portlets primary Luminis moving towards standards

8 8 Course ID 0542 Why Not Use Portlets Lack of Documentation E.g. mapping between Portlet security and Luminis roles Lack of Tools No deployment tool in Luminis: supposed to be in IV.1 Lack of Integration Portlets are not part of uPortal/Luminis web application Difficult to interact with core uPortal/Luminis features This presentation will help with first two issues.

9 INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 9 Developing Portlets with Luminis/uPortal specifics

10 10 Course ID 0542 General Portlet Development Create Web Application /WEB-INF/server.xml required, but may be nearly empty Create Portlet Class Usually subclass of GenericPortlet Override at least doView To support edit and help modes override doEdit and doHelp If the portlet supports updates, override processAction For initialization and shutdown, override init and destroy Create Needed Resources JSP pages for actual rendering Graphics Resource Bundles Create /WEB-INF/portlet.xml

11 11 Course ID 0542 Simple Example: Code HelloWorldPortlet.java … public class HelloWorldPortlet extends GenericPortlet { protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException { PortletContext pc = getPortletContext(); pc.getRequestDispatcher("/WEB-INF/jsp/HelloWorld/view.jsp"). include(req, resp); } } /WEB-INF/jsp/HelloWorld/view.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding=“UTF-8"%> Hello World!

12 12 Course ID 0542 Simple Example: Deployment Descriptors /WEB-INF/web.xml <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd" version="2.4"> hello world application

13 13 Course ID 0542 Simple Example: Deployment Descriptors /WEB-INF/portlet.xml <portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet- app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd "> HelloWorld edu.ipfw.portlet.hello.HelloWorldPortlet text/html Hello World

14 14 Course ID 0542 Portlet Lifecycle Model One Portlet Object Per Portlet Definition Per Context Init() and destroy(): Startup and Shutdown processAction Called on “action URL” Handles state changes renderResponse Called to create output GenericPortlet implementation calls doView, doEdit, or doHelp based on PortletMode PortletRequest and PortletResponse Similar to ChannelRuntimeData Passed to both processAction and renderResponse Sub-classed for action (ActionRequest) vs. render (RenderRequest)

15 15 Course ID 0542 Portlet Mode and State PortletMode Standard modes VIEW, EDIT, and HELP EDIT and HELP map to uPortal edit and help buttons uPortal about button not supported uPortal has no non-standard modes WindowState Standard states are NORMAL, MINIMIZED, and MAXIMIZED Supported by uPortals buttons. uPortal has no non-standard states

16 16 Course ID 0542 Portlet Rendering Content Type Must be set (can be set by included Servlet/JSP) uPortal only supports text/html (HTML or XHTML) Portal URLs Action URLs RenderResponse.createActionURL Render only URLs RenderResponse.createRenderURL Mode and state changes invoked by adding to URL Parameters can also be added Internationalization ResourceBundle part of portlet configuration Includes default portlet title for GenericPortlet HelloWorld portlet uses alternative configuration

17 17 Course ID 0542 Portlet Rendering (continued) HTML Styles Portlet specification recommends portable HTML classes Luminis/uPortal does not have these in its style sheets Javascript RenderResponse.getNamespace as a name prefix or suffix Including Portlet Application Graphics, etc: Cannot use path relative URLs PortletRequest.getContextPath gives the root for the URL Use PortletResponse.encodeURL to encode the result Using Servlets (including JSPs) PortletContext.getRequestDispatcher or getNamedDispatcher JSPs are a great way to render a portlet Can use portlet tag library

18 18 Course ID 0542 User Attributes Accessing: PortletRequest.getAttribute(PortletRequest.USER_INFO) Map with attribute name key Portlet specification defines standard names Standard for given name is user.name.given Must Be Declared in portlet.xml uPortal Implementation Names and values are same as attribute on IPerson Defined in PersonDirectory.xml Portlet names are not in uPortal or Luminis configuration Can be added, or can use uPortal/Luminis names

19 19 Course ID 0542 Portlet Attribute Names in uPortal/Luminis Adding user.name.given to Luminis: Locate given name mapping in PersonDirectory.xml: urn:mace:dir:givenName Make LDAP attribute map to a set of attributes: urn:mace:dir:givenName Add user.name.given to the set: urn:mace:dir:givenName user.name.given Alternative: Use Name urn:mace:dir:givenName

20 20 Course ID 0542 Portlet State Portlets Are An Application Object Unlike channels, cannot store state in Portlet Equivalent is “Portlet Window” – not an object Request, Session, Context Attributes setAttribute method in PortletRequest, PortletSession, and PortletContext Session state can be portlet window only or application Request state not visible to calling portal Persistent State: Portlet Preferences PortletRequest.getPreferences No equivalent channel feature Portlet window specific Luminis/uPortal stores in database

21 21 Course ID 0542 Portlet Security Simple Security Model Uses roles defined in web.xml Declarative Security Restrict portlet access by role in portlet.xml Programmatic Security Use PortletRequest.isUserInRole to determine roles Can also do security based on user name Mapping to Luminis Roles Portlet roles map to uPortal GroupService keys Luminis group service names are lower case For Luminis, use the namespace ‘sct’ For example: the Student role is named ‘sct.student’

22 INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 22 Deploying Portlets Luminis instructions, tips, and tricks

23 23 Course ID 0542 Pluto/uPortal Deployment Model Pluto Portlet Container Wraps Portlets in a special Servlet Modifies portlet applications web.xml during deployment Requires Portal to find portlets uPortal Implementation Distribution includes ant deployPortletApp target Modifies web.xml as needed Always generates a Servlet 2.3 web.xml Application must be deployed to same directory as uPortal Application’s context name must be same as directory name

24 24 Course ID 0542 Luminis Deployment Requirements Same as Pluto/uPortal No deployment tool (scheduled for Luminis IV.1) Application must be $CP_ROOT/webapps Modifying web.xml Download uPortal and use its deployment tool Alternative: Hand create servlet entries Tomcat Deployment Enables Tomcat to find application Documentation says put copy in $CP_WEB_ROOT/webapps Alternative: Context file in $CP_WEB_ROOT/conf/Catalina/localhost Channel Definition To be used a channel must be defined for the portlet

25 25 Course ID 0542 Luminis Deployment Example Create WAR File helloWorld.war Run uPortal Deployment ant deployPortletApp –DportletApp=helloWorld.war Will deploy to configured directory (Optional) Restore Servlet Version Change: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> For Hello World: Remove DOCTYPE declaration, restore namespace declaration and version attribute.

26 26 Course ID 0542 Luminis Deployment Example (Continued) Deploy to Luminis: cd cp -r helloWorld $CP_ROOT/webapps Deploy to Tomcat: Create helloWorld.xml: Copy to $CP_WEB_ROOT/conf/Catalina/localhost For Parallel Deployment: Must be deployed on all portal tier machines Restart Luminis Or at least the webserver On all portal tier machines Need so uPortal will find the new portlet application

27 27 Course ID 0542 Luminis Deployment Example (Continued) Create Portlet’s Channel Use Portal Admin ->Publish a new channel Type “Portlet” Portlet Definition ID is. E.g. helloWorld.HelloWorld If you used Portlet Preferences, you can define default values. Enable Help or Edit buttons if those modes are supported. Other values are like any other channel.

28 28 Course ID 0542 Summary Portlets are standardized Portlets are the future Portlet support in Luminis IV is incomplete Portlets are fun

29 29 Course ID 0542 Questions & Answers If you have not asked yet, now is the time.

30 30 Course ID 0542 Thank You! Bob Mitchell mitchelr@ipfw.edu Please complete the online class evaluation form Course ID 0542 SunGard, the SunGard logo, Banner, Campus Pipeline, Luminis, PowerCAMPUS, Matrix, and Plus are trademarks or registered trademarks of SunGard Data Systems Inc. or its subsidiaries in the U.S. and other countries. Third-party names and marks referenced herein are trademarks or registered trademarks of their respective owners. © 2008 SunGard. All rights reserved.


Download ppt "INDIVIDUAL ACHIEVEMENT. EDUCATIONAL EXCELLENCE. ADMINISTRATIVE INNOVATION. INSTITUTIONAL PERFORMANCE. 1 Develop and Deploy JSR-168 Portlets Presented by:"

Similar presentations


Ads by Google