This is the third installment of the BIP and Mapviewer Mashup, for the previous entries:
BIP and Mapviewer Mash Up I
BIP and Mapviewer Mash Up II
BIP and Mapviewer Mash Up III
Its been a hectic couple of weeks which has included all things mapviewer and integration. I have finally got my piece de resistance in mapping integration working but more on that next time. Its very cool in a geeky BIP, kinda way; my wife was completely fascinated when I told her all about it over dinner last night. Either that, or she has become very adept at nodding and saying 'that's nice honeycakes' at appropriate times. I hope the former but suspect the latter :0(
The next part of this mashup series, I said we would parameterize the map call. That's actually pretty easy to do, just a bit more effort with the parameters and the concat functions.
1. Set up your parameters in the data model. These do not have
to be tied to the query. We support 'template ' only parameters.
they just all have to be defined in the datamodel. Note the name
you give to the parameter(s)
2. In your RTF template you need to declare 'interest' in the
parameters. Its the same as the CURRENT_SERVER_URL format.
3. In the fields where you are building the encoded request
string you can use the concat function to drop the parameter
values into the string. In this case we are changing th map title with a parameter called 'title'
<xsl:param xdofo:ctx="begin" name="pMapRq">concat
Its not tough but boy is it a bit of a nightmare to manage and keep track of everything in that encoded URL.
As I mentioned in my last post its a good idea to maintain the parts of the URL as un-encoded text in the template surrounded by an 'if:1=2' if statement to keep it hidden at runtime.
Next post, we get to a much more robust, easier to manage and as I mentioned cooler solution ... enter the mapping servlet. It acts as a map request broker between the BIP template and the mapviewer server. The RTF template is not full of encoded URLs but just a simple URL call to the servlet that will call the mapviewer server and stream the image back to BIP for rendering. I have built in a couple of tricks but more on that next time.