Package org.opencms.ade.configuration
Class CmsFunctionAvailability
- java.lang.Object
-
- org.opencms.ade.configuration.CmsFunctionAvailability
-
public class CmsFunctionAvailability extends java.lang.Object
Helper class for computing dynamic function availability based on sitemap configuration settings.
-
-
Constructor Summary
Constructors Constructor Description CmsFunctionAvailability(CmsFormatterConfigurationCacheState formatterConfig)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(CmsUUID functionId)Adds a dynamic function id and enables whitelisting.voidaddAll(java.util.Collection<CmsUUID> enabledIds)Adds all ids from the given collection.booleancheckAvailable(CmsUUID id)Check if the function with the given id is available with this configuration.java.util.Collection<CmsUUID>getBlacklist()Gets the blacklist of explicitly removed functions that are not already covered by not being in a whitelist.java.util.Collection<CmsUUID>getWhitelist()Gets the whitelist of explicitly enabled functions.booleanisDefined()Checks if this object has any restrictions on functions.voidremove(CmsUUID functionId)Removes a single function.voidremoveAll()Removes all functions and enables the whitelist.java.lang.StringtoString()
-
-
-
Constructor Detail
-
CmsFunctionAvailability
public CmsFunctionAvailability(CmsFormatterConfigurationCacheState formatterConfig)
Create a new instance.- Parameters:
formatterConfig- the formatter configuration state
-
-
Method Detail
-
add
public void add(CmsUUID functionId)
Adds a dynamic function id and enables whitelisting.- Parameters:
functionId- the function id to add
-
addAll
public void addAll(java.util.Collection<CmsUUID> enabledIds)
Adds all ids from the given collection.- Parameters:
enabledIds- the ids to add
-
checkAvailable
public boolean checkAvailable(CmsUUID id)
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
public java.util.Collection<CmsUUID> 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
public java.util.Collection<CmsUUID> 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
public boolean isDefined()
Checks if this object has any restrictions on functions.- Returns:
- true if this has any restrictions on functions
-
remove
public void remove(CmsUUID functionId)
Removes a single function.- Parameters:
functionId- the id of the function
-
removeAll
public void removeAll()
Removes all functions and enables the whitelist.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-