Skip to content

Commit ba23618

Browse files
SBlechmanndjs0109Ganesh-eoniripiri
authored
chore(entirety): documentation update
* chore: update docs * chore: add docs for modules * docs: adapted license information * docs: slightly adapted CONTRIBUTING.md --> conventional commits are mandatory * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Update DEVICES.md * Update ENTITIES.md * Update NOTIFICATIONS.md * chore: use relative links for docs of modules * Chore: Add Subsections * Chore : Add Subsections * Chore: Add Subsections * chore: move the images * chore: revise the tutorials * chore: further move images * fix: links * fix: links for going back * chore: use relative links * chore: adapt contribution guidelines (wip) * Fix spelling * fix spelling, improve clarity of descriptions * fix spelling, clarify descriptions in devices module * docs: revise the descriotion for notification module * chore: remove todo * chore(entirety): keep media folder in repo * chore(entirety): give python version information * chore(entirety): revision based on review feedbacks * chore(entirety): remove quotation marks in .env.example * docs: draft for contribution guidelines and individual cla * docs: intermediate commit before checking GUI tutorial * chore: revert merge with 106 * Merge branch 'development' into '149' * docs: re-did images for user guide overview (projects) * docs: new images for entities module * docs: adaptions for Devices module tutorial * [entirety]docs: fix typo * [entirety]docs: add contact email * [entirety]docs: typo * docs[entirety]: update image for subscription module * docs[entirety]: fix typo * docs[entirety]: add information about custom notification * docs[entirety]: fix typo * docs[entirety]: improve user guide * docs(entirety): create docs for data model module * docs[entirety]: upload screen shots * docs(entirety): revise datamodels documentation --------- Co-authored-by: JunsongDu <[email protected]> Co-authored-by: Ganesh-eon <[email protected]> Co-authored-by: JunsongDu <[email protected]> Co-authored-by: iripiri <[email protected]>
1 parent 68677f7 commit ba23618

40 files changed

+366
-43
lines changed

README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,59 @@
11
# n5geh.tools.entirety
22

