Creating your own custom JSON format for widgets

January 16, 2015

 

I had deployed a DHTML-based widget by simply using the out-of-the-box transforms for retrieving data from a grid. Ideally we may need to create our own custom transform to generate a JSON with our own custom format.

 

We use MicroStrategy’s Block Infrastructure to achieve this. The Block Infrastructure uses the MVC architectural pattern to keep data independent of the presentation layer. A block in the MicroStrategy SDK is simply a data structure that is defined as a set of name-value pairs. We programmatically construct a new grid block in the transform that holds the grid data in a block property. We use WebObjects to retrieve the WebReportGrid object and generate the JSON. We finally call the block’s Renderer interface to convert this in-memory block to be converted into a serialized format. Block renderers for the most typical text formats such as JavaScript Object Notation (JSON) and XML are available in MicroStrategy Web.

 

This block is thus available in our JavaScript file that we can use to parse.

 

 

Please reload

Contact us!

If you are interested in learning more about Third I, please fill out the form below and we'll have one of our specialists contact you directly.

 

FOLLOW US

  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

VISIT US

CONTACT US

info@the3i.com
(703) 272 8209

PRIVACY POLICY     |     Copyright ©  2018 Third I, Inc. All rights reserved.