In order to activate the Bolivia import as a FEWS import, it is required to set up a TimeSeriesImportRun module configuration file and an accompanying IdMap file.
For the import to work correctly, the given serverUrl must already contain "?type=XXX&idCountry=XXX" where the XXX are replaced with the relevant values, a relativeViewPeriod must be specified and in the specified id map, the externalLocation must be set to the desired N_IdStation and the externalParameter to the desired N_IdVar. The import will take the serverUrl and append it with "&from=year/month/day&to=year/month/day" where the dates are filled using the relativeViewPeriod found in the import configuration file. It will read the D_DataDate and N_Data fields of the resulting json and map these to the correct time series using the N_IdStation and N_IdVar fields.
Example Import configuration file:
<?xml version="1.0" encoding="UTF-8"?> <timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd"> <!-- This is an example import configuration file for importing Observations and Measurements data from a service --> <import> <general> <importType>DigitalDelta</importType> <serverUrl>http://host/api/interop/GetData?type=XXX&idCountry=XXX</serverUrl> <relativeViewPeriod unit="hour" start="-5" end="0" startOverrulable="true" endOverrulable="true"/> <idMapId>IdImportDD</idMapId> </general> <timeSeriesSet> <moduleInstanceId>ImportDD</moduleInstanceId> <valueType>scalar</valueType> <parameterId>MyPar</parameterId> <locationSetId>MyLocSet</locationSetId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> <synchLevel>1</synchLevel> </timeSeriesSet> </import> </timeSeriesImportRun>
Example IdMap file:
<?xml version="1.0" encoding="UTF-8"?> <idMap version="1.1" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/idMap.xsd"> <!-- map internal timeseries directly to external timeseries externalLocation should be set to N_IdStation externalParameter should be set to N_IdVar --> <map internalLocation="MyLoc1" internalParameter="MyPar1" externalLocation="57100000" externalParameter="3" /> <map internalLocation="MyLoc2" internalParameter="MyPar1" externalLocation="57300000" externalParameter="4" /> </idMap>