Data Export Configuration

From Fusion Registry Wiki
Revision as of 07:56, 12 August 2020 by Mnelson (talk | contribs) (Overview)
Jump to navigation Jump to search

Overview

As the Fusion Data Browser talks directly to the web services of the Fusion server it is connected to (Fusion Reigstry / Fusion Edge Server / other) - the supported export formats are defined by the product. As these can change over time, and as there are so many export formats and parameters, the desired exports and parameters for these are controlled in the Fusion Data Browsers export configuration file.

The configuration file is named exportconfig.json and is located under the properties folder, and will look something like this:

{
 "Parameters" : {
   "DimAtObs" : {
     "Label": "data.export.param.dimatobs",
     "Parameter": "dimensionAtObservation",
     "DimensionOptions" : {
       "IncludeTime" : true,
       "Required" : true
     }
   },
   "Slice" : {
     "Label": "data.export.param.slice",
     "Parameter": "slice",
     "DimensionOptions" : {
       "IncludeTime" : false,
       "Required" : false
     },
   }
   "Detail" : {
     "Label": "Attributes",
     "Parameter": "detail",
     "Options" : [
       {
         "Label" : "Include",
         "Value" :  "full"
       },{
         "Label" : "Exclude",
         "SubText" : "Exclude series and observation attributes",
         "Value" :  "dataonly"
       }
     ]
   }, 
 },
 "ExportFormats" : [
   {
     "Label" : "CSV",
     "Format" : "csv",
     "FixedParameters" : {
       "labels" : "both"
     }
   },
   {
     "Label" : "Excel Series",
     "Format" : "excel-series",
     "Parameters" : ["Slice", "DimAtObs"],
     "FixedParameters" : {
       "labels" : "both"
     }
   }
 ]
}

The file is broken into two main sections: Parameters and ExportFormats.

Parameters

The parmaeters section enable export parameters to be defined once, and re-used by any number of exports that require them. An export parameter is always a choice which is presented to the user when they opt to export the data in any ExportFormat that makes use of the parameter.

Each parameter has:

  • an Alias, this is used by the ExportFormat to reference it.
  • a Label, presented to the user in the export data form. This can be a Locale label in the language file, for example data.export.param.slice will resolve to the label Slice in the English language file
  • a Parameter. This is the REST query parameter that is used when it transmits the parameter in the data query to the server.

Example:

"Detail" : {
  "Label": "Attributes",
  "Parameter": "detail",
  "Options" : [ ... ]

In the above example Detail is the alias, Attributes will be the label shown on the form next to the drop down select control, and the REST query parameter sent to the server will be detail. If, for example the user selects an option with the Value full then the server will recieve the query parameter detail=full

To present the user with a list of values they can choose for the Parameter, there are 2 choices:

  1. a fixed list of options
  2. a dynamic list of options taken which are derived from the available Dimensions for the dataset being exported.

Fixed List Parameters

Fixed list parameters are defined in the Options array. Each Option has the following properties:

  • Label - required, this is the label in the drop down
  • SubText - optional property, if provided it will appear in the select option next to the label as a smaller sub-text label
  • Value - the value that will be passed to the server if this option is selected, an empty string is used to indicate do not pass this parameter

Labels may be defined as properties in the langauge file.

"Detail" : {
  "Label": "Attributes",
  "Parameter": "detail",
  "Options" : [
     {
       "Label" : "Include",
       "Value" :  "full"
     },
     {
       "Label" : "Exclude",
       "SubText" : "Exclude series and observation attributes",
       "Value" :  "dataonly"
     }
  ]
}