Package org.ametys.cms.data.ametysobject
Interface ModelAwareDataAwareAmetysObject
- All Superinterfaces:
AmetysObject
,DataAwareAmetysObject
,DataHolder
,IndexableDataHolder
,ModelAwareDataAwareAmetysObject
,ModelAwareDataHolder
- All Known Subinterfaces:
CalendarResource
,CommentableContent
,Content
,ContributorCommentableContent
,ModelAwareJCRAmetysObject
,ModifiableCalendar
,ModifiableCalendarEvent
,ModifiableContent
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,SharedContent
,Task
,TasksList
,Thread
,WebContent
,WorkflowAwareContent
- All Known Implementing Classes:
AbstractProgram
,AbstractProgramPart
,AbstractTraversableProgramPart
,Cart
,Catalog
,Container
,ContentBackupAmetysObject
,Course
,CourseList
,CoursePart
,DefaultContent
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,Form
,FormEntry
,FormPageRule
,FormQuestion
,JCRCalendar
,JCRCalendarEvent
,JCRCalendarResource
,JCRTask
,JCRTasksList
,JCRThread
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,Person
,Program
,Query
,Site
,SubProgram
public interface ModelAwareDataAwareAmetysObject
extends ModelAwareDataAwareAmetysObject, IndexableDataHolder
Model aware
AmetysObject
that can handle indexable data.-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Method Summary
Modifier and TypeMethodDescriptiondefault IndexableComposite
getComposite
(String compositePath) Retrieves the composite at the given pathReturns theDataHolder
of thisAmetysObject
.default IndexableComposite
getExternalComposite
(String compositePath) Retrieves the external composite at the given pathdefault IndexableRepeater
getExternalRepeater
(String repeaterPath) Retrieves the external repeater at the given pathdefault IndexableComposite
getLocalComposite
(String compositePath) Retrieves the local composite at the given pathdefault IndexableRepeater
getLocalRepeater
(String repeaterPath) Retrieves the local repeater at the given pathdefault Optional<? extends IndexableDataHolder>
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the rootdefault IndexableRepeater
getRepeater
(String repeaterPath) Retrieves the repeater at the given pathdefault IndexableDataHolder
Retrieves theDataHolder
that is the root of the current onedefault Optional<SystemPropertyExtensionPoint>
Retrieves the system properties extension point of thisAmetysObject
, or an emptyOptional
if this object does not support system propertiesdefault List<org.apache.solr.common.SolrInputDocument>
indexData
(org.apache.solr.common.SolrInputDocument document) Indexes all data and properties of thisAmetysObject
default List<org.apache.solr.common.SolrInputDocument>
indexData
(org.apache.solr.common.SolrInputDocument document, IndexableDataContext context) Indexes all data and properties of thisAmetysObject
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryData
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, 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, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultiple
-
Method Details
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getSystemPropertyExtensionPoint
Retrieves the system properties extension point of thisAmetysObject
, or an emptyOptional
if this object does not support system properties- Returns:
- the system properties extension point of this
AmetysObject
-
indexData
default List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document) throws BadItemTypeException Indexes all data and properties of thisAmetysObject
- Parameters:
document
- the solr document representing thisAmetysObject
- 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
default List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, IndexableDataContext context) throws BadItemTypeException Indexes all data and properties of thisAmetysObject
- Parameters:
document
- the solr document representing thisAmetysObject
context
- 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
-
getComposite
default IndexableComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:DataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceDataAwareAmetysObject
- Specified by:
getComposite
in interfaceDataHolder
- Specified by:
getComposite
in interfaceIndexableDataHolder
- Specified by:
getComposite
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getComposite
in interfaceModelAwareDataHolder
- Parameters:
compositePath
- path of the composite to retrieve- Returns:
- the composite or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given composite path is null or emptyUndefinedItemPathException
- if the given composite path is not defined by the modelBadItemTypeException
- if the stored value at the given path is not a compositeBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalComposite
default IndexableComposite getLocalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the local composite at the given path- Specified by:
getLocalComposite
in interfaceIndexableDataHolder
- Specified by:
getLocalComposite
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getLocalComposite
in interfaceModelAwareDataHolder
- Parameters:
compositePath
- path of the externalizable composite to retrieve- Returns:
- the composite or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given composite path is null or emptyUndefinedItemPathException
- if the given composite path is not defined by the modelBadItemTypeException
- if the stored value at the given path is not a compositeBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
default IndexableComposite getExternalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the external composite at the given path- Specified by:
getExternalComposite
in interfaceIndexableDataHolder
- Specified by:
getExternalComposite
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getExternalComposite
in interfaceModelAwareDataHolder
- Parameters:
compositePath
- path of the externalizable composite to retrieve- Returns:
- the composite or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given composite path is null or emptyUndefinedItemPathException
- if the given composite path is not defined by the modelBadItemTypeException
- if the stored value at the given path is not a compositeBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
default IndexableRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the repeater at the given path- Specified by:
getRepeater
in interfaceIndexableDataHolder
- Specified by:
getRepeater
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getRepeater
in interfaceModelAwareDataHolder
- Parameters:
repeaterPath
- path of the repeater to retrieve- Returns:
- the repeater or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given repeater path is null or emptyUndefinedItemPathException
- if the given repeater path is not defined by the modelBadItemTypeException
- if the stored value at the given path is not a repeaterBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
default IndexableRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the local repeater at the given path- Specified by:
getLocalRepeater
in interfaceIndexableDataHolder
- Specified by:
getLocalRepeater
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getLocalRepeater
in interfaceModelAwareDataHolder
- Parameters:
repeaterPath
- path of the externalizable repeater to retrieve- Returns:
- the repeater or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given repeater path is null or emptyUndefinedItemPathException
- if the given repeater path is not defined by the modelBadItemTypeException
- if the stored value at the given path is not a repeaterBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
default IndexableRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolder
Retrieves the external repeater at the given path- Specified by:
getExternalRepeater
in interfaceIndexableDataHolder
- Specified by:
getExternalRepeater
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getExternalRepeater
in interfaceModelAwareDataHolder
- Parameters:
repeaterPath
- path of the externalizable repeater to retrieve- Returns:
- the repeater or
null
if not exists or is empty - Throws:
IllegalArgumentException
- if the given repeater path is null or emptyUndefinedItemPathException
- if the given repeater path is not defined by the modelBadItemTypeException
- if the stored value at the given path is not a repeaterBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getParentDataHolder
Description copied from interface:DataHolder
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the root- Specified by:
getParentDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getParentDataHolder
in interfaceDataHolder
- Specified by:
getParentDataHolder
in interfaceIndexableDataHolder
- Specified by:
getParentDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getParentDataHolder
in interfaceModelAwareDataHolder
- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolder
Retrieves theDataHolder
that is the root of the current one- Specified by:
getRootDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getRootDataHolder
in interfaceDataHolder
- Specified by:
getRootDataHolder
in interfaceIndexableDataHolder
- Specified by:
getRootDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getRootDataHolder
in interfaceModelAwareDataHolder
- Returns:
- the root
DataHolder
-