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
Modifier and TypeFieldDescriptionprotected IndexableDataHolder
the default implementation of aModelAwareDataHolder
to useprotected ModelItemGroup
the definition of this repeater entryprotected IndexableRepeater
the repeater containing this entryprotected RepositoryData
The repository data of the repeater entryFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Constructor Summary
ConstructorDescriptionDefaultModelAwareRepeaterEntry
(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 currentDataHolder
dataToJSONForEdition
(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view in edition mode in the currentDataHolder
Retrieves the default implementation of aDataHolder
to useRetrieves the holding repeater of this entry.int
Retrieves the position of this entry in the repeaterRetrieves the repository data used by thisDataHolder
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.group.Composite
dataToSAX, getDataNames, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToJSON, dataToSAX
Methods inherited from interface org.ametys.cms.data.holder.group.IndexableComposite
getComposite, getExternalComposite, getExternalRepeater, getLocalComposite, getLocalRepeater, getParentDataHolder, getRepeater, getRootDataHolder
Methods 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, hasValueOrEmpty
Methods 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 aModelAwareDataHolder
to 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:RepeaterEntry
Retrieves the position of this entry in the repeater- Specified by:
getPosition
in interfaceRepeaterEntry
- Returns:
- the position of this entry in the repeater
-
dataToJSON
Description copied from interface:DataHolder
Convert the data at the given path into a JSON object- Specified by:
dataToJSON
in interfaceComposite
- Specified by:
dataToJSON
in 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:ModelAwareDataHolder
Convert the data in the given view of the currentDataHolder
- Specified by:
dataToJSON
in interfaceModelAwareComposite
- Specified by:
dataToJSON
in interfaceModelAwareDataHolder
- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing 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:ModelAwareDataHolder
Convert the data in the given view in edition mode in the currentDataHolder
- Specified by:
dataToJSONForEdition
in interfaceModelAwareComposite
- Specified by:
dataToJSONForEdition
in interfaceModelAwareDataHolder
- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing 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:Composite
Retrieves the default implementation of aDataHolder
to use- Specified by:
getDefaultDataHolder
in interfaceComposite
- Specified by:
getDefaultDataHolder
in interfaceIndexableComposite
- Specified by:
getDefaultDataHolder
in interfaceModelAwareComposite
- Returns:
- the
DataHolder
-
getRepositoryData
Description copied from interface:DataHolder
Retrieves the repository data used by thisDataHolder
- Specified by:
getRepositoryData
in interfaceDataHolder
- Returns:
- the repository data used by this
DataHolder
-
getHoldingRepeater
Description copied from interface:RepeaterEntry
Retrieves the holding repeater of this entry.- Specified by:
getHoldingRepeater
in interfaceIndexableRepeaterEntry
- Specified by:
getHoldingRepeater
in interfaceModelAwareRepeaterEntry
- Specified by:
getHoldingRepeater
in interfaceRepeaterEntry
- Returns:
- the holding repeater of this entry
-