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
ModifierConstructorDescriptionprotected
Creates a new instance of aRepositoryDataContext
protected
RepositoryDataContext
(DataContext context) Creates a new instance of aRepositoryDataContext
from 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 valuesboolean
Check 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 objectboolean
Check if the current data is externalizablestatic RepositoryDataContext
Creates a new instance of aRepositoryDataContext
static RepositoryDataContext
newInstance
(DataContext context) Creates a new instance of aRepositoryDataContext
from anotherDataContext
.<T extends RepositoryDataContext>
TwithExternalizableData
(Set<String> externalizableData) Sets the externalizable data<T extends RepositoryDataContext>
TwithExternalMetadataInCopy
(boolean copyExternalMetadata) Set totrue
to 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 aRepositoryDataContext
from 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 aRepositoryDataContext
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 aRepositoryDataContext
, with the current context values- Overrides:
cloneContext
in 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:
true
if the data is externalizable,false
otherwise
-
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:
true
if the external metadata should be copied,false
otherwise
-
withExternalMetadataInCopy
Set totrue
to copy the external metadata (alternative and status) (default tofalse
)- Type Parameters:
T
- the type of the retrievedDataContext
- Parameters:
copyExternalMetadata
-true
to copy the external metadata,false
otherwise- Returns:
- the current
RepositoryDataContext
-