Delivering Content for uPortal without writing Portlets or

Download Report

Transcript Delivering Content for uPortal without writing Portlets or

RESTful Portal Content:
Delivering Content for uPortal without
writing Portlets or IChannels
Susan Bramhall
Yale University
JA-SIG Winter 2006
How this presentation came to be
 Why are other
uPortal sites
writing so many
Portlets?
 What is wrong
with the approach
we take at Yale?
http://www.ja-sig.org/wiki/display/JCON/06winter+
Compelling+uses+of+CWebProxy+and+CGenericXSLT
JA-SIG Winter 2006
Our Goal:
Channels and Portlets should be…
 Easy to provide
 Managed by application or data
owner not portal team
 Technology independent
 Easily ported to new environments
 Re-usable for many uses
JA-SIG Winter 2006
Essentially More RESTful
 Simple HTTPS and XML where possible
 simplifies component implementation
 reduces the complexity of connector semantics
 Layered
 improves the effectiveness of performance tuning
 Cacheable
 Improved performance
 Improved scalability of portal
 Less complexity in the portal
JA-SIG Winter 2006
90% of Content via XML or XHTML
 CGenericXSLT






 CAbstractXslt
RSS
Sakai Site Summary
Upcoming Events
Recent E-mail
Computing Clusters
Library Books Out

Could return, for
example, user layout
or channel registry
 CWebProxy
 Directory Search
 Network Registration
Uses parameters to
focus the channel
JA-SIG Winter 2006

Example:
Dynamic Information From Sakai
JA-SIG Winter 2006
How did that happen?
1. XML retrieved from http request via Proxy
CAS returns…
JA-SIG Winter 2006
How did that happen?
2. Simple XSL formats for channel to display
JA-SIG Winter 2006
Who did that?
Jen did.





Java programmer on Yale’s Sakai Project
Familiar with Sakai internals
She reused existing Sakai logic and APIs
She did it in less than a day
No new Portlet
JA-SIG Winter 2006
“That was easy!”
 All the work is on the Sakai side
 All the understanding is on the Sakai side
 The channel is part of our Sakai Project
JA-SIG Winter 2006
OK, Authentication
can be a challenge
 More Info on the CAS wiki
XML result
YaleInfo
https request
with PST
Sakai
summary
channel
Classes*V2
Validate Ticket
Proxy Service
Ticket
CAS
For portlets see…
 http://www.ja-sig.org/wiki/display/PLT/Portlets+using+Proxy+CAS
JA-SIG Winter 2006
RESTful Benefits
 Layering
 Separation of
responsibilities
 Easier to tune
performance
 Allows more scalable
portal
YaleInfo
Sakai
summary
channel
JA-SIG Winter 2006
Classes*V2
Recent E-Mails
 Uses Proxy CAS * 2
 Links to message in IMP
 Not a full e-mail client in uPortal
HTTPS
Request
portal
XML
response
Recent
E-mail
Channel
servlet
JA-SIG Winter 2006
IMAP
Protocol
IMAP
Server
Computing Cluster Status
JA-SIG Winter 2006
ITS Systems Messages
 Simple RSS feed from existing system
 “more…” links to full information
JA-SIG Winter 2006
Upcoming Events
Homegrown
Calendar
API
Sun
Calendar
Server
Yale Public Event Calendar
Upcoming
Events
channel
YaleInfo Portal
JA-SIG Winter 2006
Speaking of caching
 We did modify the
CGenericXSLT to cache XML
documents
 The cache layer refreshes the
cache on configurable
intervals in the background
 User request never waits on
xml retrieval after the first time
JA-SIG Winter 2006
YaleInfo looks like this…
Events 1/hr
Channels
are
rendered
Cache of
from
XML
cached
Documents
documents
Document
Cacher
thread
Clusters
6/hr
Top Links
1/day
Recent
email
Not cached
JA-SIG Winter 2006
Caching Package
 edu.yale.its.portal.utils.cache



Retrieves XML using commons httpclient
Saves DOM in memory
One (yes, one) thread runs in background
refreshing documents on scheduled intervals
 CGenericXSLT modified to get XML from
caching package
JA-SIG Winter 2006
Channel Publishing Document
modified to get cache parameters
Channel Publishing Document?
 Defines the steps for publishing a channel based on
a channel type. See…
webpages/
media/
org/
jasig/
portal
channels/
CGenericXSLT/
CGenericXSLT.cpd
JA-SIG Winter 2006
Channel Types Drive Channel Manager
Channel Type includes CPD
 CPD is the XML configuration file
 See more about creating a new channel type on the
JA-SIG wiki under the name “Register Channel Type”
http://www.ja-sig.org/wiki/x/lzQ
JA-SIG Winter 2006
More Tips and Tricks
 Focus


A channel can focus itself using parameter
uP_root=me
Or "unfocus“ by using uP_root=root
 Modification to pass IP address
JA-SIG Winter 2006
Summary of library books out
[baseActionUrl]?uP_root=me
Detail of library books out
[baseActionUrl]?uP_root=root
Return from focus to normal
JA-SIG Winter 2006
CSqlQuery vs. sql2xml service
CSqlQuery
 Nifty new IChannel
 Executes a SQL query
 Returns results in XML
 uPortal dependent
sql2xml
 Servlet runs in a
separate JVM
 Configured with data
source and SQL query
 Accepts parameters on
request
 Executes SQL query
and returns XML
 Portal and application
agnostic
JA-SIG Winter 2006
Incorporated Applications
 CWebProxy – 2 more Yale examples


Network Registration
Directory Lookup
 Web Proxy Portlet
http://www.ja-sig.org/wiki/display/PLT/WebProxy
JA-SIG Winter 2006
Network Registration
 User perspective = a captive application
 Technical view = Completely independent
Network Registration
Portal
Web Proxy




Network
Registration
STRUTS application
Written for Portal but also runs stand alone
Entirely separate web server environment
We modified uPortal to allow IP address to be
passed
 Person attribute passing is built in
JA-SIG Winter 2006
Yale Directory Lookup
JA-SIG Winter 2006
Yale Directory Look Up
 Separate JSP application
 Uses LDAP interface and
produces xhtml
 Separately hosted
 Captive to Portal from user
perspective
JA-SIG Winter 2006
CWebProxy has neat features
 Passing person attributes
 Changing source XHTML
and or XSL on the fly
 See tutorial on CWebProxy home page
http://www.mun.ca/portal/software/cw/
JA-SIG Winter 2006
I am still wondering
Is this the best
way to provide
content?
What do you
think?
JA-SIG Winter 2006