Class RepositoryDataContext
java.lang.Object
org.ametys.runtime.model.type.DataContext
org.ametys.plugins.repository.model.RepositoryDataContext
- Direct Known Subclasses:
CMSDataContext
Object that gives some context for repository data manipulation
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new instance of aRepositoryDataContextprotectedRepositoryDataContext(DataContext context) Creates a new instance of aRepositoryDataContextfrom anotherDataContext -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends DataAwareAmetysObject>
Optional<T> Retrieves the object from which the full data path is computedprotected <T extends RepositoryDataContext>
T_withRootObject(DataAwareAmetysObject rootObject) Set the object from which the full data path is computedCreates a new instance of aRepositoryDataContext, with the current context valuesbooleanCheck if the external metadata (alternative and status) should be copiedRetrieves the externalizable data<T extends DataAwareAmetysObject>
Optional<T> Retrieves the object from which the data path is computedRetrieves the identifier of the objectRetrieves the identifier of the root objectbooleanCheck if the current data is externalizablestatic RepositoryDataContextCreates a new instance of aRepositoryDataContextstatic RepositoryDataContextnewInstance(DataContext context) Creates a new instance of aRepositoryDataContextfrom anotherDataContext.<T extends RepositoryDataContext>
TwithExternalizableData(Set<String> externalizableData) Sets the externalizable data<T extends RepositoryDataContext>
TwithExternalMetadataInCopy(boolean copyExternalMetadata) Set totrueto copy the external metadata (alternative and status) (default tofalse)<T extends RepositoryDataContext>
TwithObject(DataAwareAmetysObject object) Set the object from which the data path is computedMethods 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
-
RepositoryDataContext
protected RepositoryDataContext()Creates a new instance of aRepositoryDataContext -
RepositoryDataContext
Creates a new instance of aRepositoryDataContextfrom anotherDataContext- Parameters:
context- the data context to copy
-
-
Method Details
-
newInstance
Creates a new instance of aRepositoryDataContext- Returns:
- the created instance
-
newInstance
Creates a new instance of aRepositoryDataContextfrom 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 aRepositoryDataContext, with the current context values- Overrides:
cloneContextin classDataContext- Returns:
- the created instance
-
getObject
Retrieves the object from which the data path is computed- Type Parameters:
T- Type of the object- Returns:
- the object
-
getObjectId
Retrieves the identifier of the object- Returns:
- the object's identifier
-
withObject
Set the object from which the data path is computed- Type Parameters:
T- the type of the retrievedDataContext- Parameters:
object- the object to set- Returns:
- the current
DataContext
-
_getRootObject
Retrieves the object from which the full data path is computed- Type Parameters:
T- Type of the root object- Returns:
- the root object
-
getRootObjectId
Retrieves the identifier of the root object- Returns:
- the root object's identifier
-
_withRootObject
Set the object from which the full data path is computed- Type Parameters:
T- the type of the retrievedDataContext- Parameters:
rootObject- the root object to set- Returns:
- the current
DataContext
-
getExternalizableData
Retrieves the externalizable data- Returns:
- the externalizable data
-
isDataExternalizable
Check if the current data is externalizable- Returns:
trueif the data is externalizable,falseotherwise
-
withExternalizableData
Sets the externalizable data- Type Parameters:
T- the type of the retrievedDataContext- Parameters:
externalizableData- the externalizable data to set- Returns:
- the current
RepositoryDataContext
-
copyExternalMetadata
Check if the external metadata (alternative and status) should be copied- Returns:
trueif the external metadata should be copied,falseotherwise
-
withExternalMetadataInCopy
Set totrueto copy the external metadata (alternative and status) (default tofalse)- Type Parameters:
T- the type of the retrievedDataContext- Parameters:
copyExternalMetadata-trueto copy the external metadata,falseotherwise- Returns:
- the current
RepositoryDataContext
-