You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

FEWS Game script configuration

What

script_config.xml

Description

Configuration of a script in the FEWS Game

schema location

script_config.xsd

In a script configuration, the start and end time, and events for the script are specified. A script must be a directory in the scenario/script database in which files relevant for that script are collected.

Schema definition overview

The global structure of the XML-schema for the script configuration is as follows:

The Title key is an optional identifier for the script. The start and end date/time for the script have to be specified using attributes date and time in the format YYYY-MM-DD and hh:mm:ss, respectively. The NextEventButton key can be set to true or false and indicates whether or not a button for proceeding to the next event in the script must be included in the user interface. The configuration of events (or stories) and the forecast table for a script are explained below.

Stories

In the section Stories of the script configuration, an arbitrary number of stories can be specified. Two types of stories can be specified:

  • Inbox is optional and may be specified only once. The inbox consists of events (or messages) that are put in the inbox, which can be activated by the user.
  • Story can be specified an arbitrary number of times. Each story corresponds to a button in the user interface that can be activated by the user. The content of story buttons can be dynamic, i.e. different events may be triggered by pushing the story button at different times.

Each story must have a title by specifying the Title key (but the title for the inbox is optional). This title will be used as the title of the story button. The title can be different for various languages:

<Story>
   <Title lang="NL">Telefoongesprek</Title>
   <Title lang="GE">Anruf</Title>
   <Title>Telephone call</Title>
</Event>
If the language attribute for {{Title}} is specified and it corresponds to the preferred language in the [application configuration|Application configuration], then this title is used in the script. If no language attribute is found that corresponds to the preferred language, then the default {{Title}} for which no language attribute was specified will be used.

A story may consist of an arbitrary number of frames according to the following schema:

The title of a frame in the inbox will be used in the list of actions that the user can invoke from the inbox drop-down menu. As explained above, the title can be different for various languages.

The {{Start}} and {{Stop}} keys indicate the time window in which the frame of a story is active. For a frame in the inbox this means that the associated event is available in the inbox between the start and stop time. For a frame in a regular story, the associated event will be executed if the user pushes the story button between the start and stop time. The {{Start}} and {{Stop}} keys have attributes {{date}} and {{time}} following the format {{YYYY-MM-DD}} and {{hh:mm:ss}}, respectively. Both the {{Start}} and {{Stop}} keys are optional. If these are not specified, then these default to the start and end time of the script, respectively.

The {{Popup}} key is a flag indicating whether or not to show a pop-up window at the start of the frame. For a frame belonging to the inbox this means that the associated event is executed. For a frame of a regular story, a message dialog appears informing the user that new content is available for a story, which can trigger the user to activate the relevant story button.

