Class DefaultModelAwareRepeaterEntry
java.lang.Object
org.ametys.cms.data.holder.group.impl.DefaultModelAwareRepeaterEntry
- All Implemented Interfaces:
IndexableComposite,IndexableRepeaterEntry,IndexableDataHolder,DataHolder,Composite,ModelAwareComposite,ModelAwareRepeaterEntry,RepeaterEntry,ModelAwareDataHolder
- Direct Known Subclasses:
DefaultModifiableModelAwareRepeaterEntry
Class for model aware repeater entries
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IndexableDataHolderthe default implementation of aModelAwareDataHolderto useprotected ModelItemGroupthe definition of this repeater entryprotected IndexableRepeaterthe repeater containing this entryprotected RepositoryDataThe repository data of the repeater entryFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultModelAwareRepeaterEntry(RepositoryData repositoryData, IndexableRepeater repeater, ModelItemGroup definition) Creates a model aware repeater entry -
Method Summary
Modifier and TypeMethodDescriptiondataToJSON(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view of the currentDataHolderdataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view in edition mode in the currentDataHolderRetrieves the default implementation of aDataHolderto useRetrieves the holding repeater of this entry.intRetrieves the position of this entry in the repeaterRetrieves the repository data used by thisDataHolderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.data.holder.group.Composite
dataToSAX, getDataNames, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToJSON, dataToSAXMethods inherited from interface org.ametys.cms.data.holder.group.IndexableComposite
getComposite, getExternalComposite, getExternalRepeater, getLocalComposite, getLocalRepeater, getParentDataHolder, getRepeater, getRootDataHolderMethods inherited from interface org.ametys.plugins.repository.data.holder.group.ModelAwareComposite
copyTo, dataToMap, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getType, isMultiple
-
Field Details
-
_repositoryData
The repository data of the repeater entry -
_defaultDataHolder
the default implementation of aModelAwareDataHolderto use -
_repeater
the repeater containing this entry -
_definition
the definition of this repeater entry
-
-
Constructor Details
-
DefaultModelAwareRepeaterEntry
public DefaultModelAwareRepeaterEntry(RepositoryData repositoryData, IndexableRepeater repeater, ModelItemGroup definition) Creates a model aware repeater entry- Parameters:
repositoryData- the repository data of the repeater entryrepeater- the repeater containing this entrydefinition- the definition of the repeater
-
-
Method Details
-
getPosition
Description copied from interface:RepeaterEntryRetrieves the position of this entry in the repeater- Specified by:
getPositionin interfaceRepeaterEntry- Returns:
- the position of this entry in the repeater
-
dataToJSON
Description copied from interface:DataHolderConvert the data at the given path into a JSON object- Specified by:
dataToJSONin interfaceComposite- Specified by:
dataToJSONin interfaceDataHolder- Parameters:
dataPath- the path of the data to convertcontext- The context of the data to convert- Returns:
- The value as JSON
-
dataToJSON
public Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderConvert the data in the given view of the currentDataHolder- Specified by:
dataToJSONin interfaceModelAwareComposite- Specified by:
dataToJSONin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to convertcontext- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
dataToJSONForEdition
public Map<String,Object> dataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderConvert the data in the given view in edition mode in the currentDataHolder- Specified by:
dataToJSONForEditionin interfaceModelAwareComposite- Specified by:
dataToJSONForEditionin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to convertcontext- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
getDefaultDataHolder
Description copied from interface:CompositeRetrieves the default implementation of aDataHolderto use- Specified by:
getDefaultDataHolderin interfaceComposite- Specified by:
getDefaultDataHolderin interfaceIndexableComposite- Specified by:
getDefaultDataHolderin interfaceModelAwareComposite- Returns:
- the
DataHolder
-
getRepositoryData
Description copied from interface:DataHolderRetrieves the repository data used by thisDataHolder- Specified by:
getRepositoryDatain interfaceDataHolder- Returns:
- the repository data used by this
DataHolder
-
getHoldingRepeater
Description copied from interface:RepeaterEntryRetrieves the holding repeater of this entry.- Specified by:
getHoldingRepeaterin interfaceIndexableRepeaterEntry- Specified by:
getHoldingRepeaterin interfaceModelAwareRepeaterEntry- Specified by:
getHoldingRepeaterin interfaceRepeaterEntry- Returns:
- the holding repeater of this entry
-