220 likes | 245 Views
The uPortal Framework and Channels. Robert Sherratt Digital University Project (www.digital.hull.ac.uk) University of Hull. The uPortal Framework and Channels. Background – uPortal and JA-SIG Channels APIs deployment in the portal What next…. JA-SIG.
E N D
The uPortal Framework and Channels Robert Sherratt Digital University Project (www.digital.hull.ac.uk) University of Hull
The uPortal Framework and Channels • Background – uPortal and JA-SIG • Channels • APIs • deployment in the portal • What next…
JA-SIG • Java Architectures Special Interest Group • Formerly Administrative Computing • Formed in 1999 • Consortia of over 200 institutions • Clearinghouse • uPortal • JA-SIG UK • www.ja-sig.org(.uk)
What is uPortal • Open source portal framework • Developed by JA-SIG • Based on open standards • Java, XML, XSL • Used for production of institutional portals • Staff, students (alumni, perspective students) • c. 35 live sites
uPortal details • Designed to integrate with existing IT infrastructure • Servlet containers, databases, directory services, authentication systems • Very flexible layout engine • Layout details stored in db via JDBC • Output (XML), Structure (XSL), Skins (CSS + graphics) • Customization
uPortal details - 2 • User profile • LDAP/JDBC storage • Uses eduPerson standard • Add your own attributes • Framework contributions • Development community plus core team • Both commercial andhigher education
uPortal versions • 1.0 - July 2000 • 1.5/1.6 – 2001 • Roles, performance • 2.0 – February 2002 • XSLT • 2.1 – December 2002 • Groups & Permissions, Composite group service • 2.2 – October 2003 • Aggregated layouts, i18n
What is a channel? User Channel Portal layer Content Data Applications
uPortal Channels • For displaying content within uPortal • Access back-end content/functions and present to user • Default channel types • Applet, Image, Inline Frame, Remote Channel Proxy, RSS, Web Proxy, XML Transformation • “Proprietary” Channel APIs • IChannel – simple structure • Multithreaded/cacheable - base classes and interfaces
The Channel APIs - IChannel • setStaticData • called once when the channel is started • setRuntimeData • called every time the channel is used • renderXML • transforms the channel content
IChannel – Hello Name • setRuntimeData public void setRuntimeData (ChannelRuntimeData rd) { runtimeData = rd; sName = runtimeData.getParameter ("name"); }
IChannel - renderXML public void renderXML (ContentHandler out) throws PortalException { StringWriter w = new StringWriter (); w.write ("<?xml version='1.0'?>\n"); w.write ("<content>\n"); if (sName != null) w.write (" <name>" + sName + "</name>\n"); w.write ("</content>\n"); XSLT xslt = new XSLT(this); xslt.setXML(w.toString()); xslt.setXSL(sslLocation, "main", runtimeData.getBrowserInfo()); xslt.setTarget(out); xslt.setStylesheetParameter("baseActionURL", runtimeData.getBaseActionURL()); xslt.transform(); }
Transforming content – Stylesheet list • private static final String sslLocation = "CHelloName/CHelloName.ssl"; <?xml-stylesheet title="main" href="CHelloName/xhtml.xsl" type="text/xsl" media="netscape"?> <?xml-stylesheet alternate="yes" href="CHelloName/xhtml.xsl" type="text/xsl" media="explorer"?> • Use to support different devices/formats
Transforming content - XSL <xsl:template match="content"> <xsl:choose> <xsl:when test="name"> Welcome to uPortal <xsl:value-of select="name"/> .<br /> </xsl:when> </xsl:choose> Please enter your name:<br /> <form action="{$baseActionURL}" method="post"> <input type="text" name="name" size="10" class="uportal-input-text"/> <input type="submit" value="Submit" class="uportal-button"/> </form> </xsl:template>
Multithreaded and cacheable channels • Multithreaded channels are trusted to keep their own state/session • the same methods as IChannel and also include channel instance key • renderXML the same except for: ChannelState channelState = (ChannelState)channelStateMap.get(uid); ChannelStaticData staticData = channelState.getStaticData(); ChannelRuntimeData runtimeData = channelState.getRuntimeData(); • additional methods for generating a channel instance key
What next • Easier deployment with CARs • JSR 168 awaiting final release • Web Services… • WSRP awaiting approval as an OASIS standard • Next version of uPortal, 2.2, will have: • WSRP producer channel • WSRP consumer channel
Questions? • Digital University Project (www.digital.hull.ac.uk) • www.ja-sig.org(.uk) • r.sherratt@hull.ac.uk