Class DefaultIndexableRepeater
java.lang.Object
org.ametys.plugins.repository.data.holder.group.impl.DefaultRepeater
org.ametys.cms.data.holder.group.impl.DefaultIndexableRepeater
- All Implemented Interfaces:
IndexableRepeater,Repeater
Class for indexable model aware repeaters
-
Field Summary
Fields inherited from class org.ametys.plugins.repository.data.holder.group.impl.DefaultRepeater
_definition, _parent, _repositoryData, _root -
Constructor Summary
ConstructorsConstructorDescriptionDefaultIndexableRepeater(RepositoryData repositoryData, RepeaterDefinition definition, IndexableDataHolder parent, IndexableDataHolder root) Creates a default indexable repeater -
Method Summary
Modifier and TypeMethodDescriptionprotected IndexableRepeaterEntrycreateRepeaterEntryInstance(RepositoryData entryRepositoryData) Creates an instance ofRepeaterEntryto useList<? extends IndexableRepeaterEntry> Retrieves the repeater entries, sorted by positiongetEntry(int position) Retrieves the repeater entry at the given position.Retrieves the parent of the currentRepeaterRetrieves the rootDataHolderof the current repeaterList<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument rootDocument, String solrFieldPrefix, CMSDataContext context) Indexes all data and properties of thisRepeaterMethods inherited from class org.ametys.plugins.repository.data.holder.group.impl.DefaultRepeater
copyTo, dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDifferences, getDifferencesInAppendMode, getDifferencesInReplaceAllMode, getDifferencesInReplaceMode, getEntryAttributes, getModel, getRepositoryData, getSize, hasDifferences, hasDifferencesInAppendMode, hasDifferencesInReplaceAllMode, hasDifferencesInReplaceMode, hasEntry, hasToMoveEntriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.data.holder.group.IndexableRepeater
indexDataMethods inherited from interface org.ametys.plugins.repository.data.holder.group.Repeater
copyTo, copyTo, dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSON, dataToJSONForEdition, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDifferences, getDifferences, getModel, getRepositoryData, getSize, hasDifferences, hasDifferences, hasEntry, hasToMoveEntries
-
Constructor Details
-
DefaultIndexableRepeater
public DefaultIndexableRepeater(RepositoryData repositoryData, RepeaterDefinition definition, IndexableDataHolder parent, IndexableDataHolder root) Creates a default indexable repeater- Parameters:
repositoryData- the repository data of the repeaterdefinition- the definition of the repeaterparent- the parent of the created repeaterroot- the rootIndexableDataHolder
-
-
Method Details
-
getEntries
Description copied from interface:RepeaterRetrieves the repeater entries, sorted by position- Specified by:
getEntriesin interfaceIndexableRepeater- Specified by:
getEntriesin interfaceRepeater- Overrides:
getEntriesin classDefaultRepeater- Returns:
- the repeater entries
-
getEntry
Description copied from interface:RepeaterRetrieves 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:
getEntryin interfaceIndexableRepeater- Specified by:
getEntryin interfaceRepeater- Overrides:
getEntryin classDefaultRepeater- Parameters:
position- the position of the entry to retrieve- Returns:
- the repeater entry,
nullif there is no entry at this position
-
createRepeaterEntryInstance
Description copied from class:DefaultRepeaterCreates an instance ofRepeaterEntryto use- Overrides:
createRepeaterEntryInstancein classDefaultRepeater- Parameters:
entryRepositoryData- the repository data of the entry to create- Returns:
- the created instance of
RepeaterEntry
-
indexData
public List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, org.apache.solr.common.SolrInputDocument rootDocument, String solrFieldPrefix, CMSDataContext context) throws BadItemTypeException Description copied from interface:IndexableRepeaterIndexes all data and properties of thisRepeater- Specified by:
indexDatain interfaceIndexableRepeater- Parameters:
document- the solr document representing thisRepeaterrootDocument- 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
-
getParentDataHolder
Description copied from interface:RepeaterRetrieves the parent of the currentRepeater- Specified by:
getParentDataHolderin interfaceIndexableRepeater- Specified by:
getParentDataHolderin interfaceRepeater- Overrides:
getParentDataHolderin classDefaultRepeater- Returns:
- the parent of the current
Repeater
-
getRootDataHolder
Description copied from interface:RepeaterRetrieves the rootDataHolderof the current repeater- Specified by:
getRootDataHolderin interfaceIndexableRepeater- Specified by:
getRootDataHolderin interfaceRepeater- Overrides:
getRootDataHolderin classDefaultRepeater- Returns:
- the root
DataHolder
-