Interface DataAwareAmetysObject
-
- All Superinterfaces:
AmetysObject
,DataHolder
- All Known Subinterfaces:
CommentableContent
,Content
,MetadataAwarePagesContainer
,ModelAwareDataAwareAmetysObject
,ModelAwareJCRAmetysObject
,ModelLessDataAwareAmetysObject
,ModelLessJCRAmetysObject
,ModifiableContent
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,ModifiablePage
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,ModifiableZone
,ModifiableZoneItem
,Page
,ProgramPart
,SharedContent
,TraversableProgramPart
,WebContent
,WorkflowAwareContent
,Zone
,ZoneItem
- All Known Implementing Classes:
AbstractBlogPage
,AbstractLevelPage
,AbstractOdfPage
,AbstractProgram
,AbstractProgramPart
,AbstractSurveyElement
,AbstractTraversableProgramPart
,Catalog
,Container
,ContentBackupAmetysObject
,Course
,CourseList
,CoursePage
,CoursePart
,CourseZone
,CourseZoneItem
,DefaultContent
,DefaultPage
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,DefaultZone
,DefaultZoneItem
,FirstLevelPage
,FirstLevelZone
,FirstLevelZoneItem
,JCRProjectMember
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,OrgUnitPage
,OrgUnitZone
,OrgUnitZoneItem
,Person
,PostListZone
,PostListZoneItem
,PostZone
,PostZoneItem
,Program
,ProgramPage
,ProgramZone
,ProgramZoneItem
,Project
,RedirectPage
,SecondLevelPage
,SecondLevelZone
,SecondLevelZoneItem
,Site
,Sitemap
,StaticZone
,StaticZoneItem
,SubProgram
,Survey
,SurveyPage
,SurveyQuestion
,TransitionalPage
,TransitionalZone
,TransitionalZoneItem
,UGCPage
,UGCTransitionalPage
,UGCTransitionalZone
,UGCTransitionalZoneItem
,UGCZone
,UGCZoneItem
,UserPage
,UserZone
,UserZoneItem
,VirtualMonthPage
,VirtualPostPage
,VirtualPostsPage
,VirtualTagPage
,VirtualTagsPage
,VirtualYearPage
,VirtualYearsPage
public interface DataAwareAmetysObject extends AmetysObject, DataHolder
AmetysObject
that can handle data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
copyTo(ModifiableDataHolder dataHolder)
Copies the currentDataHolder
to the givenModifiableModelAwareDataHolder
.default void
dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale)
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 pathDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.default Collection<String>
getDataNames()
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite datadefault RepositoryData
getRepositoryData()
Retrieves the repository data used by thisDataHolder
default boolean
hasValue(String dataPath)
Checks if there is a value for the data at the given path-
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.holder.DataHolder
dataToSAX, getComposite
-
-
-
-
Method Detail
-
getDataHolder
DataHolder getDataHolder()
Returns theDataHolder
of thisAmetysObject
.- Returns:
- the
DataHolder
of thisAmetysObject
-
hasValue
default boolean hasValue(String dataPath) throws IllegalArgumentException
Description copied from interface:DataHolder
Checks if there is a value for the data at the given path- Specified by:
hasValue
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
default Collection<String> 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
default void dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale) throws SAXException, IOException
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 SAXlocale
- The locale to use for localized data, such asMultilingualString
. Can benull
to generate SAX events for all existingLocale
s.- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O API
-
getRepositoryData
default RepositoryData 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
-
-