Interface DataAwareAmetysObject
- All Superinterfaces:
AmetysObject
,DataHolder
- All Known Subinterfaces:
CalendarResource
,CommentableContent
,Content
,MetadataAwareSitemapElement
,ModelAwareDataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModelAwareJCRAmetysObject
,ModelAwareJCRAmetysObject
,ModelLessDataAwareAmetysObject
,ModelLessJCRAmetysObject
,ModifiableCalendar
,ModifiableCalendarEvent
,ModifiableContent
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,ModifiablePage
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,ModifiableZone
,ModifiableZoneItem
,Page
,ProgramPart
,SharedContent
,Task
,TasksList
,TraversableProgramPart
,WebContent
,WorkflowAwareContent
,Zone
,ZoneItem
- All Known Implementing Classes:
AbstractLevelPage
,AbstractOdfPage
,AbstractProgram
,AbstractProgramPart
,AbstractSitemapElement
,AbstractSurveyElement
,AbstractTraversableProgramPart
,Activity
,Cart
,Catalog
,CMISRootResourcesCollection
,Container
,ContentBackupAmetysObject
,ContentConsistencyResult
,Course
,CourseList
,CoursePage
,CoursePart
,CourseZone
,CourseZoneItem
,DefaultContent
,DefaultLink
,DefaultPage
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,DefaultZone
,DefaultZoneItem
,FirstLevelPage
,FirstLevelZone
,FirstLevelZoneItem
,Form
,FormEntry
,FormPageRule
,FormQuestion
,JCRCalendar
,JCRCalendarEvent
,JCRCalendarResource
,JCRProjectMember
,JCRResourcesCollection
,JCRTask
,JCRTasksList
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,OrgUnitPage
,OrgUnitZone
,OrgUnitZoneItem
,Person
,Program
,ProgramPage
,ProgramZone
,ProgramZoneItem
,Project
,Query
,RedirectPage
,SecondLevelPage
,SecondLevelZone
,SecondLevelZoneItem
,Site
,Sitemap
,StaticZoneItem
,SubProgram
,Survey
,SurveyPage
,SurveyQuestion
,TransitionalPage
,TransitionalZone
,TransitionalZoneItem
,UGCPage
,UGCTransitionalPage
,UGCTransitionalZone
,UGCTransitionalZoneItem
,UGCZone
,UGCZoneItem
,UserPage
,UserZone
,UserZoneItem
AmetysObject
that can handle data.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
copyTo
(ModifiableDataHolder dataHolder) Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.default Object
dataToJSON
(String dataPath) Convert the data at the given path into a JSON objectdefault Object
dataToJSON
(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdefault void
dataToSAX
(ContentHandler contentHandler, String dataPath) Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathdefault void
dataToSAX
(ContentHandler contentHandler, String dataPath, DataContext context) Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathdefault Composite
getComposite
(String compositePath) Retrieves the composite at the given pathReturns theDataHolder
of thisAmetysObject
.default Collection<String>
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite datadefault Optional<? extends DataHolder>
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the rootdefault RepositoryData
Retrieves the repository data used by thisDataHolder
default DataHolder
Retrieves theDataHolder
that is the root of the current onedefault boolean
Checks if there is a non empty value for the data at the given pathdefault boolean
hasValueOrEmpty
(String dataPath) Checks if there is a value, even empty, for the data at the given pathMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Method Details
-
getDataHolder
Returns theDataHolder
of thisAmetysObject
.- Returns:
- the
DataHolder
of thisAmetysObject
-
getComposite
default Composite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException Description copied from interface:DataHolder
Retrieves the composite at the given path- Specified by:
getComposite
in interfaceDataHolder
- 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 emptyBadItemTypeException
- if the stored value at the given path is not a composite
-
hasValue
Description copied from interface:DataHolder
Checks if there is a non empty value for the data at the given path- Specified by:
hasValue
in interfaceDataHolder
- Parameters:
dataPath
- path of the data- Returns:
true
if there is a non empty value for the data,false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or empty
-
hasValueOrEmpty
Description copied from interface:DataHolder
Checks if there is a value, even empty, for the data at the given path- Specified by:
hasValueOrEmpty
in interfaceDataHolder
- Parameters:
dataPath
- path of the data- Returns:
true
if there is value, even empty, for the data,false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or empty
-
getDataNames
Description copied from interface:DataHolder
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Specified by:
getDataNames
in interfaceDataHolder
- Returns:
- the names of all data contained by this data holder
-
copyTo
default void copyTo(ModifiableDataHolder dataHolder) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException Description copied from interface:DataHolder
Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.- Specified by:
copyTo
in interfaceDataHolder
- Parameters:
dataHolder
- The destination dataHolder. Can not be null.- Throws:
UndefinedItemPathException
- if one of the copied data is not defined by the model of the destinationModifiableModelAwareDataHolder
BadItemTypeException
- if the type defined by the model of the destinationModifiableModelAwareDataHolder
doesn't match the copied valueUnknownTypeException
- if there is no available type compatible with the copied value for the type extension point of the destinationModifiableModelLessDataHolder
NotUniqueTypeException
- if there is more than one available types compatibles with the copied value for the type extension point of the destinationModifiableModelLessDataHolder
-
dataToSAX
Description copied from interface:DataHolder
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Specified by:
dataToSAX
in interfaceDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-
dataToSAX
default void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException Description copied from interface:DataHolder
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Specified by:
dataToSAX
in interfaceDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAXcontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-
dataToJSON
Description copied from interface:DataHolder
Convert the data at the given path into a JSON object- Specified by:
dataToJSON
in interfaceDataHolder
- Parameters:
dataPath
- the path of the data to convert- Returns:
- The value as JSON
-
dataToJSON
Description copied from interface:DataHolder
Convert the data at the given path into a JSON object- 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
-
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
-
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 interfaceDataHolder
- 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 interfaceDataHolder
- Returns:
- the root
DataHolder
-