Package org.ametys.cms.repository
Class ModifiableContentDataHolder
java.lang.Object
org.ametys.cms.data.holder.impl.DefaultModelAwareDataHolder
org.ametys.cms.data.holder.impl.DefaultModifiableModelAwareDataHolder
org.ametys.cms.repository.ModifiableContentDataHolder
- All Implemented Interfaces:
IndexableDataHolder
,ModifiableIndexableDataHolder
,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.cms.data.holder.impl.DefaultModifiableModelAwareDataHolder
_lockableAmetysObject, _modifiableParent, _modifiableRepositoryData, _modifiableRoot
Fields inherited from class org.ametys.cms.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
(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Synchronizes the given values with the currentModifiableModelAwareDataHolder
's onesMethods inherited from class org.ametys.cms.data.holder.impl.DefaultModifiableModelAwareDataHolder
_checkModifiableDefinition, _getComposite, _getComposite, _getCompositeClass, _getRepeater, _getRepeater, _getRepeaterClass, _getRepeaterEntryClass, _removeValue, _removeValueForSynchronize, _setValue, _setValueForSynchronize, _synchronizeElement, _synchronizeGroup, _synchronizeValues, _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.cms.data.holder.impl.DefaultModelAwareDataHolder
_checkDefinition, _checkDefinition, _checkElementDifferences, _checkElementDifferencesInRemoveMode, _checkStatusDifferences, _getDifferences, _getDifferencesInGroup, _getFinalDataName, _getPropertysAmetysObject, _hasDifferences, _hasDifferencesInElement, _hasDifferencesInGroup, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDifferences, hasDifferences, 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, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getType, getValue, getValue, getValue, hasComments, hasDefinition, hasDifferences, hasDifferences, 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(ViewItemAccessor viewItemAccessor, 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:
viewItemAccessor
- TheViewItemAccessor
for 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:DefaultModelAwareDataHolder
Creates an instance ofSynchronizationContext
- Overrides:
_createSynchronizationContextInstance
in classDefaultModelAwareDataHolder
- 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
-