Application Definition

4b983801-6725-4c59-997a-c388818fef86 2023-11-30 11:00

Application Definition

The Application Definition is the main step to provide an own application.

To build an application an appropriate Application Definition is needed. Formed using JSON this Application Definition could be directly put into the Configuration File or within an separate file which is included into the Configuration File then.

Example:

{
	"site": {
		"template": "my_template",
		"title": "My Application",
		"summary": "My Application",
		"description": "My Application",
		"author": "My Corporation"
	},
	"drivers": ["common", "users", "objects", "search"],
	"modules": {
		"my_items": {
			"driver": "objects",
			"default_mode": "list",
			"views": {
				"details": "my_items_details"
			}
		}
	},
	"access": [
		{
			"scope": [
				"*"
			],
			"allow": [
				{
					"level": 1
				}
			]
		}
	],
	"menu": [
		{
			"title": "My Items",
			"link": "my_items",
			"icon": "list"
		}
	]
}

This Application Definition results in a web application named “My Application” (from author “My Corporation”) based on template “my_template” giving one menu item named “My Items” enabling a signed in user to manage a collection named “my_items” including a list, adding or removing items and showing the details of an item using view “my_items_details”.

Section “@base

string

An Application Definition (or part of it) to be used as the base of the current Application Definition.

{
	"@base": "@site1"
}

The Application Definition could be assigned directly as an object (which is not recommended) or as a file to load with the “@” operator. So "site1" would load file “site1.json”.

Section “@include

string[]

A list of Application Definitions (or parts of it) to be included into the current Application Definition.

{
	"@include": [
		"@site1",
		"@site2"
	]
}

Each Application Definition could be assigned directly as an object (which is not recommended) or as a file to load with the “@” operator. So "site1" would load file “site1.json”.

Section “site

This section is not important for building application intelligence. Everything in this section is only used by templates for visualization.

Section “drivers

string[]

The list of drivers which should be available to modules within the Application Definition. Drivers which are not given here are not usable by modules within the Application Definition.

Section “modules

object

The collection of named objects representing the Module Definitions of the current Application Definition.

See “Module Definition”.

Section “menu” and "menu_guest"

object[]

The list of Menu Items representing the menu of the current Application Definition.

Setting “grant

map(string => string[]), optional

With this map you are able to use groups to grant additional access levels and groups within your application for authorization.

{
                        "grant": {
                                "group.sales": [
                                        "group.sales_sub1",
                                        "group.sales_sub2"
                                ]
                        }
}

This provides the option to define permissions more detailed staying with more general groups.

Section “access

object[]

The list of Acess Definitions representing the permissions of users for modules within the current Application Definition.

See concept “Authorization”.

Section "sharing"

map(string => object)

Sets the Sharing Definition for modules within the current Application Definition.

enforceboolfalse

If enabled that only data with permitting Sharing tag are retrieved.

If not, then data with no Sharing tag are retrieved too.

ignore_collectionsstring“”Which collections should be ignored in the Sharing check.
access_dbboolfalseWhether the database should be additionally used for permission checking.
access_fieldbooltrueWhether the database records should be additionally checked for the field `access` to be used for permission checking.
implicit_contextsboolfalseWhether the database records should be additionally checked for the fields `ref` and their `ref` connections to build a list of possible context strings to be used for permission checking.
The available parent settings
{
		"sharing": {
			"enforce": true,
			"ignore_collections": ["categories", "types"]
		}
}

See concept “Sharing”.