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
public class ModifiableContentDataHolder extends DefaultModifiableModelAwareDataHolder
Implementation modifiable data holder for content
-
-
Field Summary
Fields Modifier and Type Field Description protected ModifiableContent
_content
the contentprotected ContentDataHelper
_contentDataHelper
the content data helper-
Fields 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
Constructors Constructor Description ModifiableContentDataHolder(ModifiableContent content, ContentDataHelper contentDataHelper, ModifiableRepositoryData repositoryData, Collection<? extends ModelItemContainer> itemContainers)
Creates a modifiable content data holder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends SynchronizationResult>
T_createSetValueResultInstance()
Creates an instance ofSynchronizationResult
protected <T extends SynchronizationContext>
T_createSynchronizationContextInstance()
Creates an instance ofSynchronizationContext
<T extends SynchronizationResult>
TsynchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, SynchronizationContext context)
Synchronizes the given values with the currentModifiableModelAwareDataHolder
's ones-
Methods 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 Detail
-
_content
protected ModifiableContent _content
the content
-
_contentDataHelper
protected ContentDataHelper _contentDataHelper
the content data helper
-
-
Constructor Detail
-
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 Detail
-
synchronizeValues
public <T extends SynchronizationResult> T synchronizeValues(ViewItemContainer viewItemContainer, Map<String,Object> values, SynchronizationContext context) throws UndefinedItemPathException, BadItemTypeException
Description 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
protected <T extends SynchronizationContext> T _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
protected <T extends SynchronizationResult> T _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
-
-