Class ClassificationManager
- All Implemented Interfaces:
JPropertiesListener
- Since:
- 10.0.8 / JCMS-10746
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault configuration of the baseline level.static final StringName of the ACL authorizing classification level administrationstatic final intDefault configuration of maximum level.static final booleanDefault value for member authorization features.static final StringName of property from which the reference level is read.static final StringName of property to check if classification is enabled.static final StringName of property from which maximum level is read.static final StringName of boolean property used to read whether member clearance is enabled.static final StringName of property prefix from which the start level used of each constraint is read.static final StringName of property prefix from which maximum level of each feature is read. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the specified member is authorized to access classification admin console.intRetrieve the reference classification level to used for unspecified level (0)getClassificationDescriptionProperty(int level) Retrieve the I18N property suitable to build a description for specified classification level.getClassificationLabel(String lang, int level) Retrieve the I18N label for specified classification level, in the specified language.getClassificationLabelHtml(String lang, int level) Retrieve an HTML I18N representation of the specified classification level, in the specified language.getClassificationLabelHtml(String lang, int level, boolean inline) Retrieve an HTML I18N representation of the specified classification level, in the specified language.getClassificationLabelProperty(int level) Retrieve the I18N label property suitable to build a label for specified classification level.Retrieve a settings suitable to edit a classification level.getClassificationLevelSettings(int maxLevel) Retrieve a settings suitable to edit a classification level.getClassificationLevelSettings(int minLevel, int maxLevel) Retrieve a settings suitable to edit a classification level.getClassificationSubtitle(int level) Retrieve the I18N HTML tooltip suitable to present the description for specified classification level (if it exists).getClassificationTooltip(int level) Retrieve the I18N HTML tooltip suitable to present the description for specified classification level (if it exists).intRetrieve the maximum classification level authorized for the specified member.static final ClassificationManagerintRetrieve the maximum classification level value possiblebooleanCheck if classification is enabled.booleanCheck if member clearance is enabled.voidvoidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.booleanshowClassification(Member mbr) Check if any UI related to classification should be presented to the specified MemberbooleanCheck if member clearance level field should be displayed to the specified member.
-
Field Details
-
CLASSIFICATION_ADMIN_ACL
Name of the ACL authorizing classification level administration- See Also:
-
PROP_ENABLED
Name of property to check if classification is enabled.- See Also:
-
PROP_MAXIMUM_LEVEL
Name of property from which maximum level is read.- See Also:
-
PROP_BASELINE_LEVEL
Name of property from which the reference level is read.- See Also:
-
MAXIMUM_LEVEL_DEFAULT
public static final int MAXIMUM_LEVEL_DEFAULTDefault configuration of maximum level.- See Also:
-
BASELINE_LEVEL_DEFAULT
public static final int BASELINE_LEVEL_DEFAULTDefault configuration of the baseline level.- See Also:
-
PROP_MEMBER_CLEARANCE_ENABLED
Name of boolean property used to read whether member clearance is enabled.It includes all associated features, such as publication read right using member authorization, UIs.
- See Also:
-
MEMBER_CLEARANCE_ENABLED_DEFAULT
public static final boolean MEMBER_CLEARANCE_ENABLED_DEFAULTDefault value for member authorization features.- See Also:
-
PROP_PREFIX_FEATURE_MAXIMUM_LEVEL
Name of property prefix from which maximum level of each feature is read.- See Also:
-
PROP_PREFIX_CONSTRAINT_START_LEVEL
Name of property prefix from which the start level used of each constraint is read.- See Also:
-
-
Method Details
-
getInstance
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
loadProperties
public void loadProperties() -
isEnabled
public boolean isEnabled()Check if classification is enabled.- Returns:
- true if maximum level is higher than 0, false otherwise
-
getMaximumLevel
public int getMaximumLevel()Retrieve the maximum classification level value possible- Returns:
- the value configured with property "classification.max-level"
-
getBaselineLevel
public int getBaselineLevel()Retrieve the reference classification level to used for unspecified level (0)- Returns:
- the value configured with property "classification.baseline-level", between 1 and
getMaximumLevel()
-
isMemberClearanceEnabled
public boolean isMemberClearanceEnabled()Check if member clearance is enabled.It includes all associated features, such as publication read right using member clearance level, UIs.
- Returns:
- true if classification and member clearance is enabled, false otherwise.
-
showMemberClearanceLevel
Check if member clearance level field should be displayed to the specified member.- Parameters:
mbr- the mbr to check- Returns:
- true if member is authorized to see member clearance (provided feature is enabled), false otherwise.
- Since:
- 10.0.9 / JCMS-11079
-
canAccessClassificationAdmin
Check if the specified member is authorized to access classification admin console.- Parameters:
mbr- the mbr to check- Returns:
- true if authorized false otherwise
-
showClassification
Check if any UI related to classification should be presented to the specified Member- Parameters:
mbr- the Member for which check is performed, null accepted- Returns:
- true if classification UI should be displayed, false to hide them completely
-
getClassificationLabelHtml
Retrieve an HTML I18N representation of the specified classification level, in the specified language.Implementation detail : the HTML label returned will not be suitable for inline presentation (e.g. inside a span) as it will be presented using a badge. For such use case, use the inline parameter of method
getClassificationLabelHtml(String, int, boolean).- Parameters:
lang- the language in which you want the I18N labellevel- a classification level- Returns:
- a I18N property name
-
getClassificationLabelHtml
Retrieve an HTML I18N representation of the specified classification level, in the specified language.- Parameters:
lang- the language in which you want the I18N labellevel- a classification levelinline- set to true when the label is displayed inside other text (span... ), it will be displayed as a "label". Set to false when displayed for itself it will be displayed as a "badge".- Returns:
- a I18N property name
-
getClassificationLabel
Retrieve the I18N label for specified classification level, in the specified language.- Parameters:
lang- the language in which you want the I18N labellevel- a classification level- Returns:
- a I18N property name
-
getClassificationLabelProperty
Retrieve the I18N label property suitable to build a label for specified classification level.- Parameters:
level- a classification level- Returns:
- a I18N property name
-
getClassificationLevelSettings
Retrieve a settings suitable to edit a classification level.- Returns:
- a new EnumerateSettings instance
-
getClassificationLevelSettings
Retrieve a settings suitable to edit a classification level.- Parameters:
maxLevel- the maximum level to display, use 0 (or any negative value) to display all possible levels- Returns:
- a new EnumerateSettings instance
-
getClassificationLevelSettings
Retrieve a settings suitable to edit a classification level.- Parameters:
minLevel- the minimum level to displaymaxLevel- the maximum level to display, use 0 (or any negative value) to display all possible levels (above the minimum specified)- Returns:
- a new EnumerateSettings instance
-
getClassificationDescriptionProperty
Retrieve the I18N property suitable to build a description for specified classification level.- Parameters:
level- a classification level- Returns:
- a I18N property name
-
getClassificationTooltip
Retrieve the I18N HTML tooltip suitable to present the description for specified classification level (if it exists).- Parameters:
level- a classification level- Returns:
- a I18N property name or empty string if their is no description for this level
-
getClassificationSubtitle
Retrieve the I18N HTML tooltip suitable to present the description for specified classification level (if it exists).- Parameters:
level- a classification level- Returns:
- a I18N property name or empty string if their is no description for this level
-
getEffectiveClearanceLevel
Retrieve the maximum classification level authorized for the specified member.- If member clearance is enabled (cf
isMemberClearanceEnabled(), the maximum clearance level is the effective clearance level of member (cfMember.getEffectiveClearanceLevel()) or 1 if user is not logged. - If member clearance is disabled, the maximum clearance level is the maximum level configured (cf
getMaximumLevel());
- Parameters:
mbr- the Member for which computation is performed.- Returns:
- a value between 1 and the maximum level configured with property "classification.max-level"
- If member clearance is enabled (cf
-