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,DefaultLink,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
AmetysObjectthat can handle data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcopyTo(ModifiableDataHolder dataHolder)Copies the currentDataHolderto the givenModifiableModelAwareDataHolder.default voiddataToSAX(ContentHandler contentHandler, String dataPath)Generates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given pathdefault voiddataToSAX(ContentHandler contentHandler, String dataPath, DataContext context)Generates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given pathdefault CompositegetComposite(String compositePath)Retrieves the composite at the given pathDataHoldergetDataHolder()Returns theDataHolderof 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 Optional<? extends DataHolder>getParentDataHolder()Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootdefault RepositoryDatagetRepositoryData()Retrieves the repository data used by thisDataHolderdefault DataHoldergetRootDataHolder()Retrieves theDataHolderthat is the root of the current onedefault booleanhasNonEmptyValue(String dataPath)Checks if there is a non empty value for the data at the given pathdefault booleanhasValue(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
-
-
-
-
Method Detail
-
getDataHolder
DataHolder getDataHolder()
Returns theDataHolderof thisAmetysObject.- Returns:
- the
DataHolderof thisAmetysObject
-
getComposite
default Composite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException
Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Parameters:
compositePath- path of the composite to retrieve- Returns:
- the composite or
nullif 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
default boolean hasValue(String dataPath) throws IllegalArgumentException
Description copied from interface:DataHolderChecks if there is a value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- Parameters:
dataPath- path of the data- Returns:
trueif there is value (even empty) for the data,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or empty
-
hasNonEmptyValue
default boolean hasNonEmptyValue(String dataPath) throws IllegalArgumentException
Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasNonEmptyValuein interfaceDataHolder- Parameters:
dataPath- path of the data- Returns:
trueif there is a non empty value for the data,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or empty
-
getDataNames
default Collection<String> getDataNames()
Description copied from interface:DataHolderRetrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Specified by:
getDataNamesin 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:DataHolderCopies the currentDataHolderto the givenModifiableModelAwareDataHolder.- Specified by:
copyToin 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 destinationModifiableModelAwareDataHolderBadItemTypeException- if the type defined by the model of the destinationModifiableModelAwareDataHolderdoesn't match the copied valueUnknownTypeException- if there is no available type compatible with the copied value for the type extension point of the destinationModifiableModelLessDataHolderNotUniqueTypeException- 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) throws SAXException, IOException
Description copied from interface:DataHolderGenerates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given path- Specified by:
dataToSAXin interfaceDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsdataPath- the path of the data to SAX- Throws:
SAXException- if an error occurs during the SAX events generationIOException- if an error occurs while reading a value using the I/O API
-
dataToSAX
default void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException, IOException
Description copied from interface:DataHolderGenerates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given path- Specified by:
dataToSAXin interfaceDataHolder- Parameters:
contentHandler- theContentHandlerthat 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 generationIOException- if an error occurs while reading a value using the I/O API
-
getRepositoryData
default RepositoryData getRepositoryData()
Description copied from interface:DataHolderRetrieves the repository data used by thisDataHolder- Specified by:
getRepositoryDatain interfaceDataHolder- Returns:
- the repository data used by this
DataHolder
-
getParentDataHolder
default Optional<? extends DataHolder> getParentDataHolder()
Description copied from interface:DataHolderRetrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Specified by:
getParentDataHolderin interfaceDataHolder- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
default DataHolder getRootDataHolder()
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceDataHolder- Returns:
- the root
DataHolder
-
-