Hi,
I'm currently involved in integrating SharePoint with IBM Connections and I'm having a lot of fun trying to figure out all the possibilities. Since these integration considerations are not specific to SharePoint/IBM Connections, I'll blog a series of posts which will be rather short or rather long according to the topic I'm focusing on.
In this post, I'm going to focus on HTML5 postMessage. The HTML5 PostMessage API is another means to allow cross-origin communication. In a nutshell this is based on iframes or windows that are used as intermediate objects to establish the communication between the parent page and the child page as shown below:
- 1. The parent page embeds an IFRAME that points to the child page. Both the child page and the parent page declare a onmessage handler to receive incoming messages
- 2. The parent page sends a message, usually in JSON format to the child page using the htmlPostMessage method of the IFRAME object
- 3. The child page potentially replies something
There are other modes based on popup windows but the concepts are similar.
Scenario
In this post, I'm going to elaborate on a scenario where a page hosted in IBM Connection consumes SharePoint data. Here is a screenshot of that page:
When clicking on the buttons, the page retrieves in JSON format either the list of documents (excluding pptx) authored by the current user, either the list of presentations (only pptx).