Package org.opencms.ade.configuration
Class CmsFunctionAvailability
java.lang.Object
org.opencms.ade.configuration.CmsFunctionAvailability
Helper class for computing dynamic function availability based on sitemap configuration settings.
-
Constructor Summary
ConstructorDescriptionCmsFunctionAvailability
(CmsFormatterConfigurationCacheState formatterConfig) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a dynamic function id and enables whitelisting.void
addAll
(Collection<CmsUUID> enabledIds) Adds all ids from the given collection.boolean
Check if the function with the given id is available with this configuration.Gets the blacklist of explicitly removed functions that are not already covered by not being in a whitelist.Gets the whitelist of explicitly enabled functions.boolean
Checks if this object has any restrictions on functions.void
Removes a single function.void
Removes all functions and enables the whitelist.toString()
-
Constructor Details
-
CmsFunctionAvailability
Create a new instance.- Parameters:
formatterConfig
- the formatter configuration state
-
-
Method Details
-
add
Adds a dynamic function id and enables whitelisting.- Parameters:
functionId
- the function id to add
-
addAll
Adds all ids from the given collection.- Parameters:
enabledIds
- the ids to add
-
checkAvailable
Check if the function with the given id is available with this configuration.- Parameters:
id
- the id to check- Returns:
- true if the function is available
-
getBlacklist
Gets the blacklist of explicitly removed functions that are not already covered by not being in a whitelist.- Returns:
- the list of explicitly removed functions
-
getWhitelist
Gets the whitelist of explicitly enabled functions.If no functions have been explicitly added, and no "remove all" option has been used, this will return null.
- Returns:
- the whitelist of functions
-
isDefined
Checks if this object has any restrictions on functions.- Returns:
- true if this has any restrictions on functions
-
remove
Removes a single function.- Parameters:
functionId
- the id of the function
-
removeAll
Removes all functions and enables the whitelist. -
toString
-