The Three P’s Portals, Portlets and uPortal Matthew J. Dovey Oxford e-Science Centre/RTS/OUCS

advertisement
The Three P’s
Portals, Portlets and uPortal
Matthew J. Dovey
Oxford e-Science Centre/RTS/OUCS
matthew.dovey@oucs.ox.ac.uk
Portals
Content Syndication
Content Syndication – Cocoon Style
Portal Engines

Commercial (more “digital dashboards”)










CA CleverPath Portal (http://www3.ca.com/Solutions/Product.asp?ID=262)
Elipva (http://www.elipva.com)
Epicentre (http://www.epicentric.com)
IBM WebSphere Portal (http://www-4.ibm.com/software/webservers/portal)
Jahia (http://www.xo3.com)
Mongoose Portal Studio (www.mongoosetech.com/products/portalstudio.html)
Sun iPlanet Portal Server (http://www.iplanet.com/products/iplanet_portal)
Oracle Portal (http://www.oracle.com)
Microsoft Sharepoint (http://www.microsoft.com/sharepoint)
OpenSource




JetSpeed (http://jakarta.apache.org/jetspeed/site/index.html)
Enhydra (http://www.enhydra.org/)
uPortal (http://mis105.mis.udel.edu/ja-sig/uportal/index.html)
The Grid Portal Development Kit (http://dast.nlanr.net/Projects/GridPortal/)
Portlets
Portlets – Web Proxies
Portlets and Channels
Portlet
Channel
Data Source
uPortal – User Preferences
uPortal – User Preferences
uPortal – User Preferences
uPortal – User Preferences
uPortal – “Skins”
uPortal – “Skins”
uPortal – Profiles
c.f. Window Managers
uPortal - Profiles
uPortal – Adding Portlets
uPortal – Adding Portlets
uPortal – Adding Portlets
uPortal- Adding Portlets
uPortal – Adding Portlets
uPortal – Adding Portlets
Portlet Types

Content Feed portlets


Proxy Portlets


External XML (RSS, XML)
Web Proxy, Inline Frame, Image, Applet
Interactive Portlets


Local API (portlet API, uPortal channel)
Remote API (uPortal SOAP, WSRP)
Anatomy of feed portlet
SSL
Select XSLT based on browser etc.
Formated HTML/
WML
XSLT
Formated HTML/
WML
XSLT
XML/RSS Source
Web page
Select XSLT based on browser etc.
CSS/Skin
SSL
XML/RSS Source
Sample SSL
<?xml version="1.0"?>
<?xml-stylesheet href="CGenericXSLT/RSS/rss0_9x_webbrowser.xsl" type="text/xsl" media="netscape"?>
<?xml-stylesheet href="CGenericXSLT/RSS/rss0_9x_webbrowser.xsl" type="text/xsl" media="explorer"?>
<?xml-stylesheet href="CGenericXSLT/RSS/rss0_9x_webbrowser.xsl" type="text/xsl" media="opera"?>
<?xml-stylesheet href="CGenericXSLT/RSS/rss-0_9x_pda.xsl"
type="text/xsl" media="avantgo"?>
<?xml-stylesheet href="CGenericXSLT/RSS/rss-0_9x_wml.xsl"
type="text/xsl" media="WAP"?>
<?xml-stylesheet href="CGenericXSLT/RSS/rss-0_9x_wml.xsl"
type="text/xsl" media="up"?>
RSS Feeds
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rss="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/">
<rss:channel rdf:about="http://www.oucs.ox.ac.uk/rss/news.rss">
<rss:title>OUCS News</rss:title>
<rss:description>http://www.oucs.ox.ac.uk/</rss:description>
<rss:link>Topical news from OUCS</rss:link>
<rss:items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.oucs.ox.ac.uk/courses"/>
<rdf:li rdf:resource="http://www.oucs.ox.ac.uk/openday/"/>
…
</rdf:Seq>
</rss:items>
</rss:channel>
<rss:item rdf:about="http://www.oucs.ox.ac.uk/courses">
<rss:title>Trinity term course list now available</rss:title>
<rss:link>http://www.oucs.ox.ac.uk/courses</rss:link>
<rss:description>Trinity term OUCS courses are now available for online booking. Click on
the above title to view and book our courses. Our printed course brochure will also be available
from next week (7th April 2003).</rss:description>
<dc:created>Mon 31 Mar 15:37</dc:created>
<dc:creator>senior</dc:creator>
</rss:item>
RSS Modules
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:ss="http://purl.org/rss/1.0/modules/servicestatus/"
xmlns:rss="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rss:channel rdf:about="http://someurl">
<rss:title>Services</rss:title>
<rss:description>Services</rss:description>
<rss:link>http://org</rss:link>
<ss:aboutStats>Percentage responses over last 100 samples</ss:aboutStats>
<rss:items>
<rdf:Seq>
<rdf:li rss:resource="urn:ceridwen.org:servicestatus:uid=1"/>
</rdf:Seq>
</rss:items>
</rss:channel>
<rss:item rdf:about="urn:ceridwen.org:servicestatus:uid=1">
<rss:title>OLIS OPAC - telnet</rss:title>
<rss:description>Public access to OLIS via telnet (OPAC)</rss:description>
<rss:link>urn:ceridwen.org:servicestatus:uid=1</rss:link>
<ss:responding>true</ss:responding>
<ss:lastChecked>2003-04-22T14:13:13Z</ss:lastChecked>
<ss:lastSeen>2003-04-22T14:13:13Z</ss:lastSeen>
<ss:availability>96.0</ss:availability>
</rss:item>
Some Local Feeds

OUCS


Oxford Libraries


http://www.oucs.ox.ac.uk/rss/allnews.rss
http://www.lib.ox.ac.uk/users/news/index.rss
Etc…
Sample XSLT
<xsl:template match="rdf:RDF" name="documentNode">
<!--<html>
<head>
<title>uPortal 2.0</title>
</head>
<body>-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="left">
<td width="100%" valign="bottom" class="uportal-channel-subtitle">
<xsl:value-of select="./rss10:channel/rss10:description" />
</td>
<xsl:if test="./rss10:image != ''">
<td>
<a target="_blank" href="{./rss10:image/rss10:link}">
<img border="0" alt="{./rss10:image/rss10:title}" src="{./rss10:image/rss10:url}"/>
</a>
</td>
</xsl:if>
</tr>
</table>
<br />
<xsl:apply-templates select="/rdf:RDF/rss10:item" />
<br />
<xsl:apply-templates select="/rdf:RDF/rss10:textinput" />
<!--</body>
</html>-->
</xsl:template>
…
XML Feed


Similar to RSS
Need special XSLT
Proxies

Web Proxies



IFrames





Need simple web pages
Ideally use uPortal CSS styles
Need newer browsers
Potential security issues
As per web proxies re content
Applets
Images
Web Proxy
Applet
Image
Anatomy of Interactive Portlets
Select XSLT based on browser etc.
SSL
XSLT
XML
Formated HTML/
WML
Local Java IChannel class or remote
SOAP WebService
Web page
CSS/Skin
User Generated Events (from link clicks)
Local Portlets

uPortal API


Proprietary uPortal API
JAVA Portlet API



Java Community Specification
Implemented in JetSpeed
Overtaken by WSRP/WSIA
uPortal IChannel Interface
public interface IChannel
{
public void setStaticData(ChannelStaticData sd)
throws PortalException;
public void setRuntimeData(ChannelRuntimeData
rd) throws PortalException;
public ChannelRuntimeProperties
getRuntimeProperties();
public void receiveEvent(PortalEvent ev);
public void renderXML(ContentHandler out) throws
PortalException;
}
setRuntimeData sample
this.runtimeData = rd;
String sGuess = runtimeData.getParameter ("guess");
if (sGuess != null)
{
try
{
iGuess = Integer.parseInt (sGuess);
}
catch (NumberFormatException nfe)
{
// Assume that the guess was the same as last time
}
bFirstTime = false;
iGuesses++;
renderXML sample
String sSuggest = null;
if (iGuess < iAnswer)
sSuggest = "higher";
else if (iGuess > iAnswer)
sSuggest = "lower";
StringWriter w = new StringWriter ();
w.write ("<?xml version='1.0'?>\n");
w.write ("<content>\n");
w.write (" <minNum>" + iMinNum + "</minNum>\n");
w.write (" <maxNum>" + iMaxNum + "</maxNum>\n");
w.write (" <guesses>" + iGuesses + "</guesses>\n");
w.write (" <guess>" + iGuess + "</guess>\n");
if (bFirstTime)
; // Do nothing
else if (iGuess == iAnswer)
{
w.write (" <answer>" + iAnswer + "</answer>\n");
bFirstTime = true;
iGuesses = 0;
iAnswer = getRandomNumber (iMinNum, iMaxNum);
}
else
w.write (" <suggest>" + sSuggest + "</suggest>\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();
Sample XSLT
<xsl:param name="baseActionURL">default</xsl:param>
<xsl:template match="content">
<xsl:choose>
<xsl:when test="suggest">
Your guess of <xsl:value-of select="guess"/> was incorrect.
Try again -- guess <span class="uportal-channel-strong"><xsl:value-of select="suggest"/></span>!<br />
You have made <xsl:value-of select="guesses"/> guesses.
</xsl:when>
<xsl:when test="answer">
You got it after <span class="uportal-channel-strong"><xsl:value-of select="guesses"/></span> tries!
The answer was <span class="uportal-channel-strong"><xsl:value-of select="answer"/></span>!<br />
<p>Please play again...</p>
</xsl:when>
<xsl:otherwise>This is a number guessing game.<br /></xsl:otherwise>
</xsl:choose>
I am thinking of a number between
<xsl:value-of select="minNum"/> and
<xsl:value-of select="maxNum"/>.<br />
What's your guess?
<form action="{$baseActionURL}" method="post">
<input type="hidden" name="uP_root" value="me"/>
<input type="text" name="guess" size="4" class="uportal-input-text"/>
<input type="submit" value="Submit" class="uportal-button"/>
</form>
</xsl:template>
Customisation – IPerson Interface
public interface IPerson extends IAdditionalDescriptor, IBasicEntity
{
public static final String USERNAME = "username";
public void setID (int sID);
public int getID ();
public void setFullName (String sFullName);
public String getFullName ();
public Object getAttribute (String key);
public void setAttribute (String key, Object value);
public Enumeration getAttributes ();
public Enumeration getAttributeNames ();
public void setSecurityContext (ISecurityContext securityContext);
public ISecurityContext getSecurityContext ();
public boolean isGuest ();
}
uPortal – Adding Portlets
Remote Portlets

uPortal SOAP API


SOAP Version of IChannel API
WSRP/WSIA



OASIS Standard for Interactive Applications
and Remote Portals
http://www.oasisopen.org/committees/tc_home.php?wg_abbrev=wsrp
17 April 2003 Draft -> 85 pages
Remote Portlets Anatomy
Init: Browser Type/User Information etc
Function Calls
and Responses
over SOAP
Formated HTML/
WML
Local IChannel SOAP Stub
Web page
CSS/Skin
User Generated Events (from link clicks)
SOAP WebService
uPortal – Adding Portlets
uPortal Remote Channel Interface
public interface RemoteChannel extends Remote {
public void authenticate(String username, String password) throws
RemoteException,
org.jasig.portal.channels.remotechannel.Exception;
public String instantiateChannel(String fname) throws
RemoteException,
org.jasig.portal.channels.remotechannel.Exception;
public Element renderChannel(String instanceId, ChannelRuntimeData
runtimeData) throws RemoteException,
org.jasig.portal.channels.remotechannel.Exception;
public void receiveEvent(String instanceId, PortalEvent portalEvent)
throws RemoteException,
org.jasig.portal.channels.remotechannel.Exception;
public void freeChannel(String instanceId) throws RemoteException,
org.jasig.portal.channels.remotechannel.Exception;
public void logout() throws RemoteException,
org.jasig.portal.channels.remotechannel.Exception;
}
WSRP Overview
User
Adds
Portlet
WSRP Consumer
(Portal)
WSRP Producer
(Service)
Create Portlet Instance
I
Allocate new Instance
Views
Portlet
Clicks
Action
Removes
Portlet
Get Portlet Markup
I
A
I
S
A
Generate Markup,
(opt: create Session)
S
Perform Portlet Action
I
S
A
I
S
A
Action Handling
(opt: create Session)
Destroy Portlet Instance
II
I
Destroy instance
Further Reading




http://www.ja-sig.org
http://mis105.mis.udel.edu/ja-sig/uportal/
http://www.oasisopen.org/committees/tc_home.php?wg_abbrev=
wsrp
http://www.jisc.ac.uk/index.cfm?name=te
chwatch_report_0103
Download