Interface ModelAwareDataHolder
- All Superinterfaces:
DataHolder
- All Known Subinterfaces:
CalendarResource
,CommentableContent
,Content
,IndexableComposite
,IndexableDataHolder
,IndexableRepeaterEntry
,ModelAwareComposite
,ModelAwareDataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModelAwareJCRAmetysObject
,ModelAwareJCRAmetysObject
,ModelAwareRepeaterEntry
,ModifiableCalendar
,ModifiableCalendarEvent
,ModifiableContent
,ModifiableIndexableComposite
,ModifiableIndexableDataHolder
,ModifiableIndexableRepeaterEntry
,ModifiableModelAwareComposite
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataHolder
,ModifiableModelAwareRepeaterEntry
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,ProgramPart
,SharedContent
,Task
,TasksList
,TraversableProgramPart
,WebContent
,WorkflowAwareContent
- All Known Implementing Classes:
AbstractProgram
,AbstractProgramPart
,AbstractTraversableProgramPart
,Cart
,Catalog
,Container
,ContentBackupAmetysObject
,ContentConsistencyResult
,ContentValue
,Course
,CourseList
,CoursePart
,DefaultContent
,DefaultModelAwareComposite
,DefaultModelAwareDataHolder
,DefaultModelAwareRepeaterEntry
,DefaultModifiableModelAwareComposite
,DefaultModifiableModelAwareDataHolder
,DefaultModifiableModelAwareRepeaterEntry
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,Form
,FormEntry
,FormPageRule
,FormQuestion
,JCRCalendar
,JCRCalendarEvent
,JCRCalendarResource
,JCRTask
,JCRTasksList
,ModifiableContentDataHolder
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,Person
,Program
,Query
,Site
,SubProgram
Interface for data containers with models
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
commentsToSAX
(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor) Generates SAX events for the comments of the data in the given view in the currentDataHolder
Convert the data in the model of the currentDataHolder
dataToJSON
(DataContext context) Convert the data in the model of the currentDataHolder
dataToJSON
(ViewItemAccessor viewItemAccessor) Convert the data in the given view of the currentDataHolder
dataToJSON
(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view of the currentDataHolder
dataToJSONForEdition
(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view in edition mode in the currentDataHolder
Retrieves all data of this DataHolder as a typed-values Map.dataToMap
(DataContext context) Retrieves all data of this DataHolder as a typed-values Map.dataToMap
(ViewItemAccessor viewItemAccessor) Retrieves data of this DataHolder as a typed-values Map.dataToMap
(ViewItemAccessor viewItemAccessor, DataContext context) Retrieves data of this DataHolder as a typed-values Map.default void
dataToSAX
(ContentHandler contentHandler) Generates SAX events for the data in the model of the currentDataHolder
default void
dataToSAX
(ContentHandler contentHandler, DataContext context) Generates SAX events for the data in the model of the currentDataHolder
default void
dataToSAX
(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor) Generates SAX events for the data in the given view in the currentDataHolder
void
dataToSAX
(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in the currentDataHolder
void
dataToSAXForEdition
(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in edition mode in the currentDataHolder
getComments
(String dataName) Retrieve the comments of the data with the given namegetComposite
(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 datadefault ModelItem
getDefinition
(String path) Retrieves the definition of the data at the given pathgetExternalComposite
(String compositePath) Retrieves the external composite at the given pathgetExternalRepeater
(String repeaterPath) Retrieves the external repeater at the given path<T> T
getExternalValue
(String dataPath) Retrieves the external value of the data at the given pathgetLocalComposite
(String compositePath) Retrieves the local composite at the given pathgetLocalRepeater
(String repeaterPath) Retrieves the local repeater at the given path<T> T
getLocalValue
(String dataPath) Retrieves the local value of the data at the given pathCollection<? extends ModelItemContainer>
getModel()
Retrieves the data holder's modelOptional<? extends ModelAwareDataHolder>
Retrieves the optional parent of the currentDataHolder
There can be no parent if the currentDataHolder
is the rootgetRepeater
(String repeaterPath) Retrieves the repeater at the given pathRetrieves theDataHolder
that is the root of the current oneRetrieves the status of the externalizable data at the given path Warning: This method won't check that your data is externalizable.default <X extends ModelItemType>
XRetrieves the type of the data at the given pathdefault <T> T
Retrieves the value of the data at the given path<T> T
Retrieves the value of the data at the given path<T> T
Retrieves the value of the data at the given path, or the default value The returned value is one of those ones, in the order: The value of the data if exists and is not empty The default value from the model if useDefaultFromModel istrue
and there is a default value defined by the model The given default valueboolean
hasComments
(String dataName) Checks if there is are comments on the data with the given namedefault boolean
hasDefinition
(String path) Checks if there is a definition at the given pathboolean
hasExternalValue
(String dataPath) Checks if there is a non empty external value for the data at the given pathboolean
hasExternalValueOrEmpty
(String dataPath) Checks if there is an external value for the data at the given pathboolean
hasLocalValue
(String dataPath) Checks if there is a non empty local value for the data at the given pathboolean
hasLocalValueOrEmpty
(String dataPath) Checks if there is a local value for the data at the given pathboolean
Checks if there is a non empty value for the data at the given pathboolean
hasValueOrEmpty
(String dataPath) Checks if there is a value, even empty, for the data at the given pathdefault boolean
isMultiple
(String path) Checks if the definition of the element at the given path is multipleMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryData
-
Field Details
-
ALTERNATIVE_SUFFIX
Suffix used for the alternative value- See Also:
-
STATUS_SUFFIX
Suffix used for the status value- See Also:
-
COMMENTS_SUFFIX
Suffix used for the comments- See Also:
-
-
Method Details
-
getComposite
ModelAwareComposite getComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException 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:
UndefinedItemPathException
- if the given composite path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipleIllegalArgumentException
- if the given composite path is null or emptyBadItemTypeException
- if the stored value at the given path is not a composite
-
getLocalComposite
ModelAwareComposite getLocalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the local composite at the given path- 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 emptyBadItemTypeException
- if the stored value at the given path is not a compositeUndefinedItemPathException
- if the given composite path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalComposite
ModelAwareComposite getExternalComposite(String compositePath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the external composite at the given path- 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 emptyBadItemTypeException
- if the stored value at the given path is not a compositeUndefinedItemPathException
- if the given composite path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getRepeater
ModelAwareRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the repeater at the given path- 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 emptyBadItemTypeException
- if the stored value at the given path is not a repeaterUndefinedItemPathException
- if the given repeater path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalRepeater
ModelAwareRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the local repeater at the given path- 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 emptyBadItemTypeException
- if the stored value at the given path is not a repeaterUndefinedItemPathException
- if the given repeater path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalRepeater
ModelAwareRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the external repeater at the given path- 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 emptyBadItemTypeException
- if the stored value at the given path is not a repeaterUndefinedItemPathException
- if the given repeater path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasValue
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 the data at the given path is defined by the model, if there is a non empty value for the data and if the type of this value matches the type of the definition.false
otherwise- Throws:
BadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipleIllegalArgumentException
- if the given data path is null or empty
-
hasLocalValue
boolean hasLocalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is a non empty local value for the data at the given path- Parameters:
dataPath
- path of the externalizable data- Returns:
true
if the data at the given path is defined by the model, if there is a non empty local value for the data and if the type of this value matches the type of the definition.false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasExternalValue
boolean hasExternalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is a non empty external value for the data at the given path- Parameters:
dataPath
- path of the externalizable data- Returns:
true
if the data at the given path is defined by the model, if there is a non empty external value for the data and if the type of this value matches the type of the definition.false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasValueOrEmpty
boolean hasValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException 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 the data at the given path is defined by the model, if there is a value for the data, even empty, and if the type of this value matches the type of the definition.false
otherwise- Throws:
BadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multipleIllegalArgumentException
- if the given data path is null or empty
-
hasLocalValueOrEmpty
boolean hasLocalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is a local value for the data at the given path- Parameters:
dataPath
- path of the externalizable data- Returns:
true
if the data at the given path is defined by the model, if there is a local value for the data, even empty, and if the type of this value matches the type of the definition.false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasExternalValueOrEmpty
boolean hasExternalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Checks if there is an external value for the data at the given path- Parameters:
dataPath
- path of the externalizable data- Returns:
true
if the data at the given path is defined by the model, if there is an external value for the data, even empty, and if the type of this value matches the type of the definition.false
otherwise- Throws:
IllegalArgumentException
- if the given data path is null or emptyBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasComments
Checks if there is are comments on the data with the given name- Parameters:
dataName
- name of the data- Returns:
true
if there are comments on the data,false
otherwise- Throws:
IllegalArgumentException
- if the given data name is null or emptyUndefinedItemPathException
- if the given data name is not defined by the model
-
getDataNames
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 the data contained by this data holder and that are defined by the model
-
getValue
default <T> T getValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the value of the data at the given path- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the data- Returns:
- the value of the data or
null
if not exists or is empty. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValue
<T> T getValue(String dataPath, boolean allowMultiValuedPathSegments) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the value of the data at the given path- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the dataallowMultiValuedPathSegments
-true
to allow multi-valued segments in the path (not necessarily at the last segment),false
otherwise. Iftrue
, if there is no indicated entry for a repeater, the values of all the entries are retrieved Iftrue
and if there are multiple values, all data are retrieved in one array- Returns:
- the value of the data or
null
if allowMultiValuedPathSegments isfalse
and there is no non empty value. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the type of the stored valueBadDataPathCardinalityException
- if the managesMultiples boolean isfalse
and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValue
<T> T getValue(String dataPath, boolean useDefaultFromModel, T defaultValue) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the value of the data at the given path, or the default value The returned value is one of those ones, in the order:- The value of the data if exists and is not empty
- The default value from the model if useDefaultFromModel is
true
and there is a default value defined by the model - The given default value
- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the datauseDefaultFromModel
- true to use the default value from the model, false to use the given default valuedefaultValue
- default value used if value is null and useDefaultFromModel is false, or if there is no default value on model- Returns:
- the value of the data at the given path
- Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalValue
<T> T getLocalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the local value of the data at the given path- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the externalizable data- Returns:
- the local value of the data or
null
if not exists or is empty. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getExternalValue
<T> T getExternalValue(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadItemTypeException, BadDataPathCardinalityException Retrieves the external value of the data at the given path- Type Parameters:
T
- type of the value to retrieve- Parameters:
dataPath
- path of the externalizable data- Returns:
- the external value of the data or
null
if not exists or is empty. The object returned may be of a generic class defined by the storage (if the model is unknown). For example, an url may be returned as a String. - Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadItemTypeException
- if the type defined by the model doesn't match the type of the stored valueBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getStatus
ExternalizableDataProvider.ExternalizableDataStatus getStatus(String dataPath) throws IllegalArgumentException, UndefinedItemPathException, BadDataPathCardinalityException Retrieves the status of the externalizable data at the given path Warning: This method won't check that your data is externalizable. But there is no sense to call it with a non externalizable data- Parameters:
dataPath
- path of the externalizable data- Returns:
- the status of the externalizable data at the given path
- Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the modelBadDataPathCardinalityException
- if the definition of a part of the data path is multiple. Only the last part can be multiple
-
getComments
List<DataComment> getComments(String dataName) throws IllegalArgumentException, UndefinedItemPathException Retrieve the comments of the data with the given name- Parameters:
dataName
- name of the data- Returns:
- the comments of the data
- Throws:
IllegalArgumentException
- if the given data name is null or emptyUndefinedItemPathException
- if the given data name is not defined by the model
-
isMultiple
Checks if the definition of the element at the given path is multiple- Parameters:
path
- path of the element. No matter if it is a definition or data path (with repeater entry positions)- Returns:
true
if the element is multiple,false
otherwise- Throws:
IllegalArgumentException
- if the given path is null or emptyUndefinedItemPathException
- if the given path is not defined by the model
-
getType
default <X extends ModelItemType> X getType(String path) throws IllegalArgumentException, UndefinedItemPathException Retrieves the type of the data at the given path- Type Parameters:
X
- type of the item type- Parameters:
path
- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
- the type of the data
- Throws:
IllegalArgumentException
- if the given data path is null or emptyUndefinedItemPathException
- if the given data path is not defined by the model
-
getModel
Collection<? extends ModelItemContainer> getModel()Retrieves the data holder's model- Returns:
- the data holder's model
-
getDefinition
default ModelItem getDefinition(String path) throws IllegalArgumentException, UndefinedItemPathException Retrieves the definition of the data at the given path- Parameters:
path
- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
- the definition of the data
- Throws:
IllegalArgumentException
- if the given path is null or emptyUndefinedItemPathException
- if the given path is not defined by the model
-
hasDefinition
Checks if there is a definition at the given path- Parameters:
path
- path of the data. No matter if it is a definition or data path (with repeater entry positions)- Returns:
true
if there is definition at the given path,false
otherwise- Throws:
IllegalArgumentException
- if the given path is null or empty
-
dataToSAX
Generates SAX events for the data in the model of the currentDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX events- Throws:
SAXException
- if an error occurs during the SAX events generationBadItemTypeException
- if the saxed value's type does not matches the stored data
-
dataToSAX
default void dataToSAX(ContentHandler contentHandler, DataContext context) throws SAXException, BadItemTypeException Generates SAX events for the data in the model of the currentDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventscontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generationBadItemTypeException
- if the saxed value's type does not matches the stored data
-
dataToSAX
default void dataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor) throws SAXException, BadItemTypeException Generates SAX events for the data in the given view in the currentDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsviewItemAccessor
- theViewItemAccessor
referencing the items for which generate SAX events- Throws:
SAXException
- if an error occurs during the SAX events generationBadItemTypeException
- if the saxed value's type does not matches the stored data
-
dataToSAX
void dataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Generates SAX events for the data in the given view in the currentDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsviewItemAccessor
- theViewItemAccessor
referencing the items for which generate SAX eventscontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generationBadItemTypeException
- if the saxed value's type does not matches the stored data
-
dataToSAXForEdition
void dataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Generates SAX events for the data in the given view in edition mode in the currentDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsviewItemAccessor
- theViewItemAccessor
referencing the items for which generate SAX eventscontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generationBadItemTypeException
- if the saxed value's type does not matches the stored data
-
dataToJSON
Convert the data in the model of the currentDataHolder
- Returns:
- The data of the current
DataHolder
as JSON - Throws:
BadItemTypeException
- if the value's type does not matches the stored data
-
dataToJSON
Convert the data in the model of the currentDataHolder
- Parameters:
context
- The context of the data to convert- Returns:
- The data of the current
DataHolder
as JSON - Throws:
BadItemTypeException
- if the value's type does not matches the stored data
-
dataToJSON
default Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor) throws BadItemTypeException Convert the data in the given view of the currentDataHolder
- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing the items to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException
- if the value's type does not matches the stored data
-
dataToJSON
Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Convert the data in the given view of the currentDataHolder
- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing the items to convertcontext
- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException
- if the value's type does not matches the stored data
-
dataToJSONForEdition
Map<String,Object> dataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Convert the data in the given view in edition mode in the currentDataHolder
- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing the items to convertcontext
- The context of the data to convert- Returns:
- The data of the given view as JSON
- Throws:
BadItemTypeException
- if the value's type does not matches the stored data
-
commentsToSAX
default void commentsToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor) throws SAXException Generates SAX events for the comments of the data in the given view in the currentDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsviewItemAccessor
- theViewItemAccessor
referencing the items for which generate SAX events- Throws:
SAXException
- if an error occurs during the SAX events generation
-
dataToMap
Retrieves all data of this DataHolder as a typed-values Map.- Returns:
- a Map containing all data.
-
dataToMap
Retrieves all data of this DataHolder as a typed-values Map.- Parameters:
context
- The context of the data- Returns:
- a Map containing all data.
-
dataToMap
Retrieves data of this DataHolder as a typed-values Map.- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing the items to include in the resulting Map- Returns:
- a Map containing all data.
-
dataToMap
Retrieves data of this DataHolder as a typed-values Map.- Parameters:
viewItemAccessor
- theViewItemAccessor
referencing the items to include in the resulting Mapcontext
- The context of the data- Returns:
- a Map containing all data.
-
getParentDataHolder
Optional<? extends ModelAwareDataHolder> 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
-