What |
script_config.xml |
---|---|
Description |
Configuration of a script in the Water Coach |
schema location |
script_config.xsd |
In a script configuration, the start and end time, and events for the script are specified. A script is a directory in the scenario/script database in which files relevant for that script are collected, including the script configuration file. For more information, see scenario/script database.
|
|
|
|
An example in which conditions are used:
<frame> <title>condition example</title> <start date="2008-03-13" time="00:01:00"/> <stop date="2008-03-13" time="00:02:00"/> <popup>true</popup> <condition> <columnId>water_level</columnId> <rowId>Lowestoft</rowId> <ifForecastPublished> <operator>eq</operator> <value>false</value> </ifForecastPublished> </condition> <message>Hurry, the forecast for Lowestoft has not been published yet!</message> </frame> <frame> <title>condition example</title> <start date="2008-03-13" time="00:10:00"/> <stop date="2008-03-13" time="00:11:00"/> <popup>true</popup> <condition> <columnId>water_level</columnId> <rowId>Lowestoft</rowId> <ifForecastPublicationTime> <operator>after</operator> <value date="2008-03-13" time="00:10:00"/> </ifForecastPublicationTime> </condition> <message>You were quite late with the forecast for Lowestoft</message> </frame> <frame> <title>condition example</title> <start date="2008-03-13" time="00:15:00"/> <stop date="2008-03-13" time="00:16:00"/> <popup>true</popup> <condition> <columnId>water_level</columnId> <rowId>Lowestoft</rowId> <ifForecastValue> <operator>ge</operator> <value>300</value> </ifForecastValue> </condition> <file>emergency_telephone_call.mp3</file> </frame> |
An event can be associated with a story frame by specifying the file
key. Depending on the file type, a suitable application is started for displaying the file (e.g. a pdf-file is displayed in Adobe Reader and the contents of a txt-file is displayed in a message dialog window). The file
key has an optional language attribute lang
that behaves the same as for the title
keys.
Apart from a file
, an event for the story frame may also be a message
. For such a message, no file has to be added to the scenario/script database. Instead, the contents of the message (a text string) can be specified directly in the script configuration. The message
key takes an optional lang
attribute as explained before. If the message contains an URL (starting with 'http://', 'https://', 'ftp://' or 'mailto:// ' and ending with '/') then this URL is made clickable automatically.
The contents of the forecast table can be configured using the forecastTable
key. The schema for this section is as follows:
Using the header
key, the column headers in the forecast table can be specified. A column can be added with the the column
key. The value of this key is used as the name in the header of that column. For each column an id
attribute must be specified. Furthermore, the following optional attributes may be specified for a column:
unit
: a string containing the unit for the column (e.g. "cm" for a water level), which will also appear in the header of the column,type
: one of "string", "integer", "float", "boolean", or "dateTime", which indicates the type of data that is displayed in the column,isEditable
: a flag with value true
or false
indicating whether the column is editable for the user (e.g. the user can enter the forecast in this column),isExport
: a flag with value true
or false
indicating whether the column must be exported to file if the forecast is published (editable columns are exported by default),exportName
: a string containing the name that must be used for exporting the column to file,lang
: a string that specifies the language of the header; this attribute behaves the same as for the title
keys.For example, the header section in the forecast table may look like:
<header> <column id="station">station</column> <column id="date">date</column> <column id="time">time</column> <column id="astro_level" unit="cm">astronomical water level</column> <column id="water_level" isEditable="true" unit="cm">water level</column> <column id="evacuate" isEditable="true" type="boolean">evacuate?</column> </header> |
Rows can be added to the forecast table by specifying the row
key. The number of rows is arbitrary. For each row, an identifier must be specified using the id
attribute. Content for a row is added using the cell
key, where each cell must correspond to a column in the header. This can be achieved with the columnId
attribute of the row
key. For example:
<row id="Vlissingen"> <cell columnId="station">Vlissingen</cell> <cell columnId="date">12 Mar</cell> <cell columnId="time">17h16</cell> <cell columnId="astro_level">237</cell> </row> |
The cell
key also supports a lang
attribute that behaves the same as for the title
keys.
With the publication of a forecast, a note can be attached. An optional initial text in this note field can be specified with the forecastNote
key.
A dictionary can be added to a script for helping the user to look up words and definitions. These words have to be configured in a dictionary file. The key dictionaryFile
contains the path to such a dictionary file. This key may be specified an arbitrary number of times in the section dictionaryFiles
. The schema for a dictionary file is as follows:
A complete example of a script configuration is given here:
<?xml version="1.0" encoding="UTF-8"?> <!-- edited with XMLSpy v2009 sp1 (http://www.altova.com) by ICT (Stichting Deltares) --> <script 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/watercoachschemas/version1.0/script_config.xsd"> <title>Demonstration</title> <dataStart date="2007-10-04" time="10:00:00"/> <scriptStart date="2012-11-23" time="09:55:00"/> <scriptStop date="2012-11-23" time="13:00:00"/> <stories> <inbox> <title>inbox</title> <frame> <title lang="EN">Session start</title> <start date="2012-11-23" time="10:00:05"/> <popup>true</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <requiredExperienceLevel>1</requiredExperienceLevel> <file lang="EN">start_session.txt</file> </frame> <frame> <title lang="EN">KNMI analysis_1</title> <start date="2012-11-23" time="10:01:05"/> <popup>false</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <requiredExperienceLevel>1</requiredExperienceLevel> <file lang="EN">windfield_03111200.pdf</file> </frame> <frame> <title lang="EN">Assignment 1</title> <start date="2012-11-23" time="10:11:00"/> <popup>false</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <once>true</once> <file lang="EN">assignment_1.txt</file> </frame> </inbox> <story color="aquamarine"> <title>KNMI</title> <frame> <title lang="EN">Telephone call</title> <start date="2012-11-23" time="10:01:00"/> <stop date="2012-11-23" time="10:10:00"/> <popup>true</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <requiredExperienceLevel>1</requiredExperienceLevel> <file lang="EN">phonecall_knmi_1.txt</file> </frame> <frame> <title lang="EN">KNMI phoneline is busy</title> <start date="2012-11-23" time="10:11:00"/> <stop date="2012-11-23" time="11:00:00"/> <popup>false</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <requiredExperienceLevel>1</requiredExperienceLevel> <message lang="EN">KNMI phoneline is busy. PLease try again later.</message> <message lang="NL">KNMI telefoonlijn is ingesprek. Probeer het later nogmaals.</message> </frame> </story> <story color="goldenrod"> <title>HMCZ</title> <frame> <title lang="EN">Telephone call</title> <start date="2012-11-23" time="11:02:00"/> <stop date="2012-11-23" time="12:02:00"/> <popup>false</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <file lang="EN">phonecall_hmcz_1.txt</file> </frame> </story> <story color="forest green"> <title>HMCN</title> <frame> <title lang="EN">Telephone call</title> <start date="2012-11-23" time="10:03:00"/> <stop date="2012-11-23" time="12:03:00"/> <popup>false</popup> <requiredExperienceLevel>0</requiredExperienceLevel> <file lang="EN">phonecall_hmcn_1.txt</file> </frame> </story> </stories> <forecastTable> <header> <column id="sector">sector</column> <column id="station">station</column> <column id="astro_date" lang="EN">date</column> <column id="astro_time" lang="EN">time astro high tide</column> <column id="astro_level" unit="cm" isExport="true" exportName="H.tidal.astronomic">astro water level</column> <column id="svsd_forecast" unit="cm" isEditable="true" exportName="H.tidal.peak">forecast</column> </header> <row id="Vlissingen"> <cell columnId="sector">Schelde</cell> <cell columnId="station">Vlissingen</cell> <cell columnId="astro_date" lang="EN">January 1</cell> <cell columnId="astro_time">19:16</cell> <cell columnId="astro_level">237</cell> </row> <row id="HoekVanHolland"> <cell columnId="sector">West Holland</cell> <cell columnId="station">Hoek van Holland</cell> <cell columnId="astro_date" lang="EN">January 1</cell> <cell columnId="astro_time">20:01</cell> <cell columnId="astro_level">122</cell> </row> </forecastTable> <forecastNote> <initialText lang="EN">Here you can add notes to support your forecast.</initialText> </forecastNote> <dictionaryFiles> <dictionaryFile lang="EN">Dictionary_1.xml</dictionaryFile> </dictionaryFiles> </script> |