Data Export Configuration

From Fusion Registry Wiki
Revision as of 08:13, 12 August 2020 by Mnelson (talk | contribs) (Dynamic Dimension Parameters)
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 Registry / 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 parameters 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:

  • Alias. Used by the ExportFormat in order to reference the parameter.
  • 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
  • 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 is the label shown to the user on the export data form. 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 receive 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 language file.

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

Dynamic Dimension Parameters

These parameters are based on the Dimensions in the dataset. For example, if the user can slice the data by a Dimension to create multiple datasets, then the list of available Dimensions cannot be described as a fixed list in the export configuration file, it is expressed as a DimensionOption.

DimensionOptions have 2 properties:

  1. IncludeTime - if true, and the Data Structure Definition has a Time Dimension, this will be included in the choice of Dimensions
  2. Required - if true, then the select will only include the Dimensions as a choice, defaulting to the first in the list. If false, then the first item in the list is a "-" to indicate that no Dimension was selected for this property
"Slice" : {
    "Label": "data.export.param.slice",
    "Parameter": "slice",
    "DimensionOptions" : {
      "IncludeTime" : false,
      "Required" : false
 }

Export Formats

The ExportFormats section of the configuration file contains an array of formats that will be presented to the user when they choose to export data. Each export format has the following properties:

  • Label - The name given to the export format, shown to the user in the drop down selection. Like other labels, this can reference a property in the language configuration file if multilingual labels are required.
  • Format - The format query parameter passed to the server. Refer to the appropriate page to lookup this value.
  • Parameters - An array of references to the Parameters described in the Parameters section.
  • FixedParameters - Any parameters with a single, fixed value. These used in the data query request to the server and are not presented to the user, and therefore cannot be modified by the user.


Note: An export format can contain zero to many Parameters FixedParameters as required, but each format definition should only include parameters which are supported by the chosen data format. Please refer to the appropriate to lookup valid parameters for the format.

{
     "Label" : "Excel Series",
     "Format" : "excel-series",
     "Parameters" : ["Slice", "DimAtObs"],
     "FixedParameters" : {
       "labels" : "both"
     }
   }