Database Forms

Database forms are used to manage data stored in databases that are external to JMap. They allow you to add new data as well as modify or delete existing data.

You can create several database forms for one layer.

Each database form has its own permissions to control which users can make changes to the data.

These forms can be used to manage data using a 1 to 1 relationship with a layer’s data. In this case, a record is added when an element is created, and this record is usually deleted when the element is deleted.

They can also be used to manage data using a 1 to N relationship with the layer data. In this case, a special type of form called a subform is used and is always associated with a table form component. Refer to the subforms section for more information on this topic.

Configuring this type of form is an advanced JMap function that requires writing SQL queries to extract, add, modify and delete data.

Creating a database form

To create a database form, in the Form section of the Forms tab of the layer configuration interface, press Create.

You must enter a name for the new form. Afterwards, you must select the type of form to create, Database, then select the database containing the data to be used in the forms.

At the following step, a window allows you to enter the form’s SQL queries. These queries are used to extract, add, modify, and delete data.

The SELECT query is required, but the others are optional.

Only operations for which SQL queries have been provided can be performed.

SQL Query Syntax

A special syntax is used for SQL query configuration. In general, each line of this syntax must end with a semicolon (;). The syntax is not case sensitive.

The following table provides a detailed explanation of how this syntax works.

Form properties

The following table provides a detailed explanation of each parameter in the database form creation window.

Subforms

Subforms are database forms that are opened from a Table component that exists in another form. They are normally used to manage data that has a 1 to N relationship with the layer’s elements. They could be used to manage data for inspections on assets (N inspections can be associated to the same object), for example. They are configured similarly to the other database forms.

Creating a subform

To create a subform, open the Subform tab on the Forms tab in the layer parameters menu, then click on Create.

You must enter a name for the new form and select the database containing the data to be used in the forms.

At the following step, you must configure the SQL queries of the subform, as explained above for the creation of a database form.

Nested subforms

Several levels of subforms can be nested in a subform. They are used to manage data having a 1 to N relationship with the subform’s records. For example, they can be used to manage the data of interventions arising from an inspection performed on an asset (N interventions can be associated with 1 inspection).

A nested subform is opened from a Table component found in the subform it is associated with.

Creating a nested subform is done by following the same steps to create a subform. Examples of queries are displayed in the table of the Creating a database form section.

The following figure shows a preview of the nested subforms from our example, in JMap Pro.

Permissions of database forms

Database forms have their own permissions. The Permissions button appears in the form configuration interface.

The Permissions section has two tabs: Permissions and Owners. The owners are the only ones who can manage the administrative permissions for the project, manage the list of owners and delete it.

Available users and groups are configured in the JMap Server section of JMap Admin. Refer to the Users and Groups section for more information about managing users in JMap Server.

Available permissions are described in the table below.

Dernière mise à jour

K2 Geospatial 2024