Package org.ametys.cms.data.holder.group
Interface IndexableRepeater
- All Superinterfaces:
ModelAwareRepeater
,Repeater
- All Known Subinterfaces:
ModifiableIndexableRepeater
- All Known Implementing Classes:
DefaultModelAwareRepeater
,DefaultModifiableModelAwareRepeater
Interface for indexable repeaters
-
Method Summary
Modifier and TypeMethodDescriptionList<? extends IndexableRepeaterEntry>
Retrieves the repeater entries, sorted by positiongetEntry
(int position) Retrieves the repeater entry at the given position.Retrieves the parent of the currentRepeater
Retrieves the rootDataHolder
of the current repeaterdefault List<org.apache.solr.common.SolrInputDocument>
indexData
(org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument rootDocument, String solrFieldPrefix) Indexes all data and properties of thisRepeater
List<org.apache.solr.common.SolrInputDocument>
indexData
(org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument rootDocument, String solrFieldPrefix, IndexableDataContext context) Indexes all data and properties of thisRepeater
Methods inherited from interface org.ametys.plugins.repository.data.holder.group.ModelAwareRepeater
dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToSAX, dataToSAX, dataToSAX, dataToSAX, getModel
Methods inherited from interface org.ametys.plugins.repository.data.holder.group.Repeater
copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryData, getSize, hasEntry
-
Method Details
-
indexData
default List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument rootDocument, String solrFieldPrefix) throws BadItemTypeException Indexes all data and properties of thisRepeater
- Parameters:
document
- the solr document representing thRepeater
rootDocument
- the solr document of the root object.solrFieldPrefix
- the prefix of the solr field- Returns:
- additional solr documents that may have been created (ex: repeater entries)
- Throws:
BadItemTypeException
- if the saxed value's type does not matches the stored data
-
indexData
List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument rootDocument, String solrFieldPrefix, IndexableDataContext context) throws BadItemTypeException Indexes all data and properties of thisRepeater
- Parameters:
document
- the solr document representing thisRepeater
rootDocument
- the solr document of the root object.solrFieldPrefix
- the prefix of the solr fieldcontext
- The context of the data to index- Returns:
- additional solr documents that may have been created (ex: repeater entries)
- Throws:
BadItemTypeException
- if the saxed value's type does not matches the stored data
-
getEntries
List<? extends IndexableRepeaterEntry> getEntries()Description copied from interface:Repeater
Retrieves the repeater entries, sorted by position- Specified by:
getEntries
in interfaceModelAwareRepeater
- Specified by:
getEntries
in interfaceRepeater
- Returns:
- the repeater entries
-
getEntry
Description copied from interface:Repeater
Retrieves the repeater entry at the given position. The position starts at index 1. The position can be an integer between 1 and the repeater size to get an entry from the beginning Or the position can an integer between 0 and - the repeater size to get an entry from the end (0 means at the end, -1 means before the last one and so on)- Specified by:
getEntry
in interfaceModelAwareRepeater
- Specified by:
getEntry
in interfaceRepeater
- Parameters:
position
- the position of the entry to retrieve- Returns:
- the repeater entry,
null
if there is no entry at this position
-
getParentDataHolder
Description copied from interface:Repeater
Retrieves the parent of the currentRepeater
- Specified by:
getParentDataHolder
in interfaceModelAwareRepeater
- Specified by:
getParentDataHolder
in interfaceRepeater
- Returns:
- the parent of the current
Repeater
-
getRootDataHolder
Description copied from interface:Repeater
Retrieves the rootDataHolder
of the current repeater- Specified by:
getRootDataHolder
in interfaceModelAwareRepeater
- Specified by:
getRootDataHolder
in interfaceRepeater
- Returns:
- the root
DataHolder
-