Package org.ametys.cms.repository
Class ModifiableContentDataHolder
java.lang.Object
org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
org.ametys.cms.repository.ModifiableContentDataHolder
- All Implemented Interfaces:
DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
Implementation modifiable data holder for content
-
Field Summary
Modifier and TypeFieldDescriptionprotected ModifiableContent
the contentprotected ContentDataHelper
the content data helperFields inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
_modifiableParent, _modifiableRepositoryData, _modifiableRoot
Fields inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
_itemContainers, _parent, _repositoryData, _root
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Constructor Summary
ConstructorDescriptionModifiableContentDataHolder
(ModifiableContent content, ContentDataHelper contentDataHelper, ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers) Creates a modifiable content data holder -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends SynchronizationResult>
TCreates an instance ofSynchronizationResult
protected <T extends SynchronizationContext>
TCreates an instance ofSynchronizationContext
<T extends SynchronizationResult>
TsynchronizeValues
(ViewItemContainer viewItemContainer, Map<String, Object> values, SynchronizationContext context) Synchronizes the given values with the currentModifiableModelAwareDataHolder
's onesMethods inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModifiableModelAwareDataHolder
_getComposite, _getComposite, _getCompositeClass, _getRepeater, _getRepeater, _getRepeaterClass, _getRepeaterEntryClass, _removeValue, _removeValueForSynchronize, _setValue, _setValueForSynchronize, _updateStatusForSynchronize, getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRepositoryData, getRootDataHolder, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setComments, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues
Methods inherited from class org.ametys.plugins.repository.data.holder.impl.DefaultModelAwareDataHolder
_checkDefinition, _getFinalDataName, dataToSAX, getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToSAX, dataToSAX
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty, isMultiple
-
Field Details
-
_content
the content -
_contentDataHelper
the content data helper
-
-
Constructor Details
-
ModifiableContentDataHolder
public ModifiableContentDataHolder(ModifiableContent content, ContentDataHelper contentDataHelper, ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers) Creates a modifiable content data holder- Parameters:
content
- the contentcontentDataHelper
- the content data helperrepositoryData
- the repository data to useitemContainers
- the model containers to use to get information about definitions. Must match the given repository data. A repository data can have several item containers. For example, a content can have several content types.
-
-
Method Details
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(ViewItemContainer viewItemContainer, Map<String, Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeExceptionDescription copied from interface:ModifiableModelAwareDataHolder
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones- Specified by:
synchronizeValues
in interfaceModifiableModelAwareDataHolder
- Overrides:
synchronizeValues
in classDefaultModifiableModelAwareDataHolder
- Type Parameters:
T
- the type of theSynchronizationResult
- Parameters:
viewItemContainer
- TheViewItemContainer
containing all items to synchronizevalues
- the values to synchronizecontext
- the context of the synchronization- Returns:
- the
SynchronizationResult
- Throws:
UndefinedItemPathException
- if a key in the given Map refers to a data that is not defined by the modelBadItemTypeException
- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
_createSynchronizationContextInstance
Description copied from class:DefaultModifiableModelAwareDataHolder
Creates an instance ofSynchronizationContext
- Overrides:
_createSynchronizationContextInstance
in classDefaultModifiableModelAwareDataHolder
- Type Parameters:
T
- the type of theSynchronizationContext
- Returns:
- the created
SynchronizationContext
-
_createSetValueResultInstance
Description copied from class:DefaultModifiableModelAwareDataHolder
Creates an instance ofSynchronizationResult
- Overrides:
_createSetValueResultInstance
in classDefaultModifiableModelAwareDataHolder
- Type Parameters:
T
- the type of theSynchronizationResult
- Returns:
- the created instance of
SynchronizationResult
-