|This article is about a lean Portlet API wrapper around the Google Maps API, especially designed for listening to JSR 286 events triggered by other portlets. The sample application is provided as download, including source code.
When we did our Event Payload Transformation Portlet, we were looking for some ready-to-use jsr-286 sample portlets in the public domain, that made use of the portlet API's eventing feature. Unfortunately, there was very little. Moreover, the examples I found were a) either targeted at a specific portal runtime and used more then just the standard portlet api provided by that portal runtime, or b) were unnecessarily using a lot of other frameworks on top.
So here is a simple, but effective google maps event listener sample portlet, with the following features:
- both fine-grained query data objects and simple strings as event payload for each request type
- source code included for own customizations
- compiled with java 1.5, to run e.g. in WebSphere Portal 6.1 and above.
- use this sample at your own risk - no warranty supplied
The String payloads can be directly wired in some portal runtimes, ignoring the qnames, e.g. in WebSphere Portal. For the self-defined data objects in the payload, other portlets on the page will need to explicitly be adopted to throw the corresponding events. Or you can plug-in the payload transformation portlet inbetween, which is freely downloadable from the IBM Solutions Catalog.
A side note: On WP 7.0 sometimes a strange error occurs after first deployment of the google maps portlet app: java.io.FileNotFoundException: JSPG0036E: Failed to find resource /jsp/geocoding/map.jsp/!ut/p/b1... This error vanishes as soon as the map.jsp gets compiled, e.g. by invoking directly http://<myserver>:10039/wps/PA_MapLocator/jsp/geocoding/map.jsp once. Installing APAR PM56153, part of CF012, resolves this issue for WP 7.0....