Package org.ametys.cms.contenttype
Class RichTextAttributeDefinition
- java.lang.Object
-
- org.ametys.runtime.model.AbstractModelItem
-
- org.ametys.runtime.model.ElementDefinition<T>
-
- org.ametys.cms.contenttype.AttributeDefinition<RichText>
-
- org.ametys.cms.contenttype.RichTextAttributeDefinition
-
- All Implemented Interfaces:
Comparable<ModelItem>
,DefaultContentType.AnnotableDefinition
,RestrictedModelItem<Content>
,ModelItem
,Labelable
,ModifiableLabelable
public class RichTextAttributeDefinition extends AttributeDefinition<RichText> implements DefaultContentType.AnnotableDefinition
RichText definition with its list of allowed semantic annotations
-
-
Field Summary
Fields Modifier and Type Field Description private CurrentUserProvider
_currentUserProvider
The current user providerprivate RightManager
_rightManager
Rights managerprivate List<SemanticAnnotation>
_semanticAnnotations
-
Fields inherited from class org.ametys.runtime.model.ElementDefinition
_logger, CONFIG_DEFAULT_VALUE_TYPE
-
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManager
-
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description RichTextAttributeDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CurrentUserProvider
_getCurrentUserProvider()
Retrieves theCurrentUserProvider
protected RightManager
_getRightManager()
Retrieves theRightManager
protected Map<String,Object>
_toJSON(DefinitionContext context)
Converts the model item in a JSON mapList<SemanticAnnotation>
getSemanticAnnotations()
Get the allowed semantic annotations for this rich textvoid
setSemanticAnnotations(List<SemanticAnnotation> semAnnotations)
Set the allowed semantic annotations for this rich text-
Methods inherited from class org.ametys.cms.contenttype.AttributeDefinition
_getExternalizableDataProviderExtensionPoint, _getRestrictedModelItemHelper, _shouldJSONBeEmpty, canRead, canWrite, setRestrictions
-
Methods inherited from class org.ametys.runtime.model.ElementDefinition
_getDefaultValue, _getParsedDefaultValues, getCustomEnumerator, getCustomValidator, getDefaultValue, getDisableConditions, getEnumerator, getEnumeratorConfiguration, getPluginName, getType, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setDisableConditions, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setPluginName, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters
-
Methods inherited from class org.ametys.runtime.model.AbstractModelItem
addItemChecker, compareTo, equals, getDescription, getItemCheckers, getLabel, getModel, getName, getParent, getPath, hashCode, setDescription, setLabel, setModel, setName, setParent, setServiceManager, toJSON, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
-
Methods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getItemCheckers, getModel, getParent, getPath, getType, setModel, setParent, setType, toJSON
-
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
-
-
-
Field Detail
-
_rightManager
private RightManager _rightManager
Rights manager
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
The current user provider
-
_semanticAnnotations
private List<SemanticAnnotation> _semanticAnnotations
-
-
Constructor Detail
-
RichTextAttributeDefinition
public RichTextAttributeDefinition()
-
-
Method Detail
-
getSemanticAnnotations
public List<SemanticAnnotation> getSemanticAnnotations()
Get the allowed semantic annotations for this rich text- Specified by:
getSemanticAnnotations
in interfaceDefaultContentType.AnnotableDefinition
- Returns:
- the allowed semantic annotations for that rich text
-
setSemanticAnnotations
public void setSemanticAnnotations(List<SemanticAnnotation> semAnnotations)
Set the allowed semantic annotations for this rich text- Specified by:
setSemanticAnnotations
in interfaceDefaultContentType.AnnotableDefinition
- Parameters:
semAnnotations
- the allowed semantic annotations for that rich text
-
_toJSON
protected Map<String,Object> _toJSON(DefinitionContext context) throws ProcessingException
Description copied from class:AbstractModelItem
Converts the model item in a JSON map- Overrides:
_toJSON
in classAttributeDefinition<RichText>
- Parameters:
context
- the context of the definition- Returns:
- The model item as a JSON map
- Throws:
ProcessingException
- If an error occurs when converting the model item
-
_getRightManager
protected RightManager _getRightManager()
Retrieves theRightManager
- Returns:
- the
RightManager
-
_getCurrentUserProvider
protected CurrentUserProvider _getCurrentUserProvider()
Retrieves theCurrentUserProvider
- Returns:
- the
CurrentUserProvider
-
-