lucee.Componentcborm.models.BaseORMService
cborm.models.VirtualEntityService
contentbox.models.system.SettingService
ContentBox - A Modular Content Platform Copyright since 2012 by Ortus Solutions, Corp www.ortussolutions.com/products/contentbox --- Setting Service for ContentBox apps. All settings are cached as a struct constructed using the following format: - global : { name : value } // global settings - sites : { slug : { name : value } }
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
boolean
|
CBReadyFlag
Bit that detects if CB has been installed or not.
|
false
|
true
|
false
|
any
|
appName
|
true
|
false
|
|
any
|
cacheProviderName
The cache provider name to use for settings caching.
|
template
|
true
|
false
|
any
|
cachebox
|
true
|
false
|
|
any
|
contentboxSettings
|
true
|
false
|
|
any
|
log
|
true
|
false
|
|
any
|
moduleSettings
|
true
|
false
|
|
any
|
siteService
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
SettingService
|
activateCB()
Mark cb as ready to serve. |
struct
|
buildFileBrowserSettings()
Build file browser settings structure so you can execute multiple containers. |
struct
|
buildSettingsContainer()
Build out a settings container by global and sites. |
SettingService
|
bulkSave([struct memento], [any site])
Bulk saving of options using a memento structure of options. |
boolean
|
deleteInstaller()
Delete the installer module. |
any
|
findSiteSetting(any site, any name)
Try to find a setting object by site and name. |
SettingService
|
flushSettingsCache()
flush settings cache for current multi-tenant host. |
array
|
getAllForExport()
Get all data prepared for export. |
struct
|
getAllSettings([boolean force='false'])
Get all global settings. |
struct
|
getAllSiteSettings(any siteSlug, [boolean force='false'])
Get all site settings. |
string
|
getAppName()
|
string
|
getCBReadyFlag()
|
string
|
getCacheProviderName()
|
string
|
getCachebox()
|
string
|
getContentboxSettings()
|
struct
|
getDefaultSiteSettings([boolean force='false'])
Get all the default site settings. |
string
|
getLog()
|
string
|
getModuleSettings()
|
any
|
getSetting(any name, [any defaultValue])
Get a global setting. |
string
|
getSettingsCacheKey()
The static key used for caching all the settings of this installation. |
any
|
getSettingsCacheProvider()
Get the cache provider object to be used for settings. |
struct
|
getSettingsContainer([boolean force='false'])
Get the entire settings container from cache or build it out. |
string
|
getSiteService()
|
any
|
getSiteSetting(any siteSlug, any name, [any defaultValue])
Get a site setting. |
struct
|
getSiteSettingDefaults()
Get a collection (struct) of settings that represent the defaults for a site in ContentBox. |
string
|
importFromData(any importData, [boolean override='false'], [any importLog])
Import data from an array of structures or a single structure of data. |
string
|
importFromFile(any importFile, [boolean override='false'])
Import data from a ContentBox JSON file. |
boolean
|
isCBReady()
Check if contentbox has been installed by checking if there are no settings and no cb_active ONLY. |
boolean
|
isInstallationPresent()
Check if the installer is present. |
private SettingService
|
loadCacheProviderName()
Load the cache provider name from DB or default value. |
any
|
loadConfigOverrides()
Load up config overrides. |
any
|
loadEnvironmentOverrides()
Load up java environment overrides for ContentBox settings. |
SettingService
|
preFlightCheck()
This method will go over all system settings and make sure that there are no missing default core settings. |
struct
|
search([any search=''], [any max='0'], [any offset='0'], [any sortOrder='name asc'], [any siteID=''])
Setting search with filters. |
any
|
setAppName(any appName)
|
any
|
setCBReadyFlag(boolean CBReadyFlag)
|
any
|
setCacheProviderName(any cacheProviderName)
|
any
|
setCachebox(any cachebox)
|
any
|
setContentboxSettings(any contentboxSettings)
|
any
|
setLog(any log)
|
any
|
setModuleSettings(any moduleSettings)
|
any
|
setSiteService(any siteService)
|
SettingService
|
storeSettings([struct settings])
This will store the incoming structure as the settings in cache. |
Methods inherited from class cborm.models.VirtualEntityService |
---|
autoCast, convertIdValueToJavaType, convertValueToJavaType, count, countWhere, deleteAll, deleteByID, deleteByQuery, deleteWhere, evictCollection, executeQuery, exists, findAllWhere, findWhere, get, getAll, getEntityName, getKey, getOrFail, getPropertyNames, getTableName, idCast, list, new, newCriteria, onMissingMethod, setEntityName |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
Bit that detects if CB has been installed or not
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:setting:appNameserializable
- trueThe cache provider name to use for settings caching. Defaults to 'template' cache. This can also be set in the global ContentBox settings page to any CacheBox cache.
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- cacheboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:moduleSettings:contentboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- coldbox:setting:modulesserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- siteService@contentboxserializable
- trueMethod Detail |
---|
Mark cb as ready to serve
Build file browser settings structure so you can execute multiple containers
Build out a settings container by global and sites.
Bulk saving of options using a memento structure of options This is usually done from the settings display manager
memento
- The struct of settingssite
- Optional site to attach the settings toDelete the installer module
Try to find a setting object by site and name
site
name
flush settings cache for current multi-tenant host
Get all data prepared for export
Get all global settings
force
- To force clear the cacheGet all site settings
siteSlug
force
- To force clear the cacheGet all the default site settings
force
- To force clear the cacheGet a global setting
name
- The name of the setingdefaultValue
- The default value if setting not found.The static key used for caching all the settings of this installation
Get the cache provider object to be used for settings
Get the entire settings container from cache or build it out.
force
- Force buildGet a site setting
siteSlug
- The site to get the setting fromname
- The name of the setingdefaultValue
- The default value if setting not found.Get a collection (struct) of settings that represent the defaults for a site in ContentBox
Import data from an array of structures or a single structure of data
importData
- A struct or array of data to importoverride
- Override content if found in the database, defaults to falseimportLog
- The import log bufferImport data from a ContentBox JSON file. Returns the import log
importFile
- The json file to importoverride
- Override content if found in the database, defaults to falseCheck if contentbox has been installed by checking if there are no settings and no cb_active ONLY If the query comes back with active, it will not run it again.
Check if the installer is present
Load the cache provider name from DB or default value
Load up config overrides
Load up java environment overrides for ContentBox settings The pattern to look is `contentbox.{site}.{setting}` Example: contentbox.default.cb_media_directoryRoot
This method will go over all system settings and make sure that there are no missing default core settings. If they are, we will create the core settings with the appropriate defaults: this.DEFAULTS
Setting search with filters
search
- The search term for the namemax
- The max recordsoffset
- The offset to tusesortOrder
- The sort ordersiteID
- The site id to filter onappName
CBReadyFlag
cacheProviderName
cachebox
contentboxSettings
log
moduleSettings
siteService
This will store the incoming structure as the settings in cache. Usually this method is used for major overrides.
settings