Page tree
Skip to end of metadata
Go to start of metadata

Not supported since 2017.02

Not supported anymore since 2017.02. Please use 30 Config Update Module instead.

Function:

Automatic update of configuration

Where to Use?

Everywhere: locations, locationSets, location and attribute files (DBF or CSV)

Why to Use?

To let the system be updated by other maintenance programs.

Description:

Functionality to automatically import and process regional configuration changes in locations, locationSets, location and attribute files (DBF or CSV)

Available since:

DelftFEWS2008.01, update in 2009.01 (DBF, maplayers), update in 2016.01 (support for CSV maplayer files)

Contents

Overview

To be able to have other programs that maintain the list locations, locationSets etc, it is possible to import configuration changes through an import that imports update script files.
The configuration update works like a regular data import. There is a moduleinstance that imports PI update script files from an import directory. The script file contains options for the next possible configuration updates:

  • addLocation: Add location to the Locations file.
  • addLocationSetItem: Add an existing location to a location set. Also adds location information to linked IdMaps and ValidationRuleSets.
  • removeLocationSetItem: Remove a location from a location set. The location information is also removed from linked IdMaps and ValidationRuleSets.
  • editLocation: Edit an already existing location in the Locations file.
  • editLocationSetItem: Edit linked information for a location that is already present in the locationSet.
  • importRatingCurves: Import rating curves from xml file(s) in the FEWS rating curves format. The imported rating curves are added to the ratingCurves xml file in the RegionConfigFiles directory. If a rating curve with the same ratingCurveId as an existing rating curve is imported, then the existing rating curve will be replaced.
  • importMapLayerFiles: Import dbf and/or csv files that contain location attributes. The imported files are put into the mapLayerFiles configuration directory. This only works for dbf or csv files for which an older version is already present in the configuration. If the files to import would make the configuration invalid, then an error is logged and none of the files will be imported.

Configuration Update Script

This functionality supports CSV files since 2016.01.

ConfigManager

This functionality only works for configurations that are distributed through the database via the Config Manager.

Configuration

Configuration Update Script ModuleConfigFile

See the schema of the import moduleinstance at configUpdateScriptConfig.xsd

The config file is very simple:

ConfigUpdate.xml
<?xml version="1.0" encoding="UTF-8"?>
<configUpdateScriptConfig 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://www.wldelft.nl/fews" 
    xsi:schemaLocation="http://www.wldelft.nl/fews 
                    http://fews.wldelft.nl/schemas/version1.0/configUpdateScriptConfig.xsd">

  <versionIncrement>0.1</versionIncrement>
  <scriptDirectory>$IMPORT_FOLDER$/ConfigUpdate</scriptDirectory>
  <failedDirectory>$IMPORT_FAILED_FOLDER$/ConfigUpdate</failedDirectory>
</configUpdateScriptConfig>

versionIncrement = Number to increment configuration file version with. Note that the increment should be zero in case no version numbers are used in the config files.
scriptDirectory = Location of script files to be imported.
failedDirectory = Files that could not be imported due to an error are copied to this directory.
backupDirectory = Successfully imported files are moved to this directory.

PI Configuration Update Script

In the import directory the configuration update script files should be available. See the schema of the import moduleinstance at pi_configupdatescript.xsd

PI_UpdateScript.xml
<?xml version="1.0" encoding="UTF-8"?>
<configUpdateScript version="1.2" 
   xsi:schemaLocation="http://www.wldelft.nl/fews/PI 
                      http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_configupdatescript.xsd"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI">
   <updateCommand>
     <importMapLayerFiles>
	<importPath></importPath>
     </importMapLayerFiles>
   </updateCommand>

.... or

  <updateCommand>
    <addLocation>
      <location id="loc2" name="loc2">
        <description>description</description>
        <shortName>short</shortName>
        <toolTip>new location</toolTip>
        <x>1</x>
        <y>2</y>
        <z>3</z>
      </location>
    </addLocation>
  </updateCommand>

.... or

  <updateCommand>
    <addLocationSetItem locationId="loc2" locationSetId="Boezem_Poldergemaal_H.meting">
      <idMapData idMapId="IdImportCAW" internalParameterId="H.meting" externalLocationId="C-new-ext" externalParameterId="P-new-ext"/>
      <validationRuleData parameterId="H.meting" hardMax="150" hardMin="-10" rateOfRise="10" rateOfFall="-10"/>
    </addLocationSetItem>
  </updateCommand>

</configUpdateScript>

Note that the importPath is relative to the location of the PI script file.

Sample input and output

Example ConfigUpdateScript.zip

Error and warning messages

Description of errors and warnings that may be generated

Error:

Error message

Action:

Action to fix

Known issues

None

Related modules and documentation

None

Technical reference

Entry in moduleDescriptors:

Specification of: ENTRY and DESCRIPTION in the SystemConfigFiles\ModuleDescriptors.xml

  <moduleDescriptor id="ConfigUpdateScript">
    <className>nl.wldelft.fews.system.plugin.configupdatescript.ConfigUpdateScript</className>
  </moduleDescriptor>
  • No labels