ajax in enterprise portals wesley hales

22
Ajax in Enterprise Portals Wesley Hales http://wesleyhales.com

Upload: rajivmordani

Post on 13-May-2015

828 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Ajax In Enterprise Portals Wesley Hales

Ajax in Enterprise PortalsWesley Hales

http://wesleyhales.com

Page 2: Ajax In Enterprise Portals Wesley Hales

Introductions

• Your experience with portals?

• Have you used new Portlet 2.0 technologies?

• What do you want to gain from this session?

Page 3: Ajax In Enterprise Portals Wesley Hales

Who is Wesley Hales

• JBoss Portal Lead UI Architect

• Author of InfoQ article series:Developing Portlets using JSF, Ajax, and Seam

• JBoss Portlet Bridge project lead

• JSR-301 Expert Group member

• http://wesleyhales.com

Page 4: Ajax In Enterprise Portals Wesley Hales

Portals & Portlets

What is a Portal?

• Windows that provide access to web applications and other information.

• Works across organizational boundaries to aggregate content coming from various web technologies: JSF, Seam, Struts, Wicket, PHP...

Page 5: Ajax In Enterprise Portals Wesley Hales

Portals & PortletsPortlets

• Are managed by a portal.

• Displayed via a Portal Pagewhich is an aggregator of the portlet windows.

• A Portlet Application is also a Web Application. The Portlet Application may contain servlets and JSPs in addition to portlets. Portlets, servlets and JSPs may share information through their session.

Page 6: Ajax In Enterprise Portals Wesley Hales

Portlet Ajax vs. Regular (Servlet) Ajax

Pitfalls with 1.0 portlet• Action and render URLs point to the portal, not to the portlet

• you cannot make asynchronous calls to portlets through portlet URLs

• This results in the replaced markup being all the portal page markup not just the portlet window

How we handle it• Because a portlet is a Web application that can contain other

resources, such as servlets and JSP pages, you can make the asynchronous requests to the resources that are bundled with the portlet.

Page 7: Ajax In Enterprise Portals Wesley Hales

Standard Portlet 1.0 Ajax

Page 8: Ajax In Enterprise Portals Wesley Hales

Ajax gets better with Portlet 2.0

serveResource and Resource Urls

• With the newer (JSR-286) spec, we now have the serveResource() mechanism that makes Ajax easier.

• Makes it easy to migrate existing JSR 168 applications

• Works with existing client-side libraries

• Partial updates to the portlet’s UI

Page 9: Ajax In Enterprise Portals Wesley Hales

Portlet 2.0 Ajax

Page 10: Ajax In Enterprise Portals Wesley Hales

Portlet 2.0 Ajax Demo

Page 11: Ajax In Enterprise Portals Wesley Hales

Today's Ajax Component Libraries

• What libraries are available to portlet developers?

• Do I have to use JSF?

• It is only framework (currently) with a spec backing it for portlets.

• Two of the more popular libraries for JSF are:

• IceFaces

• Uses custom built bridge

• RichFaces

• Works with a JSR-301 based bridge

Page 12: Ajax In Enterprise Portals Wesley Hales

What is a Bridge, and why do we need it?

• There are different bridges to handle many different web applications.

• Wicket

• Seam

• Spring MVC

• JSF

• Struts

• PHP

• A bridge is often just a portlet.

• Recently the JSR-301 specification was formed to handle JSF in portlets which is much more than a simple portlet ;-)

Page 13: Ajax In Enterprise Portals Wesley Hales

Portlet

Other component libraries, like IceFaces, provide their own "bridge" or way to handle the portlet and JSF lifecycles.

Page 14: Ajax In Enterprise Portals Wesley Hales

IceFaces Portlet Demo

Page 15: Ajax In Enterprise Portals Wesley Hales

IceFaces Portlet Markup

Page 16: Ajax In Enterprise Portals Wesley Hales

RichFaces PortletThe RichFaces component library runs under the JBoss Portlet Bridge, an implementation of the JSR-301 specification to support JSF within a portlet.

Page 17: Ajax In Enterprise Portals Wesley Hales

RichFaces Portlet Demo

Page 18: Ajax In Enterprise Portals Wesley Hales

RichFaces Portlet Markup

Page 19: Ajax In Enterprise Portals Wesley Hales

Portlet Bridge Summary

• Standards make life easier when investing in a portlet/Ajax/Component solution

• Currently the JBoss Portlet Bridge supports any combination of JSF, Seam, and RichFaces to run inside a portlet.

• It is currently in Beta 4 and should be approaching GA sometime in early '09 wen the spec is finalized.

• JSR 301 scheduled to be complete early ’09 (168)

Page 20: Ajax In Enterprise Portals Wesley Hales

Mashups and OpenSocial Portlets

• Who is doing it?

• Are there any portlets available that make this easy?

Page 21: Ajax In Enterprise Portals Wesley Hales

QuickStart Portlet Demo

Page 22: Ajax In Enterprise Portals Wesley Hales

Questions?

• IceFaces Portlet Setup Infohttp://tinyurl.com/3l2fuz

• JBoss Portlet Bridgehttp://www.jboss.org/portletbridge/