edu.uiuc.cites.web.XMLPortlet
Andy Gherna (agherna@uiuc.edu)
Purpose
Provide a base class for portlets that are either:
- Being ported from uPortal IChannels (preserving XSL/XML developed previously)
- Being newly developed that want to use XML and XSL to render their views
How to build
Run ant webArchive in the root directory. This will generate dist/XMLPortlet.war.
How to deploy to uPortal
$uPortal_Home is assumed to be the base directory of your uPortal instance
- Copy dist/XMLPortlet.war to $uPortal_Home/lib/portlets
- Run ant deployPortletApp -DportletApp=$uPortal_Home/lib/portlets/XMLPortlet.war from $uPortal_Home.
Directory Structure
The recommended directory structure for portlets based on this class is close to an IChannel:
| Directory | Purpose |
| src/ | Root of source tree |
| bin/ | Root of classes tree (generated by build.xml) |
| dist/ | Directory to generate .war file to (generated by build.xml) |
| webpages/WEB-INF | Location of portlet.xml and web.xml (and other files if needed) |
| webpages/media | Root of tree for custom css files |
| webpages/xml | Root of tree for xml/xsl files |
| lib/ | Location of external jars |
Any static XML, XSL and css files should be stored under their respective directory in a tree that corresponds to the class name that uses it. For example, the view xsl for XMLPortlet would be stored under webpages/xml/edu/uiuc/cits/web/XMLPortlet/view.xsl.
Initialization Parameters for XMLPortlet
| Name | Value | Purpose |
| under-test | true or false | Useful for testing behavior on a workstation. For example, you could use this to tell the portlet to use a test-id for a call to a remote datasource rather than the real user-id (which may not be available in test) |
| debug-output | true or false | Useful for sending debug output to a log (note implementing commons- logging would obviate the need for this parameter--see TODO items below) |
Preferences for XMLPortlet
There are a number of preferences for XMLPortlet. The important ones are the locations of the xml and xsl files. See portlet.xml for the names and values of these preferences.
TODO Items
- Create a step-by-step port of an IChannel to a portlet.
- Create a sample new portlet with XMLPortlet.
- Implement translet caching via TemplatesPool (currently none is used)
- Implement commons-logging. This will eliminate the need for the
debug-output parameter - Document the TemplatesPool, UnavailableServiceMessage and MessageGenerator
classes.
Contact Information
Andy Gherna
email: agherna@uiuc.edu
phone: (217) 265-9490
