Cumulus Java Classes 
Reference Documentation  
Version 11.1.7
  

Package com.canto.cumulus.prefs

The Cumulus preferences package for accessing the Cumulus preferences.

See: Description

Package com.canto.cumulus.prefs Description

The Cumulus preferences package for accessing the Cumulus preferences.

Overview

This package provides access to the entire preferences system of Cumulus.
Since version 6.0 Cumulus uses a complex preferences structure to store its settings. The preferences are organized as a hierarchical tree. This preferences tree is accessible through this API. The entry point to the preferences is the Preferences class which has a few convenience methods to access names of Sets used by Cumulus:
        Collection getAssetHandlingSetNames();
        Collection getRecordViewSetNames();
        Collection getCategoryViewSetNames();
        Collection getAssetActionNames ();
        Collection getMetadataTemplateNames ();
        Collection getRecordQueryNames ();
        Collection getCategoryQueryNames ();
    
The most versatile method is: Object getPreferences(String path) As mentioned the Cumulus preferences are organized as a tree. The path parameter specifies the preferences subtree you want to get as the result from the call.
To get all preferences you simply call:
        Application app = Application.getInstance ();
        RecordCollection rc = app.getCurrentRecordCollection ();
        CumulusSession cumulusSession = rc.getCumulusSession ();
        com.canto.cumulus.prefs.Preferences preferences = cumulusSession.getPreferences ();
        ServerRoot completePrefs = (ServerRoot) preferences.getPreferences ("/");
    
In this case the returned object is an instance of the ServerRoot class that provides methods like:
        ServerSettings getServerSettings();
        UserList getUsers();
        String getCurrentActiveUser();
    
Calling getServerSettings() for example returns another object which represents the settings used for the whole server you are connected to through the used CumulusSession object. You can experiment with this knowledge and explore the preferences through the given class structure hiding the underlying complexity.

Path Syntax

A path definition always looks like this /USRS/[UUID]:[userUID]/MoPr/[UID:MTyp]:[SampleEJP:1]/SOpG. The / separates the different preferences layers. As a layer can be a either a record pack or a list pack the access of such a pack differs. For a record pack you can simply use the key of the subpack in the parent pack. In the example above USRS is the key of the Users list pack being used to store the list pack in the ServerRoot instance. As the Users list pack needs some key to find the correct entry in the list of contained child elements a primary key field and value needs to be provided: [UUID]:[userUID] is such a primary key specification with UUID as the primary key field for the wanted value userUID. If the child elements have a primary key consisting of multiple fields the syntax is [UID:MTyp]:[SampleEJP:1]. The individual fields are separated by a :.
A overview of the internal structure and keys for the objects can be found in this document.

© 2002-2021 Canto GmbH. All Rights Reserved.
Cumulus Java Classes 
Reference Documentation  
Version 11.1.7
  

www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.