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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ContentSynchronizationContext()
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 relationsboolean
invertRelationsEnabled()
Determines if the invert relations of the content attributes have to be synchronizedstatic ContentSynchronizationContext
newInstance()
Creates a new instance of aContentSynchronizationContext
ContentSynchronizationContext
withDefaultFromModel(boolean useDefaultFromModel)
Set totrue
to use the default value from the model (default tofalse
)ContentSynchronizationContext
withInvertRelations(boolean enableInvertRelations)
Set tofalse
to avoid to synchronize the invert relations of the content attributes (default totrue
)ContentSynchronizationContext
withReferencedContents(Collection<ReferencedContents> referencedContents)
Sets the referenced contents to modify for invert relationsContentSynchronizationContext
withStatus(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, useDefaultFromModel, withExternalizableDataContextEntry, withStatusForcedIfNotPresent
-
-
-
-
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:
true
if the invert relations of the content attributes have to be synchronized,false
otherwise.
-
withInvertRelations
public ContentSynchronizationContext withInvertRelations(boolean enableInvertRelations)
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
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
- theReferencedContents
s to set- Returns:
- the current
ContentSynchronizationContext
-
withDefaultFromModel
public ContentSynchronizationContext withDefaultFromModel(boolean useDefaultFromModel)
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
-
-