Interface DataHolder
- All Known Subinterfaces:
CalendarResource,CommentableContent,Composite,Content,ContributorCommentableContent,DataAwareAmetysObject,IndexableComposite,IndexableDataHolder,IndexableRepeaterEntry,MetadataAwareSitemapElement,ModelAwareComposite,ModelAwareDataAwareAmetysObject,ModelAwareDataAwareAmetysObject,ModelAwareDataHolder,ModelAwareJCRAmetysObject,ModelAwareJCRAmetysObject,ModelAwareRepeaterEntry,ModelLessComposite,ModelLessDataAwareAmetysObject,ModelLessDataHolder,ModelLessJCRAmetysObject,ModifiableCalendar,ModifiableCalendarEvent,ModifiableComposite,ModifiableContent,ModifiableDataHolder,ModifiableIndexableComposite,ModifiableIndexableDataHolder,ModifiableIndexableRepeaterEntry,ModifiableModelAwareComposite,ModifiableModelAwareDataAwareAmetysObject,ModifiableModelAwareDataAwareAmetysObject,ModifiableModelAwareDataHolder,ModifiableModelAwareRepeaterEntry,ModifiableModelLessComposite,ModifiableModelLessDataAwareAmetysObject,ModifiableModelLessDataHolder,ModifiablePage,ModifiableRepeaterEntry,ModifiableWebContent,ModifiableWorkflowAwareContent,ModifiableZone,ModifiableZoneItem,Page,ProgramPart,RepeaterEntry,SharedContent,Task,TasksList,Thread,TraversableProgramPart,WebContent,WorkflowAwareContent,Zone,ZoneItem
- All Known Implementing Classes:
AbstractConfigurableVirtualPage,AbstractOdfPage,AbstractProgram,AbstractProgramItemPage,AbstractProgramPart,AbstractSitemapElement,AbstractSurveyElement,AbstractTraversableProgramPart,Activity,Cart,Catalog,CMISRootResourcesCollection,ConfigurableVirtualZone,ConfigurableVirtualZoneItem,Container,ContentBackupAmetysObject,ContentConsistencyResult,ContentValue,Course,CourseList,CoursePage,CoursePart,DefaultContent,DefaultLink,DefaultModelAwareComposite,DefaultModelAwareDataHolder,DefaultModelAwareRepeaterEntry,DefaultModelLessComposite,DefaultModelLessDataHolder,DefaultModifiableModelAwareComposite,DefaultModifiableModelAwareDataHolder,DefaultModifiableModelAwareRepeaterEntry,DefaultModifiableModelLessComposite,DefaultModifiableModelLessDataHolder,DefaultPage,DefaultSharedContent,DefaultWebContent,DefaultWorkflowAwareContent,DefaultZone,DefaultZoneItem,FirstLevelPage,Form,FormEntry,FormPageRule,FormQuestion,JCRCalendar,JCRCalendarEvent,JCRCalendarResource,JCRProjectMember,JCRResourcesCollection,JCRTask,JCRTasksList,JCRThread,ModifiableContentDataHolder,ModifiableDefaultContent,ModifiableDefaultWebContent,OrgUnit,OrgUnitPage,Person,Program,ProgramPage,Project,Query,RedirectPage,SecondLevelPage,Site,Sitemap,StaticZoneItem,SubProgram,Subscription,Survey,SurveyPage,SurveyQuestion,Thesaurus,TransitionalPage,UGCPage,UGCTransitionalPage,UserPage,UserZoneItem
public interface DataHolder
Interface for data containers
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcopyTo(ModifiableDataHolder dataHolder) Copies the currentDataHolderto the givenModifiableModelAwareDataHolder.default voidcopyTo(ModifiableDataHolder dataHolder, DataContext context) Copies the currentDataHolderto the givenModifiableModelAwareDataHolder.default ObjectdataToJSON(String dataPath) Convert the data at the given path into a JSON objectdataToJSON(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdefault 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 pathvoiddataToSAX(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 pathgetComposite(String compositePath) Retrieves the composite at the given pathRetrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite dataOptional<? extends DataHolder>Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootRetrieves the repository data used by thisDataHolderRetrieves theDataHolderthat is the root of the current onebooleanChecks if there is a non empty value for the data at the given pathbooleanhasValueOrEmpty(String dataPath) Checks if there is a value, even empty, for the data at the given path
-
Method Details
-
getComposite
Retrieves the composite at the given path- 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
Checks if there is a non empty value for the data at the given path- 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
-
hasValueOrEmpty
Checks if there is a value, even empty, for the data at the given path- 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
-
getDataNames
Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite data- Returns:
- the names of all data contained by this data holder
-
copyTo
default void copyTo(ModifiableDataHolder dataHolder) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException Copies the currentDataHolderto the givenModifiableModelAwareDataHolder.- 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
-
copyTo
default void copyTo(ModifiableDataHolder dataHolder, DataContext context) throws UndefinedItemPathException, BadItemTypeException, UnknownTypeException, NotUniqueTypeException Copies the currentDataHolderto the givenModifiableModelAwareDataHolder.- Parameters:
dataHolder- The destination dataHolder. Can not be null.context- The context of the data to copy- 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
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 path- 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 generation
-
dataToSAX
void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException 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 path- 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 generation
-
dataToJSON
Convert the data at the given path into a JSON object- Parameters:
dataPath- the path of the data to convert- Returns:
- The value as JSON
-
dataToJSON
Convert the data at the given path into a JSON object- Parameters:
dataPath- the path of the data to convertcontext- The context of the data to convert- Returns:
- The value as JSON
-
getRepositoryData
Retrieves the repository data used by thisDataHolder- Returns:
- the repository data used by this
DataHolder
-
getParentDataHolder
Optional<? extends DataHolder> getParentDataHolder()Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the root- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Retrieves theDataHolderthat is the root of the current one- Returns:
- the root
DataHolder
-