The Atoti UI Starter
Introduction
The Atoti UI Starter automatically sets up an Atoti Server application to work with Atoti UI, while still allowing custom settings to overrule default behaviors. This starter creates configurable security rules for the endpoints used by Atoti UI, and sets up its static file delivery.
The Atoti UI starter may be used alone, but we recommend pairing it with the Atoti Server Starter.
Installation
<dependency>
<groupId>com.activeviam.springboot</groupId>
<artifactId>atoti-ui-starter</artifactId>
<version>6.1.3-SNAPSHOT</version>
</dependency>
Choosing the Atoti UI version
The UI starter automatically uses a suitable Atoti UI version for your Atoti Server version.
Nevertheless, the atoti-ui.version
maven property may be set to the desired version to override
the default.
However, only official UI versions 5.2+ are supported.
Necessary components
This starter requires two special files in order to properly initialize Atoti UI: an env.js file and a extensions.js file. See the Atoti UI doc for more details on their content and effects.
See the Env.js and Extensions.js sections to learn how to provide them.
Security
This starter defines a security rule to control the access to Atoti UI and its web resources.
Like Atoti Server Starter, it automatically uses
an HumanToMachineDsl
to configure general security
rules.
Should a different behavior be needed, the atoti.server.security.ui.enabled
property can be set
to false
to disable this default rule. Another SecurityFilterChain will most likely need to be
defined to replace it.
Configuration
Env.js
Atoti UI needs to be configured through an env.js file.
This starter automatically loads any resources/static/atoti-ui/env.js
file provided by the user,
but it is possible to change that behavior if needed.
There are two ways to do so:
You may set the atoti.atoti-ui.env-js-resource
property to set the location of the file that is
to be used.
It must contain the path to the folder containing the env.js
file.
You may also create an AtotiUiEnvJs
bean, defined so that its getResource()
method returns a
Spring Resource
containing the content of the env.js
file. As any implementation of Resource
may be
used, this content does not necessarily come from a file.
@Bean
public AdminUiEnvJs adminUiProperties() {
final Resource adminUiEnvJs = adminUiEnvJs();
return () -> adminUiEnvJs;
}
Extensions.js
AtotiUi also needs an extensions.js
file placed at resources/static/atoti-ui/
, to define
which extensions must be used.