Package org.ametys.cms.data
Class ContentSynchronizationContext
- java.lang.Object
-
- org.ametys.plugins.repository.data.holder.values.SynchronizationContext
-
- org.ametys.cms.data.ContentSynchronizationContext
-
public class ContentSynchronizationContext extends SynchronizationContext
Object that gives some context for content attributes synchronization
-
-
Field Summary
Fields Modifier and Type Field Description private boolean_enableInvertRelationsprivate Optional<Collection<ReferencedContents>>_referencedContents
-
Constructor Summary
Constructors Modifier Constructor Description protectedContentSynchronizationContext()Creates a new instance of aContentSynchronizationContext
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Collection<ReferencedContents>>getReferencedContents()Retrieves the referenced contents to modify for invert relationsbooleaninvertRelationsEnabled()Determines if the invert relations of the content attributes have to be synchronizedstatic ContentSynchronizationContextnewInstance()Creates a new instance of aContentSynchronizationContextContentSynchronizationContextwithDefaultFromModel(boolean useDefaultFromModel)Set totrueto use the default value from the model (default tofalse)ContentSynchronizationContextwithInvertRelations(boolean enableInvertRelations)Set tofalseto avoid to synchronize the invert relations of the content attributes (default totrue)ContentSynchronizationContextwithReferencedContents(Collection<ReferencedContents> referencedContents)Sets the referenced contents to modify for invert relationsContentSynchronizationContextwithStatus(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
getStatusToSynchronize, useDefaultFromModel
-
-
-
-
Field Detail
-
_enableInvertRelations
private boolean _enableInvertRelations
-
_referencedContents
private Optional<Collection<ReferencedContents>> _referencedContents
-
-
Constructor Detail
-
ContentSynchronizationContext
protected ContentSynchronizationContext()
Creates a new instance of aContentSynchronizationContext
-
-
Method Detail
-
newInstance
public static ContentSynchronizationContext newInstance()
Creates a new instance of aContentSynchronizationContext- Returns:
- the created instance
-
invertRelationsEnabled
public boolean invertRelationsEnabled()
Determines if the invert relations of the content attributes have to be synchronized- Returns:
trueif the invert relations of the content attributes have to be synchronized,falseotherwise.
-
withInvertRelations
public ContentSynchronizationContext withInvertRelations(boolean enableInvertRelations)
Set tofalseto avoid to synchronize the invert relations of the content attributes (default totrue)- Parameters:
enableInvertRelations-trueto synchronized the invert relations of the content attributes,falseotherwise.- Returns:
- the current
ContentSynchronizationContext
-
getReferencedContents
public Optional<Collection<ReferencedContents>> 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- theReferencedContentss to set- Returns:
- the current
ContentSynchronizationContext
-
withDefaultFromModel
public ContentSynchronizationContext withDefaultFromModel(boolean useDefaultFromModel)
Description copied from class:SynchronizationContextSet totrueto use the default value from the model (default tofalse)- Overrides:
withDefaultFromModelin classSynchronizationContext- Parameters:
useDefaultFromModel-trueto use the default value from the model,falseotherwise- Returns:
- the current
SynchronizationContext
-
withStatus
public ContentSynchronizationContext withStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus)
Description copied from class:SynchronizationContextSets the status to determine which values (locals or externals) have to be synchronized (default to local)- Overrides:
withStatusin classSynchronizationContext- Parameters:
externalizableDataStatus- the status to determine which values have to be synchronized- Returns:
- the current
SynchronizationContext
-
-