Holds a website's per-app settings and theme, loaded from the settings.xml file under WEB-INF in the website's repository and cached by WebsiteSettingsService. Records which apps are enabled for the website, their individual settings, and the selected theme name. Also loads any ".settings.xml" files found under WEB-INF into a data map, published to listeners via WebsiteSettingsLoadedEvent. Instances are immutable with respect to their app settings and theme - the add, setApp and setTheme methods each return a new WebsiteSettings rather than mutating this one.
Group: Website Settings
Properties
| Property | Returns | Description |
|---|---|---|
| appSettings | Collection<AppSettingsBean> | All app settings recorded for this website. |
| controllerMapping | ControllerMappingList | The controller mappings loaded from controllers.xml for this website. |
| data | Map<String,Object> | The parsed contents of every ".settings.xml" file found under WEB-INF, keyed by file or directory name and nested to mirror the WEB-INF directory structure. |
| enabledAppIds | List<String> | The app instance ids that are marked enabled in this website's settings. |
| loadingError | String | The error message recorded when settings.xml could not be loaded or parsed. |
| themeName | String | The theme name recorded for this website, as set in settings.xml. |
Methods
isEnabled(String appId) · getAppSettings() · getThemeName() · getEnabledAppIds() · getLoadingError() · get(String appId) · add(String appId, AppSettings appSettings) · setApp(AppSettingsBean appSettings) · setTheme(String newTheme) · getData() · getControllerMapping()
isEnabled(String appId)
Returns: boolean
Whether the given app is enabled for this website, according to its recorded AppSettingsBean.
| Parameter | Description |
|---|---|
appId | the app instance id to check |
getAppSettings()
Returns: Collection<AppSettingsBean>
All app settings recorded for this website.
getThemeName()
Returns: String
The theme name recorded for this website, as set in settings.xml.
getEnabledAppIds()
Returns: List<String>
The app instance ids that are marked enabled in this website's settings.
getLoadingError()
Returns: String
The error message recorded when settings.xml could not be loaded or parsed.
get(String appId)
Returns: AppSettingsBean
The recorded settings for a single app, indexed by app instance id.
| Parameter | Description |
|---|---|
appId | the app instance id to look up |
add(String appId, AppSettings appSettings)
Returns: WebsiteSettings
Returns a new WebsiteSettings with an app setting added for the given app id, built from the enabled flag and settings map of the given AppSettings. This instance is not modified.
| Parameter | Description |
|---|---|
appId | the app instance id to add settings for |
appSettings | the source of the enabled flag and settings to record, may be null to record a disabled app with no settings |
setApp(AppSettingsBean appSettings)
Returns: WebsiteSettings
Returns a new WebsiteSettings with the given app settings bean replacing any existing entry for the same app instance id. This instance is not modified.
| Parameter | Description |
|---|---|
appSettings | the app settings bean to set, keyed by its own app instance id |
setTheme(String newTheme)
Returns: WebsiteSettings
Returns a new WebsiteSettings with the same app settings but a different theme name. This instance is not modified.
| Parameter | Description |
|---|---|
newTheme | the theme name to set on the new instance |
getData()
Returns: Map<String,Object>
The parsed contents of every ".settings.xml" file found under WEB-INF, keyed by file or directory name and nested to mirror the WEB-INF directory structure.
getControllerMapping()
Returns: ControllerMappingList
The controller mappings loaded from controllers.xml for this website.