What it’s for
The standard exporting/importing functionality available in the core Atoti Server API exports thebookmarks/ endpoint in the Content Server
as a .json file. However, as the number of bookmarks delivered with
Atoti CVA Risk Capital increases, this option presents a number of issues:
-
The
.jsonfile becomes cumbersome to track in git. - Customizations are increasingly difficult to perform.
- Merging custom bookmarks with any Atoti CVA Risk Capital changes is awkward.
- Incorporating changes becomes easier.
- Git is able to track changes to individual files.
- Merging separate sets of bookmarks becomes as simple as copying custom files or directories to the appropriate location.
Exporting
To export Atoti CVA Risk Capital bookmarks:- Run Atoti CVA Risk Capital as usual.
- Configure the export behavior.
-
Run the
mainmethod of theExportReferenceContentServerclass (com.activeviam.cvarc.starter.server.ExportReferenceContentServer) in thecvarc-application-testsmodule. -
(Optional) To export to a different folder, modify the
cvarc-content-serverparameter of theexportBookmarks()call.
cvarc-application-tests/src/main/resources/cvarc.export.properties.
When folder export is enabled, the tool also writes the Content Server’s
ui/organization_settings content to cvarc-content-server/organization_settings.json
alongside the bookmarks directory.
Importing
Atoti CVA Risk Capital ships with a default set of bookmarks in thecvarc-content-server folder and cvarc-content-server.json file bundled
in the release deliverables. For full details on configuring the import
behavior, see
Project configuration.
The import behavior of the content service is configurable in cvarc.properties
within the cvarc-application module:
The file and folder names are resolved using a Spring
PathMatchingResourcePatternResolver, and the properties conform to its
required format.
For an application built as a SpringBoot JAR, the properties must be
replaced with properly formatted absolute paths, as it is impossible to
load folders directly from a JAR file.
Format
Export format
The bookmarks directory exported by this tool contains the folders and files in the following structure:Bookmarks
Individual bookmarks (withinbookmark-name.json files) conform to the
Atoti UI/Content Server format. The bookmark tool offers no additional
features or configuration options for bookmark content.
Metadata
bookmark-name_metadata.json files are configuration files for
Atoti UI/Content Server auxiliary features.
The files support the following format:
Due to all supported properties being optional, metadata files can be omitted
altogether for new bookmarks. Once imported into the Content Server, the
generated internal metadata must be exported (see Exporting) to
guarantee key persistence.
Permissions
Behavior
- If a folder or file does not have any permissions defined in the relevant metadata file, it uses the permissions of its parent. This inheritance policy is applied right through to the top of the bookmark tree.
- If none of the files or folders have custom permissions, the default permissions passed into the library call will be used.
Impact on export and import
Which permissions get exported or imported depends on whether permissions are defined in the metadata file for the given folder or file, in addition to its location in the bookmarks structure.Example
In this example, the default permission is set asUSER/USER and the bookmark
structure is as follows:
- Custom permissions have been set for
Folder1andBookmark3. So they have their respective permissions filesFolder1_metadata.jsonandBookmark3_metadata.json. - All children of
Folder1inherit its permissions[ROOT/USER], except forBookmark3which has its own permissions[USER/USER]. - All other folders and files will use the default permissions as they have no permissions files set.
Merging or modifying bookmarks
-
To merge bookmarks, copy the relevant folders and bookmark files to the
appropriate location within the
bookmarks-listingdirectory, together with thename_metadata.jsonfile where appropriate. -
To edit a bookmark, modify its
.jsonfile. -
To edit the description and permissions of files and folders in the UI,
modify the relevant
name_metadata.jsonfile. If the file does not exist, create it with the following format:Or with a description: