Skip to content

Commit 343d5e8

Browse files
committed
Adds project settings
Signed-off-by: Daniel Kastl <[email protected]>
1 parent da6bd48 commit 343d5e8

File tree

5 files changed

+135
-6
lines changed

5 files changed

+135
-6
lines changed

doc/examples/camera_sensor.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,37 @@
33
This example demonstrates how to create a street camera sensor entity and
44
subscribe to its updates.
55

6+
## Subscription Template for Speed Camera Sensor
7+
8+
Create a new subscription template for the speed camera sensor entity with the
9+
following minimal settings:
10+
11+
### General Settings
12+
13+
| Field | Value |
14+
|-------------------|-----------------------------------------------------------|
15+
| **Name** | `Speed Alert > 80 km/h` |
16+
| **Broker URL** | `your_broker_url` (e.g., `http://127.0.0.1:1026`) |
17+
18+
### Subscription Settings
19+
20+
| Field | Value |
21+
|---------------------|---------------------------------------------------------|
22+
| **Entities** | `[{ "idPattern": ".*", "type": "SpeedCameraSensor" }]` |
23+
| **Query** | `speed > 80` |
24+
25+
### Issue Settings
26+
27+
| Field | Value |
28+
|-------------------|-----------------------------------------------------------|
29+
| **Subject** | `Speed Alert from ${id}` |
30+
| **Description** | `The speed camera sensor ${id} detected a speed of ${speed} km/h.`|
31+
| **Issue geometry**| `{ "type": "Feature", "geometry": "${location}" }` |
32+
| **Attachments** | `[{"filename": "SC_${timestamp}.jpg", "url": "${image}"}]`|
33+
| **Sent from user**| `api_user` (select the user who will send the issue) |
34+
35+
Create the subscription template and publish it.
36+
637
## Creating an Entity with Speed Camera
738

839
```bash
@@ -16,7 +47,7 @@ curl -iX POST "${BROKER_URL}/v2/entities" \
1647
"type": "URL"
1748
},
1849
"speed": {
19-
"value": 87,
50+
"value": 50,
2051
"type": "Number"
2152
},
2253
"location": {

doc/examples/location_sensor.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
This example demonstrates how to create a location sensor entity and subscribe
44
to its updates.
55

6+
## Subscription Template for Location Sensor
7+
8+
Create a new subscription template for the location sensor entity with the
9+
following minimal settings:
10+
11+
### General Settings
12+
13+
| Field | Value |
14+
|-------------------|-----------------------------------------------------------|
15+
| **Name** | `Location Alert` |
16+
| **Broker URL** | `your_broker_url` (e.g., `http://127.0.0.1:1026`) |
17+
18+
### Subscription Settings
19+
20+
| Field | Value |
21+
|---------------------|---------------------------------------------------------|
22+
| **Entities** | `[{ "idPattern": ".*", "type": "LocationSensor" }]` |
23+
| **Geospatial Query**| Apply the project boundary by clicking "Insert project boundary"|
24+
25+
### Issue Settings
26+
27+
| Field | Value |
28+
|-------------------|-----------------------------------------------------------|
29+
| **Subject** | `Location Alert` |
30+
| **Description** | `The location sensor ${id} entered the project area.` |
31+
| **Issue geometry**| `{ "type": "Feature", "geometry": "${location}" }` |
32+
| **Sent from user**| `api_user` (select the user who will send the issue) |
33+
34+
Create the subscription template and publish it.
35+
636
## Creating an Entity with Location
737

838
```bash
@@ -38,6 +68,10 @@ curl -iX PATCH \
3868
}'
3969
```
4070

71+
**Note**: The location coordinates are for Tokyo and Kobe, Japan. In order to
72+
trigger the subscription in this example, the location must be updated to be
73+
within the project boundary.
74+
4175
## Delete Entities
4276

