EventForm Configuration
The Event form configuration part, of the configuration file, contains all the Form configurations for Application. It is a List(Json-Array) where each object represents a separat EventFormConfiguration.
The EventFormConfiguration consists of these values:
- Id
- Meta
- DeleteAfterFromGeoStore
- DeleteAfterFromDB
- (optional) credentials
- VerificationType
- VerificationValue (not in use yet)
- (verification type dependent) smsConfig
- Fields
- Geometries
- GeoElementProperties
Some values as liquid-template enabled values see the Paragraph to learn more about it.
Localization
All frontend related text values have to be localized via a localization object, this object contains at least an english(en) fallback
Example Configuration
{
(ServiceConfiguration...),
"forms":[
{
"id": "event1",
"meta": {
"logo": "",
"title": {
"en": "Example event",
"de": "Beispiel event"
},
"note": {
"en": "Example Event for testing purposes",
"de": "Ein Beispiel Event für Testzwecke"
},
"contactInformation": {
"name": "LST Musterstadt",
"phone": "-4912345678"
}
},
"deleteAfterFromGeoStore": "PT2M",
"deleteAfterFromDB": "PT5M",
"credentials": (optional) {
"enabled": true,
"user": "test",
"password": "test"
},
"verificationType": "sms",
"verificationValue": null,
"smsConfig": (required by sms verification) {
"verification": {
"en": "Welcome \{\{firstName}} \{\{lastName}}. Pleas verify your phone number here: \{\{verificationLink}}",
"de": "Hallo \{\{firstName}} \{\{lastName}}. Bitte bestätigen Sie Ihre Telefonnummer hier: \{\{verificationLink}}"
},
"reminderBeginn": {
"en": "Hello \{\{firstName}} \{\{lastName}}. Your Example event will begin shortly...\{\{eventLink}}",
"de": "Hallo \{\{firstName}} \{\{lastName}}. Ihr Beispiel-Event beginnt in Kürze...\{\{eventLink}}"
},
"reminderEnd": {
"en": "Hello \{\{firstName}} \{\{lastName}}. Your Example event will end soon...\{\{eventLink}}",
"de": "Hallo \{\{firstName}} \{\{lastName}}. Ihr Beispiel-Event endet in Kürze...\{\{eventLink}}"
}
},
"fields": [
{
"id": "field1",
"label": {
"en": "Field1",
"de": "Feld1"
},
"type": "Text",
"required": true,
"editable": false
},
{...}
],
"geometries": {
"limit": 2,
"area": "jps x | x->IsOfType(germanGemeinde), x->HasValue(name;\"Tübingen\")",
"boundingBox": [48.2, 9.1, 47.1, 9.3],
"validTypes": [
{
"type": "polygon",
"limit": 1,
"maxSize": 1000
},
{...}
]
},
"geoElementProperties": [
{
"key": "type",
"values": [ "eventSite" ]
},
{
"key": "reporter",
"values": [ "\{\{firstName}} \{\{lastName}}" ]
},
{...}
]
},
...
]
}
Meta-Config
The Meta configuration contains general information of the EventForm:
- Logo: url to a eventFrom specific logo(img) to be shown in the frontend form list
- Title (localized): The Title of the EventForm
- Note (localized): a Note describing the Event
- ContactInformation: contact information for this eventForm
DeleteAfterFromGeoStore
A period(duration) value in ISO8601-Format, after which time a canceled or ended event will delete all geoElements associated with it from the geoStore. e.g. "PT2H30M" => 2 hours and 30 minutes
DeleteAfterFromDB
A period(duration) value in ISO8601-Format, after which time a canceled or ended event will be deleted from the DataBase. e.g. "PT300M" => 300 minutes
Credentials
Optional Credentials to require the user to provide a username and password to unlock the Event Form. If multiple EventsFormConfiguration share the same credentials they will be unlocked all at once.
VerificationType
This field sets the verification method required for the EventForm. Possible values are:
- None
- SMS
if Type-SMS is chosen the SMS-Configuration is required.
SMS-Configuration
This configuration is required if the VerificationType is set to "SMS". It persists of 3 localized values for:
- verification: Text send to the user to verify its phone number.
- reminderBeginn: Text send to the user 15 minutes before their event begins.
- reminderEnd: Text send to the user 15 minutes before their event ends.
All 3 of these are liquid-template enabled values and can access two special fields:
- {{eventLink}}: provides a link to the event
- {{verificationLink}}: provides a link to verify the phone number (only verification)
Fields Configuration
The field are a list of inputs of the EventForm for the user to provide some data. Each field persists of the following structure:
{
"id": "[eventForm wide unique id]",
"label": {
"en": "[localized label]"
},
"type": "[Input type]",
"values": (if required by type){
"value1": {
"en": "[localized value]"
}...
},
"required": true|false"[flag to set the field required parameter to create the event]",
"editable": true|false"[flag to set the ability to edit the value of the field after the event started]"
}
The field can be on of multiple types:
- Text: A simple text input
- PhoneNumber: A phone number input
- CheckBox: A checkbox to (de-)select an option
- SingleSelect: A Selection of values to choose one from (requires values)
- MultiSelect: A Selection of values to choose multiple from (requires values)
- DateTime: A simple date and time picker
- Duration: A simple duration picker
Geometries Configuration
The geometries configuration is used to limit/assist the user while selecting the event location. It persists of the following properties:
- Limit: the global limit of geometries, of all types, the user can select
- Area: A jps-Query to limit the allowed area the user can set the geometries in
- BoundingBox: A simple bounding box where the user can set the geometries within.
- ValidTypes: a list of geometry types the user is able to set.
- Types: one of Point, Polyline or Polygon
- Limit: a inner limit for this type
- maxSize: (only polyline and polygon) sets the maximum size of the geometry
GeoElementProperties Configuration
The GeoElementProperties configuration is a set of Key/Value-Array Properties which get set to the geoElement when stored in the geoStore, to provide meta information about the event on the GeoElement. Each property is a simple object with:
- Key: property-key
- Value: an Array of liquid-template enabled values
Liquid-Template enabled Values
These are special values that can reference field and special values and be rendered into a dynamic text. Each liquid-template enabled value can reference any Field defined by the EventForm via the fieldId.
Some special fields are also available in some values/configurations:
See the liquid template documentation for more information on how to write liquid templates.