3+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
34
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
45
[![semantic-release](https://github.com/N5GEH/n5geh.tools.entirety/actions/workflows/semantic-release.yml/badge.svg)](https://github.com/N5GEH/n5geh.tools.entirety/actions/workflows/semantic-release.yml)
56

7+
Entirety is a web-based graphical user interface (GUI) meant to provide easy access to some of FIWARE's Generic Enablers (GE) without requiring deeper knowledge on their APIs: Context Brokers like [Orion](https://fiware-orion.readthedocs.io/en/master/) and the [IoT Agent JSON](https://github.com/telefonicaid/iotagent-json/tree/master).
8+
Entirety is python-based and relies on the [FIWARE Library for Python (FiLiP)](https://github.com/RWTH-EBC/FiLiP) for the communication with the GE APIs.
9+
10+
Entirety holds modules (as displayed on the left hand side of the GUI) providing features to perform CRUD (create, read, update, delete) operations to entities in the Context Broker, devices in the IoT Agent, and subscriptions / notifications to QuantumLeap or other applications. Furthermore, Entirety provides a graphical overview of the semantic relationships between entities in the Semantics module as well as a store for standardized data models that can be either created or imported from external sources, like the [Smart Data Models Program](https://smartdatamodels.org//) in the Data Models module.
11+
12+
This project is currently in the process of contribution to FIWARE by the [Institute for Energy Efficient Buildings and Indoor Climate of RWTH Aachen University](https://www.ebc.eonerc.rwth-aachen.de/cms/~dmzz/e-on-erc-ebc/?lidx=1). You can find more GEs in the [FIWARE catalogue](https://github.com/Fiware/catalogue/).
13+
14+
## Table of Contents
15+
16+
- [n5geh.tools.entirety](#n5gehtoolsentirety)
17+
- [Table of Contents](#table-of-contents)
18+
- [Built With](#built-with)
19+
- [Roadmap](#roadmap)
20+
- [User Guide](#user-guide)
21+
- [Deployment Guide](#deployment-guide)
22+
- [Contributing](#contributing)
23+
- [Development](#development)
24+
- [Prerequisites](#prerequisites)
25+
- [Installing dependencies](#installing-dependencies)
26+
- [create .env File](#create-env-file)
27+
- [Get started](#get-started)
28+
- [Required](#required)
29+
- [Optional](#optional)
30+
- [OIDC](#oidc)
31+
- [User and permissions model](#user-and-permissions-model)
32+
- [Changelog](#changelog)
33+
- [Contact](#contact)
34+
- [License](#license)
35+
- [Further project information](#further-project-information)
36+
- [Acknowledgments](#acknowledgments)
37+
638
## Built With
739

840
- Django 4.1
941
- Bootstrap 5.2
1042
- htmx 1.8.2
43+
- Python 3.8/3.9
1144

1245
## Roadmap
1346
Have a look at our [roadmap](./docs/ROADMAP.md) to see what features we plan to work on in the short and long run. We kindly invite you to participate in [discussions](https://github.com/N5GEH/n5geh.tools.entirety/discussions) about possible features as well.
14-
## Deployment
1547

16-
To deploy the application please refer to
17-
our [deployment guide](https://github.com/N5GEH/n5geh.tutorials.entirety_step_by_step)
48+
## User Guide
49+
50+
The [user guide](./docs/USERGUIDE.md) describes how the GUI works and guides you through the functionalities of Entirety.
51+
52+
## Deployment Guide
53+
54+
To deploy Entirety via docker, please, refer to our [deployment guide](https://github.com/N5GEH/n5geh.tutorials.entirety_step_by_step), that also gives an overview of the used environment variables.
55+
If you wish to deploy Entirety for development purposes on your local machine, you can follow the [development](#deployment) and [get started](#get-started) paragraphs.
56+
1857

1958
## Contributing
2059

@@ -49,7 +88,7 @@ pre-commit
4988
cp .env.EXAMPLE .env
5089
```
5190

52-
## Usage
91+
### Get started
5392

5493
Migrate Database
5594

@@ -118,7 +157,10 @@ See [changelog](./docs/CHANGELOG.md) for detailed overview of changes.
118157

119158
## License
120159

121-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
160+
Entirety is licensed under the GPLv3 license [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE).
161+
162+
Furthermore, the authors want to make the following statement:
163+
>Please note that software derived as a result of modifying the source code of the software in order to fix a bug or incorporate enhancements IS considered a derivative work of the product. Software that merely uses or aggregates (i.e. links to) an otherwise unmodified version of existing software IS NOT considered a derivative work.
122164
123165
## Further project information
124166

app/Entirety/.env.EXAMPLE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ OIDC_TOKEN_ROLE_PATH="$.entirety.roles"
5050

5151
# FIWARE
5252
CB_URL=http://localhost:1026
53-
IOTA_URL="http://localhost:4041"
54-
QL_URL="http://localhost:8668"
53+
IOTA_URL=http://localhost:4041
54+
QL_URL=http://localhost:8668
5555

5656
# CSRF
5757
CSRF_TRUSTED_ORIGINS=[]

app/Entirety/src/jsonschemaparser

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 102c79003703c2b89e1ee08d138b3b16e7748bf0

app/Entirety/subscriptions/views/update.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ def post(self, request, *args, **kwargs):
268268
)
269269
messages.error(request, e)
270270
return self.form_invalid(form)
271-
272271
with ContextBrokerClient(
273272
url=settings.CB_URL,
274273
fiware_header=FiwareHeader(

docs/CONTRIBUTING.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33
Thank you for investing your time in contributing to our project!
44
Please read our contribution guideline carefully.
55

6+
## Ground rules & expectations
7+
8+
Before we get started, here are a few things we expect from you (and that you should expect from others):
9+
10+
- Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how open source is done." Try to listen to others rather than convince them that your way is correct.
11+
- If you open a pull request, you must sign the [Individual Contributor License Agreement](Entirety%20Individual%20Contributor%20License%20Agreement_DRAFT.pdf) by stating in a comment "I have read the CLA Document and I hereby sign the CLA"
12+
- Please ensure that your contribution passes all tests. If there are test failures, you will need to address them before we can merge your contribution.
13+
- When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it.
14+
- When reporting a vulnerability on the software, please, get in contact with the Entirety repository maintainers ([[email protected]](mailto:[email protected])) in order to discuss it in a private way.
15+
16+
## How to contribute
17+
18+
If you like to contribute, start by searching through the [issues](https://github.com/N5GEH/n5geh.tools.entirety/issues), [discussions](https://github.com/N5GEH/n5geh.tools.entirety/discussions), and [pull requests](https://github.com/N5GEH/n5geh.tools.entirety/pulls) of this project to see whether someone else has raised a similar idea or question.
19+
20+
1. Open a new [issue](https://github.com/N5GEH/n5geh.tools.entirety/issues) for feature requirement or bug resolution.
21+
2. Assign a user to that issue.
22+
3. Create a new branch for the corresponding issue (you can use the button/link on issue page to create the new branch).
23+
4. Make changes to that branch. Follow the [conventional commits convention](#conventional-commits).
24+
5. Open a [pull request](https://github.com/N5GEH/n5geh.tools.entirety/pulls) **from the new branch to development branch**.
25+
6. Assign reviewer from the list of reviewers.
26+
7. Once the pull request is approved by at least one reviewer, merge the branch to development, test if development branch is working as expected, and delete the old branch.
27+
8. An updated docker image of the development branch will be automatically pushed to the package registry when development branch is updated.
28+
629
## Conventional commits
730

831
We are using [conventional commits](https://www.conventionalcommits.org/)
@@ -43,15 +66,3 @@ If the commit is not bound to specific modules, for example some changes to the
4366
* **div:** _d\_\<name\>_
4467
* **dropdown:** _dd\_\<name\>_
4568
* **modal**: _m\_\<name\>_
46-
47-
## GitHub Workflow for development
48-
49-
1. Open a new issue for feature requirement or bug resolution.
50-
2. Assign a user to that issue.
51-
3. Create new branch for the corresponding issue (you can use the button/link on issue page to create the new branch).
52-
4. Make changes to that branch.
53-
5. Open a Pull Request from the new branch to development branch.
54-
6. Assign reviewer from the list of Reviewers.
55-
7. Once the Pull Request is approved by at least one reviewer, merge the branch to development, test if development
56-
branch is working as expected and delete the old branch.
57-
8. Updated development docker image will be automatically pushed to package registry when development branch will be updated.
Binary file not shown.

docs/GUI_TUTORIALS/DATAMODELS.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# *DATA MODELS MODULE*
2+
3+
Data models define the structure and vocabularies of data in FIWARE platforms.
4+
It helps to improve the reusability and interoperability of data.
5+
In Entirety, the Data Models module allows users to create, manage, and use data models in other related modules such as `Entities` and `Devices`.
6+
7+
- [Data Models Module](#data-models-module)
8+
- [Create Data Models](#create-data-models)
9+
- [Manage Data Models](#manage-data-models)
10+
- [Use Data Models](#use-data-models)
11+
12+
On the landing page of the *Data Models* module, you can see a list of all data models that belong to the project.
13+
![Alt text](images/data_model_overview.png)
14+
15+
16+
## Create Data Models
17+
To create a "new" data model, click on the *+* button in the top left.
18+
By "new" we mean that you can either create a completely new data model from scratch or you can import an existing data model from a URL or copy the source code directly from another source.
19+
We recommend to always use import function if possible, as it will ensure that the data model is findable and reusable in the future.
20+
21+
![Alt text](images/create_data_model.png)
22+
23+
For example, in the creation dialog, you can specify a URL (``Scheme link``) to access the data model, such as a data model that we host via GitHub pages: https://n5geh.github.io/n5geh.data_models/example_building_automation/deploy/schemas/RadiatorThermostatFiware.json.
24+
And then, by clicking on the *Load* button, the data model will be loaded into the text fields.
25+
26+
> **Note:** Here you can find more example data models: https://github.com/N5GEH/n5geh.data_models/tree/main/example_building_automation
27+
28+
If your data model is not publicly accessible, you can also copy the source code directly into the text fields.
29+
The same applies if you want to create a new data model from scratch.
30+
The *Beautify JSON* button will format the JSON code for better readability.
31+
32+
Finally, you can click on the *Save* button to save the data model.
33+
34+
## Manage Data Models
35+
36+
As can be seen in the landing page, all data models are listed.
37+
You can update (click on the *Inspect* button) or delete (click on the *Delete* button) a data model.
38+
39+
## Use Data Models
40+
Data models can be used in the `Entities Module` and `Devices Module` to pre-fill the fields of entities or devices/service groups.
41+
When creating a new entity or device/service groups, you can select a data model from the dropdown menu.
42+
43+
**In Entities Module:**
44+
45+
![Alt text](images/create_entity_from_data_model.png)
46+
Here you can pre-fill the *Entity Type* and the attributes of the entity.
47+
An ID is automatically generated, but can be changed.
48+
49+
**Device/Service Group**:
50+
51+
![Alt text](images/create_service_group_from_data_model.png)
52+
Here it is recommended to use data models to create service groups for a specific device type.
53+
With the ``Auto Provision`` option, you can enable the automatic creation of entities (following the data model) when a new device starts sending data to the IoT Agent.

docs/GUI_TUTORIALS/DEVICES.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# DEVICES MODULE
2+
3+
The "Devices" module is developed to interact with the FIWARE Generic Enabler known as IoT Agent-JSON, which manages `devices` and `service group` and their interactions within the FIWARE platform. The basic functionalities include creation, update, and removal of devices. Furthermore, the IoT Agent-JSON offers the use service groups to group certain devices and enable bi-directional communication, e.g. for the use of commands.
4+
5+
A detailed description of the terminology can be found in the docoumentation of the [IoT Agent Node Lib](https://iotagent-node-lib.readthedocs.io/en/latest/api.html) and the [IoT Agent JSON](https://fiware-iotagent-json.readthedocs.io/en/latest/usermanual.html).
6+
7+
- [DEVICES MODULE](#devices-module)
8+
- [Devices](#devices)
9+
- [Create New Device](#create-new-device)
10+
- [Create Multiple Devices](#create-multiple-devices)
11+
- [Delete Device](#delete-device)
12+
- [Service Groups](#service-groups)
13+
14+
On the landing page of the "Devices" module, the [*Devices*](#devices) tab is selected. You can also switch to the [*Service Groups*](#service-groups) tab.
15+
16+
## Devices
17+
18+
Upon load of the devices tab, a list of all devices that belong to the project are displayed. The handling is very similar to the [entities module](ENTITIES.md).
19+
By clicking on the *+* , you can add new devices. By clicking on the *bin*, you can delete a specific device. And by clicking on the *eye*, you can edit an already existing device.
20+
Furthermore, you can create Batch Devices by clicking on the batch devices option.
21+
You can choose which device to perform actions on by selecting the white selection box in the left column.
22+
23+
![Alt text](images/image-11.png)
24+
25+
### Create New Device
26+
By clicking the blue *+* , you can create a new device by filling in the *Device ID, Device Name* and the *Device Type*.
27+
28+
![Alt text](images/image-12.png)
29+
30+
Either create a device from scratch or pre-load information from a data model.
31+
32+
- The new device will be linked to an Entity by specifying the *Entity Name* and *Entity Type*.
33+
- Multiple device attributes can be added by filling in the *Attribute Name*, *Attribute Type* and *Object ID* (optional).
34+
- You can also add multiple device commands for a specific device by adding the *Command Name* and *Command Type*.
35+
36+
![Alt text](images/image-13.png)
37+
38+
### Create Multiple Devices
39+
If you are familiar with the syntax of the IoT Agent JSON, you can use this option to fill in a valid JSON and create multiple devices.
40+
41+
![Alt text](images/image-14.png)
42+
43+
### Delete Device
44+
- To delete a device, you can select the desired device and click on the *bin*, this will open a dialog box which gives you options for deleting the device.
45+
46+
![Alt text](images/image-15.png)
47+
48+
- You can choose to delete the entity related to this device by clicking the select box before deleting.
49+
- Additionally, you can click the *Advanced* button to delete further entity-related information like subscriptions and relationships which are associated to the connected entity.
50+
51+
![Alt text](images/image-16.png)
52+
53+
## Service Groups
54+
55+
Upon load of the service groups tab, all available service groups are listed. The handling of the service groups tab is the same as for the devices tab.
56+
57+
![Alt text](images/image-17.png)
58+
59+
For each service group, the fields *Resource* and *API Key* are mandatory. The *Resource* "/iot/json" is pre-filled but can be changed. Furthermore, an *Entity Type* can be linked to the service group, only explicit attributes can be accepted or auto provisioning can be enabled.
60+
61+
![Alt text](images/image-18.png)
62+
63+
64+
Back: [Entirety GUI](../USERGUIDE.md#modules)
65+
66+
Further: [Subscriptions](Subscriptions.md)

docs/GUI_TUTORIALS/ENTITIES.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Entities Module
2+
3+
The Entities module is developed to interact with the Orion Context Broker (CB).
4+
It allows users to manage entities within the CB.
5+
In the FIWARE context, entities hold information in a smart solution, typically corresponding to real-world objects or abstract entities.
6+
7+
![Alt text](images/image-5.png)
8+
9+
Users are able to create, update, retrieve, and delete entities via the "Entities" module. By clicking on the *+* , you can add new entities, by clicking on the *bin* you can delete all selected entities and by clicking on the *eye* you can inspect and edit the selected entity. You can choose which entity to perform actions on by checking one or many of the check boxes on the left hand side of each entity row.
10+
11+
You can use the search bar at the top to filter for entities by either ID or type. Currently, the search is case sensitive!
12+
13+
- [Entities Module](#entities-module)
14+
- [Create Entity](#create-entity)
15+
- [Create Multiple Entities:](#create-multiple-entities)
16+
- [Delete an Entity](#delete-an-entity)
17+
18+
19+
## Create Entity
20+
21+
By clicking the *+*, you can either create a single entity or have the possibility to batch create one or more entities. Click on *Create Entity*.
22+
- Create Entity: By clicking the *+* , you can create a new entity in two ways:
23+
- Raw: By filling in the *Entity ID* and the *Entity Type*. Attributes can be added but are not mandatory. If you add an attribute, *Attribute Name* and *Attribute Type* are mandatory while *Attribute Value* and *Metadata* are optional.
24+
- From data model: You can also load *Entity Type* and pre-defined attributes by loading from a data model. Choose an existing data model and click on the *Load* button.
25+
26+
By checking an entity and clicking on the *eye* button, you can inspect an entity.
27+
The dialog is the same as for creating an entity but the fields ID and type cannot be changed. A click on the red bin below each attribute will delete the attribute. *Note:* You have to click the *Update* button at the bottom in order to make the changes effective.
28+
29+
![Alt text](images/image-6.png)
30+
31+
![Alt text](images/image-7.png)
32+
33+
## Create Multiple Entities:
34+
35+
If you are familiar with the syntax of the context brokers, you can use this option to fill in a valid JSON and create multiple entities and their attributes.
36+
37+
![Alt text](images/image-6-multiple.png)
38+
39+
## Delete an Entity
40+
41+
To delete an entity, select the desired entity and click on the *bin*. This will open a dialog box with different options as described below.
42+
43+
![Alt text](images/image-8.png)
44+
45+
- Close: Deletion will be aborted.
46+
- Force Delete: Delete an entity without deleting their possible associations.
47+
- Advanced selection: This option will open another dialog box which offers three options for deleting the associations of the entity which are: *1. Subscriptions 2. Relationships 3.Devices*
48+
49+
![Alt text](images/image-10.png)
50+
51+
The advanced selection for deleting an entity allows you to delete the subscriptions, relationships and devices that this particular entity is linked with.
52+
53+
Back: [Entirety GUI](../USERGUIDE.md#modules)
54+
55+
Further: [Devices](DEVICES.md)

docs/GUI_TUTORIALS/SEMANTICS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# *SEMANTICS MODULE*

0 commit comments

Comments
 (0)