Set up data and config APIs for Zegami Client

The Zegami client loads data in the following sequence:

  1. The index.html page with javascript and css is loaded by the browser
  2. Zegami.start is called and expects a div with class="zegami-container" to exist in the body. Zegami.start( config ); Config can either be provided as a javascript object. Alternatively, if the config object contains a field called configUrl, the config will be fetched as a json from this url.
  3. The config endpoint or file is called if applicable, and the config is loaded into Zegami.
  4. The data is downloaded from the dataUrl specified by the config
  5. The XSLT for Zegs is downloaded from the zegXsltUrl specified in the config

The first step in customising the data in Zegami is to open the index.html file and point it at the locations where a config file is to be loaded. If you are offering multiple views on the data or different datasets per user then this endpoint needs to be dynamic.

The dynamic endpoint could be implemented either at the API level – each user gets a different config or at the HTML level – each user gets a templated html file. Alternatively, the dataUrl could be dynamic and the config static.

Powered by BetterDocs