A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com 1 In-House Custom Channel...
48
SUNGARD SUMMIT 2007 | sungardsummit.com 1 A Community of Learning In-House Custom Channel Development Presented by: Wallace Neikirk, Senior Programmer/Analyst, Wright State University Main Campus March 21, 2007 Course ID 945
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com 1 In-House Custom Channel Development Presented by: Wallace Neikirk, Senior Programmer/Analyst,
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
1 In-House Custom Channel Development Presented by: Wallace
Neikirk, Senior Programmer/Analyst, Wright State University Main
Campus March 21, 2007 Course ID 945
Slide 2
2 Session Rules of Etiquette Please turn off your cell
phone/pager If you must leave the session early, please do so as
discreetly as possible Please avoid side conversation during the
session Thank you for your cooperation!
Slide 3
3 Course ID 945 Introduction Demonstrate how to expose Banner
services through the Luminis platform Banner Surveys, Elections,
and Alerts How we developed and deployed our In-House custom
channels Peek-n-poke, Luminis framework, CAR deployment How we
leveraged Banner SSO and CPIP connectors Seamless navigation to
Banner services How to write some simple (yet effective) Web
Services XML communications & JDOM parse Exploiting and
extending the Banner API Alerts API & DB tables
Slide 4
4 Course ID 945 Agenda Slide WSU Architecture Web Services
Architecture Development Environment System Design Demonstration
Banner leverage points Survey Channel Election Channel Alerts
Channel Future Directions Summary Questions
Slide 5
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
5 WSU Architecture WSU computing from 10,000 feet.
Slide 6
6 Course ID 945 WSU Architecture WSU is a Banner shop We bought
all the products To do Surveys, Elections, and Alerts, we used a
subset of the architecture Luminis Portal Websphere App Server
Oracle DB Server Banner Self Services Banner Admin Services
Slide 7
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
7 WSU Web Services Architecture WSU computing to solve the
problem.
Slide 8
8 Course ID 945 Web Services Architecture The web service is
implemented on Websphere (webserv.ear) It provides XML
communications to Luminis and Oracle It provides seamless access to
Banner Self-Service & Admin Service.
Slide 9
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
9 WSU Development Environment Tools to construct the solution.
Slide 10
10 Course ID 945 WSU Development Environment Development
stations Websphere WSAD uPortal Quickstart Oracle JDBC connections
Import uPortal & Luminis jars into WSAD Clean compile Publish
custom channels to uPortal Fire-up uPortal quickstart for testing
No debugger Production Deployment Publish webserv.ear to WebSphere
Publish custom channels to Luminis CAR files Publish Tables &
API to Oracle
Slide 11
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
11 System Design A single design pattern.
Slide 12
12 Course ID 945 System Design - Overview This same design
pattern was applied to all the problems, i.e., Surveys, Elections,
Alerts.
Slide 13
13 Course ID 945 System Design Points to Consider Channel does
https post/response to the Web Service Channel becomes simply an
interface Business rules are contained in the Web Service Channel
uses no DB connections It offloads CPU cycles to the Web Service
Channel does XSLT presentation Transforms XML to simple HTML Or,
any other presentation language Communications between layers done
with an XML Can represent complex structures Very flexible Web
Service uses the JDOM parser Simple Java Collections Sits on top of
Xalan, Xerces, and Jaxp DB API encapsulates the Survey, Election,
and Alerts tables WSU developed API Banner API continues to
evolve
Slide 14
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
14 Demonstration Lets see it work.
Slide 15
15 Course ID 945 Demonstration Lets demo the channels Login to
the Luminis Channel populates with MY surveys, elections, alerts
Content is for me Not role based Post to the Web Service to
retrieve Banner content Single solution pattern Click to navigate
seamlessly to a particular Survey, Election, or Alert Leveraging
SSO and CPIP connectors Now, take the Survey, fill out the Ballot,
or complete the Alert task in Self-Service or Banner Admin
Leveraging Banner Services Banner already did the work
Slide 16
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
16 Banner Leverage Points Leveraging Banner Services, SSO, and
CPIP.
Slide 17
17 Course ID 945 Leverage Points Overview Leveraging Banner SSB
and INB Services Survey, Elections, and Alerts are existing SSB
Services SCT did all the work Were just pushing channel content to
clients Leveraging Banner SSO and CPIP connectors Enables seamless
navigation to Banner services Its an install & config project
In general, we want to Establish a CPIP conversation between
Luminis and SSB and/or INB Have a secure exchange/mapping of user
credentials Create a user session seamlessly in SSB & INB
Slide 18
18 Course ID 945 Leverage Points SSO & CPIP Configure
Luminis LDAP es.systems = sctssb sctinb
es.sctssbconfigURL=http://wsu.ssb.server:port/DAD/gokssso.P_
GetConfigVersion2_sserv SSBServerName, DADSpecial, CPAuth,
SearchBase, etc. Configure SSB DADNormal (www_user), DADSpecial
(bansso) WebTailor parameters CPCOOKIEDOMAIN, CPCOOKIENAME, etc.
Install INB Bannersso.jar, basejsso.htm, formsweb_sso.cfg Configure
DB tables General User Preferences Maintenance Form (GUAUPRF)
LDAPServer, DN, BIND_USER, BIND_PSWD, etc. GOKSSSO, GOKCSSO
packages are the CPIP Verify the installation Sso_ldapssb.sql,
sso_ldapinb.sql verifies SSO
http://luminis1.wright.edu/cp/ip/login?sys=sctssb&url=http://wsu.
ssbserver:port/DAD/bwgksrvy.P_ShowSurveys
Slide 19
19 Course ID 945 Leverage Points Sample Survey Lets setup a
simple Banner survey Setup the Survey in Banner Admin Take the
Survey in Banner Self-Service Now, lets channelize this content and
enable seamless navigation to these services
Slide 20
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
20 Survey Channel Lets look at Custom Channel Development more
closely.
Slide 21
21 Course ID 945 Survey Channel - Overview The Survey Channel
exposes the Banner Survey service into a Luminis custom channel The
portal user sees survey content targeted to them personally for a
particular period of time They can take a survey, review the
results of a survey, or (if an admin) can manage surveys Channel
permissions The implementation follows the same single design
pattern Post/response to the web service to obtain all Banner
surveys for the user Communications between layers with XML WSU API
encapsulates the survey databases Seamless navigation to SSB Use of
the Luminis/uPortal framework to develop the custom channel
Channel, Person, Permission, Events, RuntimeData, etc. Use XSLT for
the presentation of Survey content Use of CAR files for ease of
deployment
Slide 22
22 Course ID 945 Survey Channel - Demo Lets look at the sample
survey we just setup Note, the survey link shows up in the channel
Lets take the survey Lets review the results Lets navigate to INB
to define a new survey
Slide 23
23 Course ID 945 Survey Channel Class Diagram My view of the
Luminis/uPortal framework These are some of the objects I used to
develop the Surveys channel Service objects are up and running when
the portal starts up Common services needed by all channels DB
connections, Logging, etc. Session objects are available when a
user logs onto the portal Objects provide information about the
user logged on Person attributes, group membership, permissions
Channel objects are how we extend the portal with our own channel
development Extend the IChannel interface to create your own
channel Composed of several very useful objects, e.g.,
ChannelStaticData, ChannelRuntimeDate, etc.
Slide 24
24 Course ID 945 Survey Channel Custom Channel To create your
own channel you need to extend the IChannel interface You will need
to implement the abstract methods receiveEvent, setStaticDate,
setRuntimeDate, etc. These methods provide info about channel
parameters, person info, permissions, This is where you provide
your own channel functionality, e.g., Surveys, Elections, Alerts.
Note, there is a package naming convention..uportal.ch annels This
is to avoid name collisions in portal deployment Note, you will
always need those eight import statements - no matter what! Lets
look at a couple of the methods in more detail (channel snipplet)
package edu.wright.is.uportal.channels.surveys; // A channel needs
these eight classes no matter what: import
org.jasig.portal.IChannel; import
org.jasig.portal.ChannelStaticData; import
org.jasig.portal.ChannelRuntimeData; import
org.jasig.portal.ChannelRuntimeProperties; import
org.jasig.portal.PortalEvent; import
org.jasig.portal.PortalException; import
org.jasig.portal.utils.XSLT; import org.xml.sax.ContentHandler;
public class CSurveys extends IChannel { (channel snipplet) public
ChannelRuntimeProperties getRuntimeProperties() { public void
receiveEvent(PortalEvent ev) { public void
setStaticData(ChannelStaticData sd) { public void
setRuntimeData(ChannelRuntimeData rd) { public void
renderXML(ContentHandler out) throws PortalException {
Slide 25
25 Course ID 945 Survey Channel Custom Channel The
setStaticData method is called once. It is called when the channel
renders the first time It provides access to the channel parms
defined when the channel was published It also provides access to
the person object in session. You can get uid, email address, etc.
The mapping of these person attributes is defined in the
personsDir.xml config file User permissions are also accessible in
this method The setRuntimeDate method is called every time there is
an interaction with the channel It provides access to the runtime
parms in the URL, i.e., the name=value pairs This method simply
goes through a case statement determining what to do It creates the
XML for display into the channel It determines the stylesheet to
apply to the XML It also sets the channel mode. More complex
channels may need state machines. (channel snipplet) public void
setRuntimeData(ChannelRuntimeData rd) { this.runtimeData = rd; //
get runtime parms action = runtimeData.getParameter("action"); //
process the form submissions if (action.equals("surveys")) {
this.processSurveys(); mode = SURVEYS_MODE; } (channel snipplet)
public void setStaticData(ChannelStaticData sd) { this.staticData =
sd; // get static parms enable = (String)
staticData.getParameter("Enable"); // get person info person =
staticData.getPerson(); String uid = (String)
person.getAttribute("uid"); String email = (String)
person.getAttribute("mail");
Slide 26
26 Course ID 945 Survey Channel Custom Channel The renderXML
method is called every time the portal renders your channel You
create an XSLT object Tell the object the XML you are using Tell it
the stylesheet you want to use You can send some parameters to the
stylesheet. Good for forming links, controlling what is displayed,
etc. Do the XSLT transform producing HTML which is displayed in
your channel The processSurveys method is mine. It is our business
logic. It is what produces the Surveys Channel content It does an
HTTPS post to the Surveys Web Service It gets the response from the
web service with all the survey info in the XML doc Finally,
permissions. We are relying on the portal to provide user info and
permissions You must implement the IPermissible interface You will
need to implement the abstract methods getActivityTokens,
getTargetTokens, GetOwerTokens, etc. When the channel is published,
the permissions will appear in the admin tool. (channel snipplet)
public void renderXML(ContentHandler out) throws PortalException {
// Create a new XSLT styling engine XSLT xslt = new XSLT(this); //
pass the result XML to the styling engine. xslt.setXML(xml); //
specify the stylesheet selector xslt.setXSL("CSurveys.ssl",
stylesheet, runtimeData.getBrowserInfo()); // set parameters that
the stylesheet needs. xslt.setStylesheetParameter("baseActionURL",
// do the deed xslt.transform(); (channel snipplet) public class
CSurveys extends BaseChannel implements IPermissible { public
String getOwnerToken() { public String getOwnerName() { public
String[] getActivityTokens() { public String getActivityName(String
token) { public String[] getTargetTokens() { public String
getTargetName(String token) {
Slide 27
27 Course ID 945 Survey Channel XSLT Presentation What is an
XSLT? Its an engine that transforms a source XML doc into a
resulting XHTML doc. Actually, it can transform into any resulting
XML doc. In the Luminis/uPortal case, its a SAX engine that does
the transformation The Sax engine scans the document sequentially
and fires off events as the tags are parsed The XSLT transformation
is done in the channel renderXML method. It passes... Source XML
doc the Survey Channel content SSL file mapping to a particular XSL
stylesheet Browser information object effects the mapping XSL
stylesheet looks like a programming language Variable, if, choose,
for-each, message, etc. Templates, element, sort, strip-space,
etc.
Slide 28 ">
28 Course ID 945 Survey Channel XSLT Presentation We define a
template to match the tag When the SAX engine parses the tag this
template fires off Within the template, we produce the header HTML
for the Survey channel Then, we apply the templates that match each
particular child tag For the template that matches the tag We
continue to produce HTML fragments for Survey channel content Here,
we are forming the SSO link into SSB for the user to seamlessly
navigate to the Survey Service in SSB We are also getting the value
of the element to display as the link text (xsl snipplet) Surveys:
(xsl snipplet)
Slide 29 (xsl snipplet) ">
29 Course ID 945 Survey Channel XSLT Presentation For the
template that matches the tag We produce an HTML link that
communicates back to the Survey Channel The $baseActionURL is the
portal identifier for this instance of the Survey Channel The HTML
link adds on a couple of runtime parms - action and surveyName
surveyName tells the channel which survey result to display Were
also getting the value of the element to display as the link text
Finally, for the template that matches the tag We are displaying
the count for each survey question The @text gets the text
attribute of the tag which is the question The . gets the current
element of the tag which is the count (xls snipplet) (xsl
snipplet)
Slide 30
30 Course ID 945 Survey Channel CAR Deployment What is a CAR
file? A CAR file is just a java archive with a.car extension It is
created with the jar utility provided with the JDK A CAR contain
all the elements for the construction and presentation of custom
channel There are two important elements to Channel deployment Web
visible elements jpg, gif, etc. Deploy to luminis/media Resource
elements class, xsl, ssl, etc. Deploy to luminis/WEB-INF/classes
There is a naming convention to follow for Channel deployment
/
Slide 31
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
31 Election Channel Lets look at Web Service Development more
closely.
Slide 32
32 Course ID 945 Election Channel - Overview The Election
Channel exposes the Banner Election service into a Luminis custom
channel The portal user sees election content targeted to them
personally for a particular period of time They can participate in
an election, review the results of a election, or (if an admin) can
manage elections Channel permissions The implementation follows the
same single design pattern Post/response to the web service to
obtain all Banner elections for the user Communications between
layers with XML WSU API encapsulates the survey databases Seamless
navigation to SSB Use of the WSU framework to develop our custom
web services DbManager, PropManager, LogManager, Client, etc. JDOM
manages all XML communications parse, navigate, and build XML
docs
Slide 33
33 Course ID 945 Election Channel - Demo Lets look at a sample
election Note, current elections are visible in the channel Lets
vote in an election Lets review the results of an election Lets
navigate to INB to define an election
Slide 34
34 Course ID 945 Election Channel Class Diagram The WSU Web
Service Framework Could use any MVC framework, e.g., Struts,
Spring, etc. The WSU Web Service Framework is composed of...
Service Layer - DbManager, PropManager Session Layer - Client,
Authenticate Base Layer - SvtBase, CmdBase, DatBase, VewBase Web
Service Layer - Election objects Elections web service objects
include... Contoller SvtElections Model CmdElections View
DatXmlResp OXMap DatXmlReq ORMap DatElections, DatResults The
CmdElections (model) object is the web service Xml request ->
xml response Encapsulate your business rules! Dont put business in
a channel, portlet, oracle form, etc. The model layer can be fired
off from a Servlet, Apache Axis, etc.
Slide 35
35 Course ID 945 Election Channel Sequence Diagram Student logs
into Luminis, then CElections channel Ids the person Determines
permissions Creates the xml request Https post to web service Read
response Display channel The Elections web service Parses xml
request Ids the person & role Reads elections & results for
that person Creates the xml response Returns xml to the channel
post Use JDBC to read Elections datastores GUBSRVY - surveys
GURSRVQ - questions BURSVRL - roles Student votes & reviews
Elections Clicks on cp link Uses SSO to navigate to SSB Admin sets
up Elections Clicks on cp link Uses SSO to navigate to INB
Slide 36
36 Course ID 945 Election Channel Parse Request How to parse
the XML request Use JDOM packages Encapsulate the request as a DOM
document DatXmlReq class does XML to object mapping Populating the
DOM document Parse the XML request with SAXBuilder Document becomes
a DOM tree Navigate & Extract info Get the doc root element Use
XPath to navigate to all elements Iterate the Java list Extract
text to obtain the wId JDOM is a simple way to parse, navigate, and
extract info from an XML document (webserv snipplet) import
org.jdom.*; // properties... protected Document doc; // parse
request SAXBuilder builder = new SAXBuilder(); doc =
builder.build(new StringReader(xmlReq)); (webserv snipplet) //
xpath to tag Element root = doc.getRootElement(); List list =
XPath.selectNodes(root,"/electionChannel/auth/userid");
ListIterator i = list.listIterator(); if ( i.hasNext() ) { Element
e = (Element) i.next(); wid = (String) e.getText(); } return
wid;
Slide 37
37 Course ID 945 Election Channel Create Response How to create
the XML response Use JDOM packages Encapsulate the response as a
DOM document DatXmlResp class does XML to object mapping Creating
the DOM document Create doc Navigate to root Creating an Election
Enum thru result set Create tag Attach to root Creating Election
Attributes Create element Set its text value Attach to tag Return
XML response Use XMLOutputter JDOM is a simple way to create XML
docs, elements, text, attributes, etc. (webserv snipplet) // create
tag elections = new Document(new Element("elections")); Element
root = elections.getRootElement(); Enumeration e =
datElections.getElectionsList().elements(); while
(e.hasMoreElements()) { DatElections datElections1 = (DatElections)
e.nextElement(); election = new Element("election");
root.addContent(election); election.addContent(new
Element("name").setText(datElections1.getName()));
election.addContent(new
Element("title").setText(datElections1.getTitle()));
election.addContent(new
Element("user").setText(datElections1.getUser())); } (webserv
snipplet) COBA Student Elections 1/1/2007 W001WLN 1/10/2007
1/15/2007 Elections for student officers
Slide 38
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
38 Alerts Channel Lets look at Banner API Development more
closely.
Slide 39
39 Course ID 945 Alerts Channel - Overview The Alerts Channel
exposes the View Holds service into a Luminis custom channel The
portal user sees alerts targeted to them personally each morning
They can view the alerts or (if an admin) can manage alerts Channel
permissions The implementation follows the same single design
pattern Post/response to the web service to obtain all Banner
alerts for the user Communications between layers with XML WSU API
encapsulates the alerts databases Seamless navigation to SSB We
extended Banner with two new tables - the Alerts and Profile table
The Alerts table is a collection point for Banner alerts that are
of interest to an admin Alerts populated each night Alert is run
immediate from database Allows channel to render quickly The
Profile table contains definitions of alerts. An Alerts admin Uses
the Alerts channel to define an alert Defines the SQL to populate
the alert Defines the URL to view the alert Activate & Inactive
Alerts
Slide 40
40 Course ID 945 Alerts Channel - Demo Lets look at my current
set of alerts Note, the alerts that are visible in the channel
Alerts populated last night Lets view an alert Seamless navigation
Now, lets define a new alert Lets inactivate an existing alert
Note, the web service does the actual operations
Slide 41
41 Course ID 945 Alerts Channel DB Diagram This is the Banner
extension that supports alerts Banner alerts can be gleaned from
many sources SPRHOLD Student Holds RRRAREQ FinAid Requirements
SRBGRP Reg Groups Etc. The Alerts extension is composed of two
tables & a package The Alerts table collection point for Banner
alerts Alerts populate at 2 am every night Alert is run immediate
from database Alert maps to pidm, name, etc. URL defines where to
view the alert The Profile table is the definition of an alert
Alerts admin defines the alert from the channel SQL column tells
the package how to populate the alerts table URL defines where to
view the alert Status column tells the package which profiles are
active The WsuGenAlerts package encapsulates the alert tables. It
Populates the alerts table based upon active profiles CRUDs the
Alerts & Profile tables
Slide 42
42 Course ID 945 Alerts Channel Create an Alert An alert
profile is created in the Alerts channel The portal user must have
Alerts Admin permissions The SQL column defines the alert. It must
adhere to the sample select statement given. The URL column defines
where the user should go to view the alert When the Submit button
is clicked, the channel Forms the XML document It sends the XML to
the Web Service The web service calls the insert stored proc
through the JDBC to create a new profile Note, the Alerts Admin
also has the ability to easily activate & inactivate an alert
Note, since the alert definition is simple SQL, the alert could
come from anywhere (channel snipplet) NBA New Banner Alert select
pidm, name, etc. http://oas2.wright.edu A w001wln 03/06/2007
16:55:01
Slide 43
43 Course ID 945 Alerts Channel Populate alerts The Alerts are
populated by the WsuGenAlerts package The CRON utility fires the
populate method off every night at 2 am The procedure Truncates all
alerts Cursors through the active profiles Fetches each profiles
SQL Inserts into the alerts table Execute immediate Warning: This
could be a long running job Its populating alerts for all
constituents of the University Faculty, Staff, Students, etc.
Although, it does enables quick rendering of alerts in the Alerts
Channel (db snipplet) -- truncate alerts truncateSql := 'truncate
table alerts'; execute immediate truncateSql; -- cursor thru
profiles open profileCursor; loop fetch profileCursor into
profileRec; exit when profileCursor%notfound; profileName :=
profileRec.profile_name; profileSql := profileRec.profile_sql; --
insert alerts insertSql := ' insert into alerts ' || profileSql;
execute immediate insertSql; end loop; close profileCursor; commit
work;
Slide 44
A Community of Learning SUNGARD SUMMIT 2007 | sungardsummit.com
44 Future Directions Refining and Refactoring this solution.
Slide 45
45 Course ID 945 Future Directions Apache Axis? WSUs custom web
services are propriety We would like to standardize them with
Apache Axis It is an implementation of the SOAP ("Simple Object
Access Protocol") submission to W3C. It is free Just like Tomcat.
It works with standard protocol & XML envelopes Note, there
would be very little change to the model layer of the web service
just the means of communication Portlets? Java Portlet Specfication
(JSR 168) Luminis 4.0 supports the Portlet API Drawback - migrating
channels to portlets Could an Apache Pluto portlet be installed
into Luminis 4.0?
Slide 46
46 Course ID 945 Summary We have Demonstrated how to expose
Banner services through the Luminis platform Showed how we
developed and deployed our In- House custom channels Showed how we
leveraged Banner SSO and CPIP connectors Showed how to write some
simple (yet effective) Web Services Showed how to exploit and
extend the Banner API
Slide 47
47 Course ID 945 Questions & Answers Be sure to leave about
10-15 minutes for questions from your audience
Slide 48
48 Course ID 945 Thank You! Wallace Neikirk, Senior
Programmer/Analyst, Wright State University Main Campus
[email protected] Please complete the online class
evaluation form Course ID 945 SunGard, the SunGard logo, Banner,
Campus Pipeline, Luminis, PowerCAMPUS, Matrix, and Plus are
trademarks or registered trademarks of SunGard Data Systems Inc. or
its subsidiaries in the U.S. and other countries. Third-party names
and marks referenced herein are trademarks or registered trademarks
of their respective owners. 2006 SunGard. All rights reserved.