200 likes | 299 Views
Portals and portlets. Sean C. Sullivan October 24, 2006 Portland Java Users Group. Overview. Portals Portal servers Java Portlets Portlet programming Portlet deployment Demo. What is a portal?.
E N D
Portals and portlets Sean C. Sullivan October 24, 2006 Portland Java Users Group
Overview • Portals • Portal servers • Java Portlets • Portlet programming • Portlet deployment • Demo
What is a portal? A portal is a web based application that [...] provides personalization, authentication, content aggregation from different sources and hosts the presentation layer of information systems source: Java Portlet 2.0 specification
Liferay JBoss Portal Apache JetSpeed 2 Apache Pluto eXo platform uPortal IBM Websphere Portal BEA WebLogic Portal Sun Portal Server Oracle Portal Portal servers
Portal server features • personalization • single sign-on • security: users, groups, roles • portlet admin: deploy, undeploy • page layout • pre-built portlets
Liferay portal demo • http://demo.liferay.net/
Portlet fragments The content generated by a portlet is also called a fragment. A fragment is 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. source: Java Portlet 2.0 specification
Java Portlet specifications • Portlet 1.0 • JSR-168 • Portlet 2.0 • JSR-286
Java Portlet API • javax.portlet.Portlet • javax.portlet.GenericPortlet • javax.portlet.ActionRequest • javax.portlet.ActionResponse • javax.portlet.RenderRequest • javax.portlet.RenderResponse
javax.portlet.Portlet • public void destroy() • public void init(PortletConfig cfg) • public void processAction(ActionRequest, ActionResponse) • public void render(RenderRequest, RenderResponse)
javax.portlet.GenericPortlet • protected void doView(...) • protected void doEdit(...) • protected void doHelp(...) • protected void processAction(...)
Hello World Portlet public class HelloWorldPortlet extends javax.portlet.GenericPortlet { public void doView(RenderRequest req, RenderResponse resp) { resp.setContentType("text/html"); PrintWriter w = resp.getWriter(); w.println("Hello world"); } }
JBoss Portal demo • http://portal.demo.jboss.com/
Portlet requests • Action requests • Render requests
Portlet modes javax.portlet.PortletMode • EDIT • VIEW • HELP
Portlet window states javax.portlet.WindowState • MAXIMIZED • MINIMIZED • NORMAL
Portlet deployment • WAR • web.xml • portlet.xml
What's new in Java Portlet 2.0? • Resource serving • Events • Portlet filters • alignment with WSRP 2.0
Additional topics • Caching • CSS • Internationalization • File upload • Inter-portlet communication • Wrapping existing applications • WSRP
Resources • http://wiki.java.net/bin/view/Javapedia/Portal • http://wiki.java.net/bin/view/Javapedia/Portlet • http://www.jcp.org/en/jsr/detail?id=168 • http://www.jcp.org/en/jsr/detail?id=286