Skip to main content
The bookmark tool is a utility pre-configured in Atoti CVA Risk Capital for exporting and importing bookmarks to and from a directory structure.

What it’s for

The standard exporting/importing functionality available in the core Atoti Server API exports the bookmarks/ 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 .json file becomes cumbersome to track in git.
  • Customizations are increasingly difficult to perform.
  • Merging custom bookmarks with any Atoti CVA Risk Capital changes is awkward.
To address these problems, the bookmark tool enables exporting bookmarks as a directory structure that follows the hierarchy visible in the UI. By having separate files for every bookmark:
  • 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:
  1. Run Atoti CVA Risk Capital as usual.
  2. Configure the export behavior.
  3. Run the main method of the ExportReferenceContentServer class (com.activeviam.cvarc.starter.server.ExportReferenceContentServer) in the cvarc-application-tests module.
  4. (Optional) To export to a different folder, modify the cvarc-content-server parameter of the exportBookmarks() call.
The tool connects to the content server at the default URL:
The export class loads its properties from 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 the cvarc-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 (within bookmark-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 as USER/USER and the bookmark structure is as follows:
  • Custom permissions have been set for Folder1 and Bookmark3. So they have their respective permissions files Folder1_metadata.json and Bookmark3_metadata.json.
  • All children of Folder1 inherit its permissions [ROOT/USER], except for Bookmark3 which 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-listing directory, together with the name_metadata.json file where appropriate.
  • To edit a bookmark, modify its .json file.
  • To edit the description and permissions of files and folders in the UI, modify the relevant name_metadata.json file. If the file does not exist, create it with the following format:
    Or with a description: