Portlet development for the CREE project CREE Contextual Resource Evaluation Environment Stewart Waller

advertisement
CREE
Contextual Resource Evaluation Environment
Portals and Portlets 2006:
Portlet development for the CREE project
Stewart Waller
sjw143@york.ac.uk
(Archaeology Data Service, University of York)
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
BACKGROUND:
The CREE project arose from the Joint Information Systems Committee programme:
Portals: Investigations into User Requirements
Project Aims:
• Assess, test and document user requirements
• for Internet-based search tools
• both through their native interfaces
• and embedded within portal and non-portal environments
• in a broad range of user contexts.
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT : Historic Environment Information Resources Portal
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT : Zava(x) Framework
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
Portlet to replace the Servlet Interface
Zava Server
Web browser
Zavax Client (Mediation + Transformation)
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
Cocoon outputs plain XML
Zava Server
Web browser
Zavax Client (Mediation)
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
Portlet to communicate directly with Zavax Mediation
Portal Environment
Portlet
Portlet
Portlet
Portlet
Zavax Client (Mediation)
http://www.hull.ac.uk/esig/cree/index.html
Zava Server
CREE
Contextual Resource Evaluation Environment
Portlet to communicate directly with Zavax Mediation
Portal Environment
Portlet
Portlet
Portal Environment
Portlet
Portlet
Portlet
Portlet
Zavax Client (Mediation)
Portal Environment
Portlet
Portlet
http://www.hull.ac.uk/esig/cree/index.html
Zava Server
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : implementation
Core functionality
• Exploited the portlet MVC design
pattern:
• Model held in portlet session as
Java bean
• processAction() acts as Controller
to send/receive XML, updates model
accordingly
• renderAction passes elements of
model, styled using XSLT, to View
JSP’s
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : implementation
Extra functionality
• Notepad
• Export
• (rough) Inter Portlet Communication
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : search
Step 1.
The HEIRPORT framework is based upon the
CIMI profile allowing for searches based on:
What, Where, When, Who, Title, Location by
coordinate etc.
However, for the purpose of this demonstrator,
the portlet has been restricted to a simple
What, Where and When search.
Step 2.
HEIRPORT is based around a multi-threaded
model allowing simultaneous Z39.50 searches
across a number of different target datasets.
The option to choose which targets to query
has thus been presented here.
Step 3.
Pressing the start button begins the search
query.
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : retrieve
Depending on the speed of the various
remote targets, the user is eventually
forwarded to the target summary
screen.
At this point, the user can decide to
fetch the records from a particular
target. The number of ‘records
returned’ and ‘results per page’ can be
configured in the user preferences
screen.
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : present
After HEIRPORT lite has fetched
records from a particular target, the
user is taken to the results screen as
shown here.
The query trail is maintained across
the top of the results listing.
Simple paging links are included.
At this point, the user can select
several records and choose to add
them to the notepad using the ‘update
notepad’ button.
Alternatively, the user can choose to
view more detailed information for a
particular record by clicking on the title
of a particular record.
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : detail
The record details screen provides more
information for the particular record.
The information here is based upon whatever
details the target database contains for that
record. Thus, certain records may be sparse
whilst others may contain rich information
across a number of different fields.
The fields are largely based upon the Dublin
Core metadata standard.
When spatial information is available, a simple
map is generated showing the position of the
record as a red spot. Also links to various
external mapping services are presented.
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : notepad
Throughout the session,
records can be added to the
notepad. This acts in much the
same way as a typical webbased shopping cart system.
That is, the user can add and
remove records as he/she sees
fit.
Using this cart-based system,
the user can aggregate
information from various
searches across different
datasets.
The ability to export the
contents of the notepad in a
number of different formats has
also been included – although
at this point only XML is
available as the chosen output
format.
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : (rough) inter portlet communication
• JSR-168 has no direct support for Inter Portlet Communication
• IBM’s ‘click-to-action’ (C2A) cooperative portlet technology found in recent versions of the WebSphere
portal API is a good example of how future IPC can be implemented as brokered portlet messaging
Using the portlet session to
communicate between two
portlets in the SAME portlet
application:
code to declare portlet extension:
if(ses.getAttribute("extMap")==null)
{
// create ActionURL() for this portlet
PortletURL mapURL = res.createActionURL();
// store PortletURL in portlet session with application scope
ses.setAttribute("mapURL", mapURL,
PortletSession.APPLICATION_SCOPE);
Objects can be stored in either
the PORTLET_SCOPE
or the APPLICATION_SCOPE.
So we can create and store a
PortletURL object within the
APPLICATION_SCOPE
// flag portlet is running
ses.setAttribute("extMap", "running",
PortletSession.APPLICATION_SCOPE);
}
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
HEIRPORT lite : (rough) inter portlet communication
• JSR-168 has no direct support for Inter Portlet Communication
• IBM’s ‘click-to-action’ (C2A) cooperative portlet technology found in recent versions of the WebSphere
portal API is a good example of how future IPC can be implemented as brokered portlet messaging
code to retrieve and amend PortletURL:
Once a PortletURL has been
stored in the
APPLICATION_SCOPE,
Any portlet within the same
portlet application can retrieve
this as a handle to the specific
portlet action method.
Not dynamic – portlet actions can
only be triggered by clicking on
the link rather than by an event
// declare a new PortletURL
PortletURL detailLink;
// is Map Extension running?
if (ses.getAttribute("extMap")!=null)
{
// copy the mapURL from the session object
detailLink=(PortletURL)ses.getAttribute("mapURL");
}
else
{
// use default PortletURL
detailLink=res.createActionURL();
}
http://www.hull.ac.uk/esig/cree/index.html
// amend URL with various action parameters
detailLink.setParameter("mode", "details");
detailLink.setParameter("record", recordID);
CREE
Contextual Resource Evaluation Environment
WSRP: web services for remote portlets
• Used WSRP-4J – Apache Portals Project
• Encountered various issues:
• Portlet preferences locked to either WSRP or Pluto depending on which was called first
• Images didn’t always come through
• Portlet URL didn’t always generate correctly
• WSRP-4J not yet final – still in incubator status
http://www.hull.ac.uk/esig/cree/index.html
CREE
Contextual Resource Evaluation Environment
End.
Questions ?
http://www.hull.ac.uk/esig/cree/index.html
Download