Servers

Server

Type: object

Field Type Default Description
id string Required The identifier of the server. Can be any string not starting with underscore (_).
Class ServerClass SyntoolAPIServer The API server class.
... ... ... The configuration fields of the Class.

ServerClass

Type: Any subclass of APIServer (or of it's subclasses, etc...)

LocalAPIServer and RemoteAPIServer are the only subclasses defined in Syntool.
SyntoolAPIServer is the only subclass of RemoteAPIServer defined in Syntool.

APIServer

Type: Abstract class

This is the parent of all the API server classes usable in Syntool.

TODO

LocalAPIServer

Type: Abstract subclass of APIServer

TODO

Example

The actual implementation of LayerAPIServer which handles all Layer products.

import {LocalAPIServer} from '/js/syntool.js';

export class LayerAPIServer extends LocalAPIServer {
  /*Public*/
  handlesAllProductsOfType(type) {
    return type === 'LAYER';
  }

  /*Protected*/
  _getAllInfosForProductWithId(productId) {
    var product = this.api.syntool.productsStore.getProduct(productId);

    // TODO: cache these info objects
    return [
      {
        productId: productId,
        datasetId: productId + '-layer_dataset',
        name     : product.layer.title,
        start    : product.validFrom,
        end      : product.validTill,
      },
    ];
  }
}

RemoteAPIServer

Type: Abstract subclass of APIServer

TODO

Configuration fields

Field Type Default Description
serviceURL URL Required The URL of the Syntool services server (or a compatible one).
dataURLs URL[] Optional A list of URLs to use for requesting data (tiles, GeoJSON, ...). All URLs MUST be equivalent, a list is given in order to circumvent the browser's limitation on the number of simultaneous requests to one domain.
productIdMap ProductIdMap Required A map from IDs of products in the config to IDs known by the server (which can be the same).
supportsComplexPatterns boolean false Indicates whether or not the server represented by this class supports complex patterns. See Pattern for more info on complex patterns.
productFilterMap ProductFilterMap Optional If given, will be used to avoid emitting API requests for products that will always return no results for the selected dataset filters.

Note: dataURLs is Required if at least one of the products handled by the server will fetch data (tiles, GeoJSON, ...) from it.

ProductIdMap

Type: {[id: string]: string|string[]}

The key (id) is the product's ID used in this config referencing id of Product.
The value is the product's ID known by the server, or a list product IDs known by the server to be merged together client-side and presented to the user as one product.

Note: The key and value can be the same (and generally are).

Note: All product IDs MUST be IDs of existing products in the config.

Example
{
  'ARGO_Deep_NATL1000': '3857_ARGO_Deep_NATL1000',
  '3857_SAR_roughness': [
    '3857_Sentinel-1A_SAR_roughness',
    '3857_Sentinel-1B_SAR_roughness',
  ],
}

ProductFilterMap

Type: {[filterName: string]: string|string[]}

The key (filterName) is the name of the dataset filter (see DatasetFilter).
The value is a product ID known by the server, or a list product IDs known by the server, that require the dataset filter filterName to be selected in order to return any result.

Note: Each product ID listed in this map MUST have all the products using it define a dataset filter for each filterName it's listed under.

Note: When a product ID is listed under multiple filterNames, it would require ANY of filterNames to be selected in order to return any result.

Example
{
  'A': [
    '3857_Sentinel-3_OLCI_true_RGB',
    '3857_Sentinel-3_SLSTR_false_RGB',
    '3857_Sentinel-3A_OLCI_Chlorophyll_a_oc4me',
  ],
  'B': [
    '3857_Sentinel-3B_OLCI_true_RGB',
    '3857_Sentinel-3B_SLSTR_false_RGB',
    '3857_Sentinel-3B_OLCI_Chlorophyll_a_oc4me',
  ],
}

SyntoolAPIServer

Type: Subclass of RemoteAPIServer

Configuration fields

In addition to the configuration fields of RemoteAPIServer:

Field Type Default Description
datasetsResponseLimit integer > 0 5000 The maximum number of datasets returned from the /datasets endpoint. Configurable on the server with results_limit.
Example
{
  id: 'example',
  serviceURL: 'https://syntoolws.example.com',
  dataURLs: [
    'https://syntooldata1.example.com',
    'https://syntooldata2.example.com',
    'https://syntooldata3.example.com',
    'https://syntooldata4.example.com',
    'https://syntooldata5.example.com',
    'https://syntooldata6.example.com',
    'https://syntooldata7.example.com',
    'https://syntooldata8.example.com',
    'https://syntooldata9.example.com',
    'https://syntooldata10.example.com',
  ],
  productIdMap: {
    '3857_ARGO_Deep_NATL1000': '3857_ARGO_Deep_NATL1000',
  },
}

A note on relative GranuleInfoResource urls

All relative GranuleInfoResource urls will be resolved using their dataset's uri field, which is: