Package org.ametys.cms.model
Class CMSDataContext
java.lang.Object
org.ametys.runtime.model.type.DataContext
org.ametys.plugins.repository.model.RepositoryDataContext
org.ametys.cms.model.CMSDataContext
- Direct Known Subclasses:
IndexableDataContext
Object that gives some context for cms data manipulation
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new instance of aCMSDataContext
protected
CMSDataContext
(DataContext context) Creates a new instance of aCMSDataContext
from anotherDataContext
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of aCMSDataContext
, with the current context valuesint
Retrieves the rich text max length.static CMSDataContext
Creates a new instance of aCMSDataContext
static CMSDataContext
newInstance
(DataContext context) Creates a new instance of aCMSDataContext
from anotherDataContext
.<T extends CMSDataContext>
TwithRichTextMaxLength
(int richTextMaxLength) Sets the rich text max length Set to 0 to keep the whole rich text content (default)Methods inherited from class org.ametys.plugins.repository.model.RepositoryDataContext
_getRootObject, _withRootObject, copyExternalMetadata, getExternalizableData, getObject, getObjectId, getRootObjectId, isDataExternalizable, withExternalizableData, withExternalMetadataInCopy, withObject
Methods inherited from class org.ametys.runtime.model.type.DataContext
addSegmentToDataPath, addSuffixToLastSegment, getDataPath, getDataPathLastSegment, getFullDataPath, getLocale, getModelItem, getViewItem, renderDisabledValues, renderEmptyValues, withDataPath, withDisabledValues, withEmptyValues, withFullDataPath, withLocale, withModelItem, withViewItem
-
Constructor Details
-
CMSDataContext
protected CMSDataContext()Creates a new instance of aCMSDataContext
-
CMSDataContext
Creates a new instance of aCMSDataContext
from anotherDataContext
- Parameters:
context
- the data context to copy
-
-
Method Details
-
newInstance
Creates a new instance of aCMSDataContext
- Returns:
- the created instance
-
newInstance
Creates a new instance of aCMSDataContext
from anotherDataContext
. It can be the same implementation or another one, but it will be casted to the current implementation.- Parameters:
context
- the data context to copy- Returns:
- the created instance
-
cloneContext
Creates a new instance of aCMSDataContext
, with the current context values- Overrides:
cloneContext
in classRepositoryDataContext
- Returns:
- the created instance
-
getRichTextMaxLength
Retrieves the rich text max length. If the max length is 0, the whole rich text content is kept- Returns:
- the rich text max length
-
withRichTextMaxLength
Sets the rich text max length Set to 0 to keep the whole rich text content (default)- Type Parameters:
T
- the type of the retrievedDataContext
- Parameters:
richTextMaxLength
- the rich text max length to set- Returns:
- the current
CMSDataContext
-