Package org.ametys.cms.data
Class ContentSynchronizationContext
java.lang.Object
org.ametys.plugins.repository.data.holder.values.SynchronizationContext
org.ametys.cms.data.ContentSynchronizationContext
Object that gives some context for content attributes synchronization
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new instance of aContentSynchronizationContext
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the referenced contents to modify for invert relationsboolean
Determines if the invert relations of the content attributes have to be synchronizedCreates a new instance of aContentSynchronizationContext
withDefaultFromModel
(boolean useDefaultFromModel) Set totrue
to use the default value from the model (default tofalse
)withInvertRelations
(boolean enableInvertRelations) Set tofalse
to avoid to synchronize the invert relations of the content attributes (default totrue
)withReferencedContents
(Collection<ReferencedContents> referencedContents) Sets the referenced contents to modify for invert relationswithStatus
(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus) Sets the status to determine which values (locals or externals) have to be synchronized (default to local)Methods inherited from class org.ametys.plugins.repository.data.holder.values.SynchronizationContext
forceStatusIfNotPresent, getExternalizableDataContext, getStatusToSynchronize, ignoreIncompatibleValues, useDefaultFromModel, withExternalizableDataContextEntry, withIncompatibleValuesIgnored, withStatusForcedIfNotPresent
-
Constructor Details
-
ContentSynchronizationContext
protected ContentSynchronizationContext()Creates a new instance of aContentSynchronizationContext
-
-
Method Details
-
newInstance
Creates a new instance of aContentSynchronizationContext
- Returns:
- the created instance
-
invertRelationsEnabled
Determines if the invert relations of the content attributes have to be synchronized- Returns:
true
if the invert relations of the content attributes have to be synchronized,false
otherwise.
-
withInvertRelations
Set tofalse
to avoid to synchronize the invert relations of the content attributes (default totrue
)- Parameters:
enableInvertRelations
-true
to synchronized the invert relations of the content attributes,false
otherwise.- Returns:
- the current
ContentSynchronizationContext
-
getReferencedContents
Retrieves the referenced contents to modify for invert relations- Returns:
- the referenced contents to modify for invert relations
-
withReferencedContents
public ContentSynchronizationContext withReferencedContents(Collection<ReferencedContents> referencedContents) Sets the referenced contents to modify for invert relations- Parameters:
referencedContents
- theReferencedContents
s to set- Returns:
- the current
ContentSynchronizationContext
-
withDefaultFromModel
Description copied from class:SynchronizationContext
Set totrue
to use the default value from the model (default tofalse
)- Overrides:
withDefaultFromModel
in classSynchronizationContext
- Parameters:
useDefaultFromModel
-true
to use the default value from the model,false
otherwise- Returns:
- the current
SynchronizationContext
-
withStatus
public ContentSynchronizationContext withStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus) Description copied from class:SynchronizationContext
Sets the status to determine which values (locals or externals) have to be synchronized (default to local)- Overrides:
withStatus
in classSynchronizationContext
- Parameters:
externalizableDataStatus
- the status to determine which values have to be synchronized- Returns:
- the current
SynchronizationContext
-