A condition can be added to a story frame; the associated event will only be executed if this condition is fulfilled. For now, the only supported condition is one based on a forecast published by the user. A condition must be specified according to:
!condition.png|border=1!
where
* {{Type}} must be equal to "Forecast",
* {{ColumnId}} is a reference to a column in the forecast table (see [below|#Forecast Table]), usually a parameter,
* {{RowId}} is a reference to a row in the forecast table (see [below|#Forecast Table]), usually a location,
* {{Operator}} is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), or "ge" (greater than or equal to), and
* {{Value}} is the reference value to compare to.

An example in which a condition is used:
{code:xml}
<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>
      <Type>Forecast</Type>
      <ColumnId>water_level</ColumnId>
      <RowId>Lowestoft</RowId>
      <Operator>ge</Operator>
      <Value>300</Value>
   </Condition>
   <File>emergency_telephone_call.txt</File>
</Event>

One of the following two actions can be associated with an event:

  • File: the specified file is executed (e.g. a pdf-file that is displayed in Adobe Reader),
  • NewTime: the scenario time is shifted to the specified time.

The File-key has an optional language attribute that behaves the same as for the Title-key.

Forecasts

Locations for which a water level forecast must be made are specified in the Forecasts-section. The schema for this section is as follows:

The time zone can be specified with the TimeZone-key; for now, only "GMT" is supported.

For each forecast in the list of forecasts, the following items must be specified:

  • Sector: the name of the sector to which the forecast station belongs,
  • Station: the name of the forecast station,
  • FewsLocation: the name of the forecast station in the FEWS configuration,
  • AstroDateTime: the date/time of the astronomical high tide for which a water level forecast must be made,
  • AstroWaterLevel: the astronomical water level of the high tide.

The AstroDateTime-key has two attributes date and time with format YYYY-MM-DD} and {{hh:mm:ss, respectively.

Example

A complete example of a scenario configuration is given here:

Example of scenario configuration
<?xml version="1.0" encoding="UTF-8"?>
<Scenario xmlns="http://localhost" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost ../../xml-schemas/scenario_config.xsd">
   <Name>storm surge March 10-13</Name>
   <Start date="2008-03-12" time="04:00:00"/>
   <Stop date="2008-03-12" time="18:00:00"/>
   <NextEventButton>yes</NextEventButton>
   <Events>
      <Event>
         <Title lang="NL">Start zitting</Title>
         <Title lang="EN">Session start</Title>
         <Type>static and dynamic</Type>
         <Time date="2008-03-12" time="04:00:05"/>
         <File lang="NL">start_zitting_NL.txt</File>
         <File lang="EN">start_zitting_EN.txt</File>
      </Event>
      <Event>
         <Title lang="NL">KNMI weeranalyse 12 maart, 0:00 uur</Title>
         <Title lang="EN">KNMI analysis March 12, 12:00 midnight</Title>
         <Type>dynamic</Type>
         <Time date="2008-03-12" time="04:00:05"/>
         <File lang="NL">weerkaart_12maart_00uur.pdf</File>
         <File lang="EN">weerkaart_12maart_00uur.pdf</File>
      </Event>
      <Event>
         <Title lang="NL">KNMI weeranalyse 12 maart, 12:00 uur</Title>
         <Title lang="EN">KNMI analysis March 12, 12:00 noon</Title>
         <Type>dynamic</Type>
         <Time date="2008-03-12" time="04:00:05"/>
         <File lang="NL">weerkaart_12maart_12uur.pdf</File>
         <File lang="EN">weerkaart_12maart_12uur.pdf</File>
      </Event>
      <Event>
         <Title lang="NL">KNMI weeranalyse 13 maart, 0:00 uur</Title>
         <Title lang="EN">KNMI analysis March 13, 12:00 midnight</Title>
         <Type>dynamic</Type>
         <Time date="2008-03-12" time="04:00:05"/>
         <File lang="NL">weerkaart_13maart_06uur.pdf</File>
         <File lang="EN">weerkaart_13maart_06uur.pdf</File>
      </Event>
      <Event>
         <Title lang="NL">Telefoon KNMI</Title>
         <Title lang="EN">Telephone call KNMI</Title>
         <Type>static and dynamic</Type>
         <Time date="2008-03-12" time="04:10:00"/>
         <File lang="NL">telefoon_knmi_bericht1_NL.txt</File>
         <File lang="EN">telefoon_knmi_bericht1_EN.txt</File>
      </Event>
      <Event>
         <Title lang="NL">Opdracht 1</Title>
         <Title lang="EN">Exercise 1</Title>
         <Type>static and dynamic</Type>
         <Time date="2008-03-12" time="04:11:00"/>
         <File lang="NL">opdracht1_NL.txt</File>
         <File lang="EN">opdracht1_EN.txt</File>
      </Event>
   </Events>
   <Forecasts>
      <TimeZone>GMT</TimeZone>
      <Forecast>
         <Sector>Schelde</Sector>
         <Station>Vlissingen</Station>
         <AstroDateTime date="2008-03-12" time="17:16:00"/>
         <AstroWaterLevel>237</AstroWaterLevel>
      </Forecast>
      <Forecast>
         <Sector>West Holland</Sector>
         <Station>Hoek van Holland</Station>
         <AstroDateTime date="2008-03-12" time="18:01:00"/>
         <AstroWaterLevel>122</AstroWaterLevel>
      </Forecast>
   </Forecasts>
</Scenario>
  • No labels