4377
```bash

doc/examples/temperature_sensor.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,37 @@
33
This example demonstrates how to create a temperature sensor entity and
44
subscribe to its updates.
55

6+
## Subscription Template for Temperature Sensor
7+
8+
Create a new subscription template for the temperature sensor entity with the
9+
following minimal settings:
10+
11+
### General Settings
12+
13+
| Field | Value |
14+
|-------------------|-----------------------------------------------------------|
15+
| **Name** | `Temperature Alert > 30°C` |
16+
| **Broker URL** | `your_broker_url` (e.g., `http://127.0.0.1:1026`) |
17+
18+
### Subscription Settings
19+
20+
| Field | Value |
21+
|-------------------|-----------------------------------------------------------|
22+
| **Entities** | `[{ "idPattern": ".*", "type": "TemperatureSensor" }]` |
23+
| **Query** | `temperature > 30` |
24+
25+
### Issue Settings
26+
27+
| Field | Value |
28+
|-------------------|-----------------------------------------------------------|
29+
| **Subject** | `High Temperature Alert` |
30+
| **Description** | `The temperature sensor ${id} recorded a temperature of ${temperature}°C.`|
31+
| **Notes** | `The temperature reading has been updated to ${temperature}°C.`|
32+
| **Threshold (h)** | `24` (new issue if temperature remains high after 24h) |
33+
| **Sent from user**| `api_user` (select the user who will send the issue) |
34+
35+
Create the subscription template and publish it.
36+
637
## Creating an Entity with Temperature
738

839
```bash

doc/project_settings.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Enabling the Plugin for a Project
44

5-
To use the plugin, it needs to be enabled for each project. Once enabled,
6-
a **FIWARE** tab will appear in the project settings.
5+
To use the plugin, it needs to be enabled for each project. Once enabled, a
6+
**FIWARE** tab will appear in the project settings.
77

88
1. Go to the project where you want to enable the plugin.
99
2. Navigate to **Settings**.
@@ -20,10 +20,43 @@ project settings. This tab allows you to create and manage subscription template
2020

2121
### Creating a New Subscription Template
2222

23-
TBD
23+
In the **FIWARE** tab, you can create a new subscription template by clicking on
24+
the **New Subscription Template** button. This will open a form where you can
25+
configure the template settings, see:
26+
27+
- [Subscription Templates](subscription_template.md)
2428

2529
### Managing Subscription Templates
2630

2731
In the **FIWARE** tab, you can view, edit, and delete existing subscription
28-
templates. You can also copy the template settings to the clipboard or (un)publish
29-
a template if needed.
32+
templates. You can also copy the template settings cURL command to the clipboard.
33+
This can be useful if the context broker is not accessible from the Redmine server.
34+
35+
In case the context broker is accessible from the Redmine server, you can also
36+
(un)publish a template directly if needed.
37+
38+
### Subscription Templates Table
39+
40+
The subscription templates table displays the existing templates with their key details:
41+
42+
- **Name**: The name of the subscription template. By clicking on the name, you
43+
can view and edit the template settings.
44+
- **NGSI standard**: The NGSI standard used (e.g., *NGSIv2*).
45+
- **Broker URL**: The URL of the FIWARE context broker.
46+
- **Issue status**: The status of the Redmine issue that will be created.
47+
- **Tracker**: The tracker to be used for the Redmine issue.
48+
- **Status**: The status of the subscription template (e.g., active, inactive, oneshot).
49+
50+
#### Actions
51+
52+
For each subscription template, you have the following actions available:
53+
54+
- **Clipboard**: Copy the template settings to the clipboard. In case the
55+
browser does not support clipboard copying, the cURL command will be also
56+
displayed in the developer console.
57+
- **Publish**: Publish the subscription template to the context broker.
58+
- **Unpublish**: Unpublish the subscription template (if it is currently published).
59+
- **Delete**: Delete the subscription template.
60+
61+
These settings allow you to customize how FIWARE notifications are handled and
62+
how Redmine issues are created or updated based on these notifications.

doc/project_settings.png

7.19 KB
Loading

0 commit comments

Comments
 (0)