Skip to content

EventorExtensions

Types

discipline

Helpers for reading the Eventor-specific data carried in IOF XML 3.0 <Extensions> elements emitted by the Eventor REST API.

Eventor writes these under the namespace http://eventor.orientering.se/iofxmlextensions, prefixed eventor:. Typical extension fields appear inside an <Event>'s top-level <Extensions> and inside each <Race>'s <Extensions>:

xml
<Extensions>
  <eventor:EventRaceId type="Eventor">24332</eventor:EventRaceId>
  <eventor:StartListExists>true</eventor:StartListExists>
  <eventor:ResultListExists>true</eventor:ResultListExists>
  <eventor:Discipline>Foot</eventor:Discipline>
  <eventor:Discipline>MountainBike</eventor:Discipline>
  <eventor:LightCondition>Day</eventor:LightCondition>
  <eventor:Attribute id="2">Ukas løype</eventor:Attribute>
</Extensions>

<eventor:Discipline> and <eventor:Attribute> can each appear multiple times. The IOF XSD does not constrain <Extensions> content, so the type here is intentionally Eventor-specific.

rescript
type discipline =
  | Foot
  | MountainBike
  | Ski
  | Trail
  | Indoor
  | OtherDiscipline(string)

Constructors:

  • Foot
  • MountainBike
  • Ski
  • Trail
  • Indoor
  • OtherDiscipline(string)

lightCondition

Whether a race takes place during the day, at night, or both.

rescript
type lightCondition =
  | Day
  | Night
  | DayAndNight
  | OtherLight(string)

Constructors:

  • Day
  • Night
  • DayAndNight
  • OtherLight(string)

attribute

A custom Eventor event attribute. The set of attributes is instance- specific — e.g. the Norwegian Eventor exposes Ukas løype, Paratilbud, etc.

rescript
type attribute = {id: string, value: string}

Fields:

  • id: string — The numeric attribute id assigned by Eventor (as a string, preserving the wire format).
  • value: string — The human-readable attribute name (text content).

t

Eventor extension fields seen on <Event> and <Race> elements.

rescript
type t = {
  eventRaceId: option<string>,
  startListExists: option<bool>,
  resultListExists: option<bool>,
  disciplines: array<discipline>,
  lightCondition: option<lightCondition>,
  attributes: array<attribute>,
}

Fields:

  • eventRaceId: option&lt;string&gt; — Internal Eventor identifier for a race within a multi-race event.
  • startListExists: option&lt;bool&gt; — Whether a start list has been published for this event/race.
  • resultListExists: option&lt;bool&gt; — Whether a result list has been published for this event/race.
  • disciplines: array&lt;discipline&gt; — Eventor's discipline classification. Repeatable — an event/race that accommodates multiple disciplines lists each one separately.
  • lightCondition: option&lt;lightCondition&gt; — Eventor's day/night classification (only on <Race> in practice).
  • attributes: array&lt;attribute&gt; — Custom Eventor attributes attached to the parent element.

Values

emptyExtensions

rescript
let emptyExtensions: t

parseDiscipline

rescript
let parseDiscipline: string => discipline

parseLightCondition

rescript
let parseLightCondition: string => lightCondition

parseBool

rescript
let parseBool: string => option<bool>

fromElement

Extract Eventor extension fields from an arbitrary IOF element (e.g. an <Event> or <Race>). Returns emptyExtensions if the element has no <Extensions> child or no Eventor-namespaced fields inside.

rescript
let fromElement: IofXml.XmlUtils.xmlElement => t