Brightspot CMS Developer Guide

Configuration identifiers, key prefixes, and defaults


Configuration keys are literals, such as toolUrlPrefix and baseUrl. All configuration keys are isolated into prefixes that group the keys into similar functions. (In this way, the prefixes serve as namespaces.) The prefixes have the form of a directory path.

Dari Config IDs prefixes and defaults.svg

Referring to the previous illustration, the prefix is brightspot/, and the configuration key is toolUrlPrefix.

Some Brightspot features support multiple configurations, such as outgoing mail servers, file servers, and image editors. You place each configuration in its own prefix.

<Environment name="dari/mailProvider/normalServer/host" value="mail.example.com" /> 
<Environment name="dari/mailProvider/secureServer/host" value="secretagent.example.com" />
  • Configures a hostname for a standard mail server. The configuration ID is normalServer, and the entire prefix is dari/mailProvider/normalServer/.
  • Configures a hostname for a secured mail server. The configuration ID is secureServer, and the entire prefix is dari/mailProvider/secureServer/.

Referring to the previous snippet, there are two configuration keys host, each with its own prefix.

For those features that support multiple configurations, you can assign one configuration as the default.

<Environment name="dari/defaultMailProvider" value="normalServer" /> 
<Environment name="dari/mailProvider/normalServer/host" value="mail.example.com" /> 
<Environment name="dari/mailProvider/secureServer/host" value="secretagent.example.com" />
  • Sets the default mail server configuration to the values with the prefix dari/mailProvider/normalServer/ .

Providing a default configuration is useful because you can retrieve them with string constants in code.

public class MailProvider {

    public static final String DEFAULT_MAIL_SETTING = "dari/defaultMailProvider";

    public static final String SETTING_PREFIX = "dari/mailProvider";

}

Referring to the previous snippet, you can retrieve a setting using a combination of DEFAULT_MAIL_SETTING and SETTING_PREFIX. This strategy implies you can change the default configuration in Tomcat without making any changes in code and recompiling.

Previous Topic
Configuring Dari
Next Topic
Database configuration
Was this topic helpful?
Thanks for your feedback.
The elements that get you up and running in a matter of days, from pre-built content types, to modules, to landing pages.

Content types
Modules
Landing pages
Everything you need to manage and administer content within Brightspot CMS, including plug-and-play integrations.

Dashboards
Publishing
Workflows
Admin configurations
A guide for installing, supporting and administering code on the Brightspot platform, including integrations requiring developer support to use.

Field types
Content modeling
Rich-text elements
Images