I got to spend a little time in the last week or two examining integration of web mapping with BusinessObjects XI R2 Web Intelligence, for a little turbo proof-of-concept application - I hadn't seen many folks talking about integrating web mapping and BO, so I figured I would share my own experiences. Though I'm certainly no BusinessObjects guru, I was able to successfully do some basic integration, with the help of the BusinessObjects "Masher" application available on their "Labs" site: http://labs.businessobjects.com/mashup/default.asp.
What BusinessObjects presents via the Masher is a dynamically-named div tag, which is accessible via container in JavaScript, which is where your rendered DHTML content needs to be targeted. They also then present three basic functions for housing and executing all user-developed JavaScript, init(), mash() and dispose() - the intent of which is self-evident. They also provide some JavaScript objects, pivot and parameters - pivot contains the BO report table contents, and parameters contains values that can be preset and/or passed when initializing or formatting the template.
So, essentially just a matter of figuring out what's available to latch on to and use - and how to leverage what BO provides to permit building the application. For this proof-of-concept, there had been some discussion and interest in Google Maps from the customer, so - for the sake of simplicity, I chose to just stick with Google Maps. In reality, I'd be fairly confident in suggesting that virtually any web mapping framework that supports DHTML and JavaScript should be usable with this same approach, e.g. OpenLayers, Microsoft Virtual Earth, or others.
So, ultimately - the results:
"Turn table into..." (the intent being as simple as "click a button to turn this table or graph into a map")
Being a table, the application has to be able to understand and use designations in the underlying table, from it's "geography" dimension such as "AZ" to latch on to the appropriate mapping geographies. So... Turn map into...
Here, I have my newly published template showing up among the choices as "Google Maps Equal Interval Polygonal Choropleth Map", and click on "OK" - Et voila!
For this quick-and-dirty proof of concept, I just wrote some JavaScript that examines the array of pivot data and the range of values, and then just does some quick calculations to create a lookup table and legend. One trick was to dynamically rewrite BO's generic container div tag to embed two new div elements inside of it, one which I use to hold the map, and a second, which I use to hold my legend - other elements as well as a hidden control panel could be embedded here also.
For generating the classification and legend, a similar type of logic and approach could of course also be applied to a variety of classification schemes such as standard deviations, natural breaks, and so on. I then examine the pivot table to see what geographies are represented, display them on the map rendered with their appropriate hex color values matching their respective measures from the lookup table and add a Google Maps openWindowHtml popup for the click event handler for each location. Within the pivot object, labels are also provided - and given a table with multiple columns of measures, these could either be managed with code to run analysis on both, just thematically map the first, and display the remainder in the popup, and so on - a variety of possibilities for the adventurous coder.
Want to change the number of classification breaks? Didn't like the color scheme?
Within the template, there is opportunity to define parameters - here I set it up to allow me to change the number of classification breaks, starting color, ending color, and so on. And the BO folks nicely even include a color picker. So, for example, I can then retrieve parameters.startColor as a hex value, split it into RGB values and compute even jumps for my color ramp to parameters.endColor, based on the parameters.numBreaks value that the user specifies.
Like so... (deliberately odd colors selected to show the difference...)
Additionally, mash() fires every time the underlying table's filters or results are changed, which is nice, as the map updates accordingly.
Some additional development insights - I decided to keep a lot of my functions in an external .js library - one issue I encountered is that, given everything was encapsulated in the three BO Masher functions init(), mash() and dispose(), whenever I needed to create and use global variables, I needed to do so explicitly, e.g. window.myVarName. Additionally, I noted that BusinessObjects XI R2 uses the dojo JavaScript library... so for fans of dojo, that also provides a great deal of functionality and capability to leverage. As with anything, potential collision with other pieces of code or cross-browser compatibility issues are also a question, but through judicious naming conventions and error handling, these can generally be addressed.
So, while perhaps my turbo solution may not the most elegant, it's nonetheless illustrative that web mapping integration into a BO platform is definitely doable and definitely functional, in this case developed in just a few days' time with a little quick hackery, even for someone who may have web mapping expertise but little prior integration or development experience with a platform like BusinessObjects (such as myself in this instance) - hopefully this will be an encouragement to others who are looking to merge BI tools with geospatial technology, and likewise, hopefully the BI folks will continue to increasingly see the value of geospatial visualization in addition to their charts, graphs and dashboards. I have already seen some very interesting visual geographic trends popping out of the data, which is definitely not anywhere near as evident in some of the more standard BI views. Other possibilities include drilldown, however I found that the masher does not handle hyperlinks embedded in tables well - but within BO, URL-driven access to reports to allow drilldown is definitely a possibility as well.
What the future of the BO Masher is in the future is uncertain, but the potential use case and benefit of such integration is substantial.
In the long run, there will definitely be an ever-emergent intersect between these technologies and tools. All in all, another fun little proof-of-concept. Next, I may want to take on BusinessObjects Xcelsius 2008 and Flex-based integration with web mapping frameworks - will remain to be seen, depending on how various other projects go over the next few months...