Class TaskCalendarEvent
java.lang.Object
org.ametys.plugins.workspaces.calendars.task.TaskCalendarEvent
- All Implemented Interfaces:
IndexableAmetysObject,IndexableDataHolder,AmetysObject,ModelAwareAmetysObject,DataHolder,ModelAwareDataHolder,TagAwareAmetysObject,TaggableAmetysObject,CalendarEvent
Object for a task calendar event
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyTo(ModifiableDataHolder dataHolder) Copies the currentDataHolderto the givenModifiableDataHolder.voidcopyTo(ModifiableDataHolder dataHolder, DataContext context) Copies the currentDataHolderto the givenModifiableDataHolder.dataToJSON(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view of the currentDataHolderdataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) Convert the data in the given view in edition mode in the currentDataHolderdataToMap(ViewItemAccessor viewItemAccessor, DataContext context) Retrieves data of this DataHolder as a typed-values Map.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 pathvoiddataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in the currentDataHoldervoiddataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) Generates SAX events for the data in the given view in edition mode in the currentDataHolderGet the calendar holding the eventgetComposite(String compositePath) Retrieves the composite at the given pathRetrieves the creation date.Retrieves the the creator.Retrieves the names of data contained by this data holder Retrieves only the data at first level, does not check composite dataGet the description of the eventgetDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Get the collection of model items where there are differences between the given values and the current onesgetDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Get the collection of model items where there are differences between the given values and the current onesGet the date of the end of the eventRetrieves the list of excluded event date.getExternalComposite(String compositePath) Retrieves the external composite at the given pathgetExternalRepeater(String repeaterPath) Retrieves the external repeater at the given path<T> TgetExternalValue(String dataPath) Retrieves the external value of the data at the given pathRetrieves the start date of the first Event which end after the dateGet if the event last all the daygetId()Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>Retrieves the last contributor.Retrieves the last modification date.getLocalComposite(String compositePath) Retrieves the local composite at the given pathgetLocalRepeater(String repeaterPath) Retrieves the local repeater at the given path<T> TgetLocalValue(String dataPath) Retrieves the local value of the data at the given pathGet the location of the eventCollection<? extends Model> getModel()Retrieves the data holder's modelgetName()Retrieves the name of the current object.getNextOccurrence(CalendarEventOccurrence occurrence) Retrieves the date of the next event after the dategetOccurrences(ZonedDateTime startDate, ZonedDateTime endDate) Retrieves the list of all event date between startDate and endDate.Retrieves the organiser.<A extends AmetysObject>
AReturns the parent object in the Ametys hierarchy.Optional<? extends IndexableDataHolder> Retrieves the optional parent of the currentDataHolderThere can be no parent if the currentDataHolderis the rootReturns the path of the parent object in the Ametys hierarchy.getPath()Retrieves the path of the current object.Retrieves the recurrence type.getRepeater(String repeaterPath) Retrieves the repeater at the given pathRetrieves the upper bound of the recurrence This bound is inclusive, meaning that if it is synchronized (ie on a recurrence day at the event starting hour) with the recurrence, it represents the starting date of the last occurrenceRetrieves the repository data used by thisDataHolderRetrieves the resource list.Retrieves theDataHolderthat is the root of the current oneGet the date of the begin of the eventRetrieves the status of the externalizable data at the given path Warning: This method won't check that your data is externalizable.getTags()Retrieves current tags.getTask()Return the task link to the calendar eventgetTitle()Get the title of the event<X extends ModelItemType>
XRetrieves the type of the data at the given path<T> TRetrieves the value of the data at the given path<T> TgetValueOfType(String dataPath, String dataTypeId) Retrieves the value of the data at the given path<T> TgetValueOfTypeOrDefault(String dataPath, String dataTypeId, T defaultValue) Retrieves the value of the data at the given path if exists and is not empty, or the given default value<T> TgetValueOrDefault(String dataPath) Retrieves the value of the data at the given path if exists and is not empty, or the default value from the model<T> TgetValueOrDefault(String dataPath, T defaultValue) Retrieves the value of the data at the given path if exists and is not empty, or the given default value<T> TgetValueWithMultiValuedPathSegments(String dataPath) Retrieves the value of the data at the given path, allowing multi-valued segments in the path (not necessarily at the last segment) if there is no indicated entry for a repeater, the values of all the entries are retrieved if there are multiple values, all data are retrieved in one arraygetZone()Get the date zone of the eventbooleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) Check if there are differences between the given values and the current onesbooleanhasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) Check if there are differences between the given values and the current onesbooleanhasExternalValue(String dataPath) Checks if there is a non empty external value for the data at the given pathbooleanhasExternalValueOrEmpty(String dataPath) Checks if there is an external value for the data at the given pathbooleanhasLocalValue(String dataPath) Checks if there is a non empty local value for the data at the given pathbooleanhasLocalValueOrEmpty(String dataPath) Checks if there is a local value for the data at the given pathbooleanChecks if there is a non empty value for the data at the given pathbooleanChecks 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 pathList<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, CMSDataContext context) Indexes all data and properties of thisAmetysObjectbooleanisMultiple(String dataPath) Checks if the value of the data at the given path is multiplebooleanisMultiple(String dataPath, String dataTypeId) Checks if the value of the data at the given path is multipleRetrieves if the event is recurrent.voidTags.voidUntags.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToJSON, dataToSAXMethods inherited from interface org.ametys.cms.data.ametysobject.IndexableAmetysObject
getSystemPropertyExtensionPoint, indexDataMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDefinition, getDifferences, getDifferences, getModelItemTypeExtensionPoint, hasDefinition, hasDifferences, hasDifferences
-
Constructor Details
-
TaskCalendarEvent
The constructor- Parameters:
calendar- the calendartask- the task
-
-
Method Details
-
getTask
Return the task link to the calendar event- Returns:
- the task
-
tag
Description copied from interface:TaggableAmetysObjectTags.- Specified by:
tagin interfaceTaggableAmetysObject- Parameters:
tag- the tag to add.- Throws:
AmetysRepositoryException- if an error occurs.
-
untag
Description copied from interface:TaggableAmetysObjectUntags.- Specified by:
untagin interfaceTaggableAmetysObject- Parameters:
tag- the tag to remove.- Throws:
AmetysRepositoryException- if an error occurs.
-
getTags
Description copied from interface:TagAwareAmetysObjectRetrieves current tags.- Specified by:
getTagsin interfaceTagAwareAmetysObject- Returns:
- the current tags.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getName
Description copied from interface:AmetysObjectRetrieves the name of the current object.- Specified by:
getNamein interfaceAmetysObject- Returns:
- the name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getPath
Description copied from interface:AmetysObjectRetrieves the path of the current object.- Specified by:
getPathin interfaceAmetysObject- Returns:
- the path.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getId
Description copied from interface:AmetysObjectRetrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>- Specified by:
getIdin interfaceAmetysObject- Returns:
- the unique identifier of this AmetysObject
- Throws:
AmetysRepositoryException- if an error occurs.
-
getParent
Description copied from interface:AmetysObjectReturns the parent object in the Ametys hierarchy.- Specified by:
getParentin interfaceAmetysObject- Type Parameters:
A- the type of the parentAmetysObject.- Returns:
- the parent object or
nullif current object is the root. - Throws:
AmetysRepositoryException- if an error occurs.
-
getParentPath
Description copied from interface:AmetysObjectReturns the path of the parent object in the Ametys hierarchy.- Specified by:
getParentPathin interfaceAmetysObject- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getCalendar
Description copied from interface:CalendarEventGet the calendar holding the event- Specified by:
getCalendarin interfaceCalendarEvent- Returns:
- the calendar
-
getTitle
Description copied from interface:CalendarEventGet the title of the event- Specified by:
getTitlein interfaceCalendarEvent- Returns:
- the title of the event
-
getDescription
Description copied from interface:CalendarEventGet the description of the event- Specified by:
getDescriptionin interfaceCalendarEvent- Returns:
- the description of the event
-
getLocation
Description copied from interface:CalendarEventGet the location of the event- Specified by:
getLocationin interfaceCalendarEvent- Returns:
- the location of the event
-
getStartDate
Description copied from interface:CalendarEventGet the date of the begin of the event- Specified by:
getStartDatein interfaceCalendarEvent- Returns:
- the date of the event
-
getEndDate
Description copied from interface:CalendarEventGet the date of the end of the event- Specified by:
getEndDatein interfaceCalendarEvent- Returns:
- the date of the event
-
getZone
Description copied from interface:CalendarEventGet the date zone of the event- Specified by:
getZonein interfaceCalendarEvent- Returns:
- the date zone of the event
-
getFullDay
Description copied from interface:CalendarEventGet if the event last all the day- Specified by:
getFullDayin interfaceCalendarEvent- Returns:
- true if the event last all the day
-
getCreator
Description copied from interface:CalendarEventRetrieves the the creator.- Specified by:
getCreatorin interfaceCalendarEvent- Returns:
- the creator.
-
getCreationDate
Description copied from interface:CalendarEventRetrieves the creation date.- Specified by:
getCreationDatein interfaceCalendarEvent- Returns:
- the creation date.
-
getLastContributor
Description copied from interface:CalendarEventRetrieves the last contributor.- Specified by:
getLastContributorin interfaceCalendarEvent- Returns:
- the last contributor.
-
getLastModified
Description copied from interface:CalendarEventRetrieves the last modification date.- Specified by:
getLastModifiedin interfaceCalendarEvent- Returns:
- the last modification date.
-
getRecurrenceType
Description copied from interface:CalendarEventRetrieves the recurrence type.- Specified by:
getRecurrenceTypein interfaceCalendarEvent- Returns:
- the recurrence type.
-
isRecurrent
Description copied from interface:CalendarEventRetrieves if the event is recurrent.- Specified by:
isRecurrentin interfaceCalendarEvent- Returns:
- true if the event is recurrent.
-
getRepeatUntil
Description copied from interface:CalendarEventRetrieves the upper bound of the recurrence This bound is inclusive, meaning that if it is synchronized (ie on a recurrence day at the event starting hour) with the recurrence, it represents the starting date of the last occurrence- Specified by:
getRepeatUntilin interfaceCalendarEvent- Returns:
- the last possible start instant of the recurrence.
-
getExcludedOccurences
Description copied from interface:CalendarEventRetrieves the list of excluded event date.- Specified by:
getExcludedOccurencesin interfaceCalendarEvent- Returns:
- the list of excluded event date as ZonedDateTime representing midnight in event timezone. No guarantee is provided for the actual timezone of the returned date, only the instant it represents is guaranteed
-
getOccurrences
Description copied from interface:CalendarEventRetrieves the list of all event date between startDate and endDate.- Specified by:
getOccurrencesin interfaceCalendarEvent- Parameters:
startDate- the start dateendDate- the end date- Returns:
- the list of all event date between startDate and endDate.
-
getFirstOccurrence
Description copied from interface:CalendarEventRetrieves the start date of the first Event which end after the date- Specified by:
getFirstOccurrencein interfaceCalendarEvent- Parameters:
date- the date- Returns:
- the start date of the first Event which end after the date
-
getNextOccurrence
Description copied from interface:CalendarEventRetrieves the date of the next event after the date- Specified by:
getNextOccurrencein interfaceCalendarEvent- Parameters:
occurrence- the current occurrence- Returns:
- the occurrence of the next event after the date
-
getOrganiser
Description copied from interface:CalendarEventRetrieves the organiser.- Specified by:
getOrganiserin interfaceCalendarEvent- Returns:
- the organiser.
-
getResources
Description copied from interface:CalendarEventRetrieves the resource list.- Specified by:
getResourcesin interfaceCalendarEvent- Returns:
- the resource list.
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException, BadItemTypeException, UndefinedItemPathException 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 generationBadItemTypeException- if the saxed value's type does not matches the stored dataUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
dataToJSON
public Object dataToJSON(String dataPath, DataContext context) throws BadItemTypeException, UndefinedItemPathException Description copied from interface:DataHolderConvert the data at the given path into a JSON object- Specified by:
dataToJSONin interfaceDataHolder- Parameters:
dataPath- the path of the data to convertcontext- The context of the data to convert- Returns:
- The value as JSON
- Throws:
BadItemTypeException- if the value's type does not matches the stored dataUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
getRepositoryData
Description copied from interface:DataHolderRetrieves the repository data used by thisDataHolder- Specified by:
getRepositoryDatain interfaceDataHolder- Returns:
- the repository data used by this
DataHolder
-
indexData
public List<org.apache.solr.common.SolrInputDocument> indexData(org.apache.solr.common.SolrInputDocument document, CMSDataContext context) throws BadItemTypeException Description copied from interface:IndexableAmetysObjectIndexes all data and properties of thisAmetysObject- Specified by:
indexDatain interfaceIndexableAmetysObject- Parameters:
document- the solr document representing thisAmetysObjectcontext- The context of the data to index- Returns:
- additional solr documents that may have been created (ex: repeater entries)
- Throws:
BadItemTypeException- if the saxed value's type does not matches the stored data
-
getModel
Description copied from interface:ModelAwareDataHolderRetrieves the data holder's model- Specified by:
getModelin interfaceModelAwareAmetysObject- Specified by:
getModelin interfaceModelAwareDataHolder- Returns:
- the data holder's model
-
hasValue
public boolean hasValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- Parameters:
dataPath- path of the data- Returns:
trueif there is a non empty value for the data. If the data holder has a model and the data at the given path is defined by the model and the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasLocalValue
public boolean hasLocalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is a non empty local value for the data at the given path- Specified by:
hasLocalValuein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif 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.falseotherwise- 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
public boolean hasExternalValue(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is a non empty external value for the data at the given path- Specified by:
hasExternalValuein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif 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.falseotherwise- 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
-
hasValue
public boolean hasValue(String dataPath, String dataTypeId) throws IllegalArgumentException, UnknownTypeException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a non empty value for the data at the given path- Specified by:
hasValuein interfaceDataHolder- Specified by:
hasValuein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the datadataTypeId- type identifier of the data- Returns:
trueif there is a non empty value for the data. If the data holder has a model and the data at the given path is defined by the model and the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUnknownTypeException- if the given type isn't available for this data holder's type extension pointBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasValueOrEmpty
public boolean hasValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:DataHolderChecks if there is a value, even empty, for the data at the given path- Specified by:
hasValueOrEmptyin interfaceDataHolder- Parameters:
dataPath- path of the data- Returns:
trueif there is value, even empty, for the data. If the data holder has a model and the data at the given path is defined by the model and the type of this value matches the type of the definition.falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
hasLocalValueOrEmpty
public boolean hasLocalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is a local value for the data at the given path- Specified by:
hasLocalValueOrEmptyin interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif 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.falseotherwise- 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
public boolean hasExternalValueOrEmpty(String dataPath) throws IllegalArgumentException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderChecks if there is an external value for the data at the given path- Specified by:
hasExternalValueOrEmptyin interfaceModelAwareDataHolder- Parameters:
dataPath- path of the externalizable data- Returns:
trueif 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.falseotherwise- 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
-
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- Specified by:
getDataNamesin interfaceModelAwareDataHolder- Returns:
- the names of all data contained by this data holder
-
getValue
public <T> T getValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the value of the data at the given path- Specified by:
getValuein interfaceDataHolder- Type Parameters:
T- type of the value to retrieve. If the data holder has a model, the type of the value is defined by this model. Otherwise, the type of the value will be deduced from the stored data. In some cases, the type can be wrong. For example, it is impossible to know if a stored date is a date or a date time- Parameters:
dataPath- path of the data- Returns:
- the value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the data holder has a model and the type defined by the model doesn't match the type of the stored value, or if value at the sub data path of the given one is not a compositeUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalValue
public <T> T getLocalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local value of the data at the given path- Specified by:
getLocalValuein interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. The type of the value is defined by the model.- Parameters:
dataPath- path of the externalizable data- Returns:
- the local value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- 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
-
getExternalValue
public <T> T getExternalValue(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external value of the data at the given path- Specified by:
getExternalValuein interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. The type of the value is defined by the model.- Parameters:
dataPath- path of the externalizable data- Returns:
- the external value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- 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
-
getValueOrDefault
public <T> T getValueOrDefault(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the value of the data at the given path if exists and is not empty, or the default value from the model- Specified by:
getValueOrDefaultin interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. The type of the value is defined by the model.- Parameters:
dataPath- path of the data- Returns:
- the value of the data, or the default value from the model if the value does not exist or is empty
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- 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
-
getValueOrDefault
public <T> T getValueOrDefault(String dataPath, T defaultValue) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the value of the data at the given path if exists and is not empty, or the given default value- Specified by:
getValueOrDefaultin interfaceDataHolder- Type Parameters:
T- type of the value to retrieve. If the data holder has a model, the type of the value is defined by this model. Otherwise, the type of the value will be deduced from the stored data. In some cases, the type can be wrong. For example, it is impossible to know if a stored date is a date or a date time- Parameters:
dataPath- path of the datadefaultValue- default value- Returns:
- the value of the data, or the given default value if the value does not exist or is empty
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if value at the sub data path of the given one is not a compositeUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValueOfType
public <T> T getValueOfType(String dataPath, String dataTypeId) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the value of the data at the given path- Specified by:
getValueOfTypein interfaceDataHolder- Specified by:
getValueOfTypein interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. Should match the given data type- Parameters:
dataPath- path of the datadataTypeId- type identifier of the data- Returns:
- the value of the data or
nullif not exists or is empty. A typed array is returned for multiple empty data, and an empty string is returned for single empty string data - Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the given type doesn't match the type of the stored value at the given pathUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValueOfTypeOrDefault
public <T> T getValueOfTypeOrDefault(String dataPath, String dataTypeId, T defaultValue) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the value of the data at the given path if exists and is not empty, or the given default value- Specified by:
getValueOfTypeOrDefaultin interfaceDataHolder- Specified by:
getValueOfTypeOrDefaultin interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve. Should match the given data type- Parameters:
dataPath- path of the datadataTypeId- type identifier of the datadefaultValue- default value- Returns:
- the value of the data, or the given default value if the value does not exist or is empty
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the given type doesn't match the type of the stored value at the given pathUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getValueWithMultiValuedPathSegments
public <T> T getValueWithMultiValuedPathSegments(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the value of the data at the given path, allowing multi-valued segments in the path (not necessarily at the last segment) if there is no indicated entry for a repeater, the values of all the entries are retrieved if there are multiple values, all data are retrieved in one array- Specified by:
getValueWithMultiValuedPathSegmentsin interfaceModelAwareDataHolder- Type Parameters:
T- type of the value to retrieve- Parameters:
dataPath- path of the data- Returns:
- the value of the data
- Throws:
IllegalArgumentException- if the given data path is null or emptyBadItemTypeException- if the type defined by the model doesn't match the type of the stored valueUndefinedItemPathException- if the given data path is not defined by the modelBadDataPathCardinalityException- if the managesMultiples boolean isfalseand the definition of a part of the data path is multiple. Only the last part can be multiple
-
getStatus
public ExternalizableDataProvider.ExternalizableDataStatus getStatus(String dataPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves 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- Specified by:
getStatusin interfaceModelAwareDataHolder- 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 emptyBadItemTypeException- if the given data path is composed of an item with type defined by the model that doesn't match the type of the stored valueUndefinedItemPathException- 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
-
isMultiple
public boolean isMultiple(String dataPath) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:DataHolderChecks if the value of the data at the given path is multiple- Specified by:
isMultiplein interfaceDataHolder- Specified by:
isMultiplein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the data to check- Returns:
trueif the value of the data is multiple,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
isMultiple
public boolean isMultiple(String dataPath, String dataTypeId) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:DataHolderChecks if the value of the data at the given path is multiple- Specified by:
isMultiplein interfaceDataHolder- Specified by:
isMultiplein interfaceModelAwareDataHolder- Parameters:
dataPath- path of the data to checkdataTypeId- type identifier of the data- Returns:
trueif the value of the data is multiple,falseotherwise- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
getType
public <X extends ModelItemType> X getType(String dataPath) throws IllegalArgumentException, UndefinedItemPathException Description copied from interface:DataHolderRetrieves the type of the data at the given path- Specified by:
getTypein interfaceDataHolder- Specified by:
getTypein interfaceModelAwareDataHolder- Type Parameters:
X- type of the item type- Parameters:
dataPath- path of the data- Returns:
- the type of the data
- Throws:
IllegalArgumentException- if the given data path is null or emptyUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
copyTo
public void copyTo(ModifiableDataHolder dataHolder) throws BadItemTypeException, UndefinedItemPathException Description copied from interface:DataHolderCopies the currentDataHolderto the givenModifiableDataHolder.- Specified by:
copyToin interfaceDataHolder- Parameters:
dataHolder- The destination dataHolder. Can not be null.- Throws:
BadItemTypeException- if type of a data to copy doesn't match the data with same path in the destinationModifiableDataHolderUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
copyTo
public void copyTo(ModifiableDataHolder dataHolder, DataContext context) throws BadItemTypeException, UndefinedItemPathException Description copied from interface:DataHolderCopies the currentDataHolderto the givenModifiableDataHolder.- Specified by:
copyToin interfaceDataHolder- Parameters:
dataHolder- The destination dataHolder. Can not be null.context- The context of the data to copy- Throws:
BadItemTypeException- if type of a data to copy doesn't match the data with same path in the destinationModifiableDataHolderUndefinedItemPathException- if the data holder has a model and the given data path is not defined by this model
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Description copied from interface:ModelAwareDataHolderGenerates SAX events for the data in the given view in the currentDataHolder- Specified by:
dataToSAXin interfaceModelAwareDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsviewItemAccessor- theViewItemAccessorreferencing 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
public void dataToSAXForEdition(ContentHandler contentHandler, ViewItemAccessor viewItemAccessor, DataContext context) throws SAXException, BadItemTypeException Description copied from interface:ModelAwareDataHolderGenerates SAX events for the data in the given view in edition mode in the currentDataHolder- Specified by:
dataToSAXForEditionin interfaceModelAwareDataHolder- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventsviewItemAccessor- theViewItemAccessorreferencing 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
public Map<String,Object> dataToJSON(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderConvert the data in the given view of the currentDataHolder- Specified by:
dataToJSONin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing 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
public Map<String,Object> dataToJSONForEdition(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderConvert the data in the given view in edition mode in the currentDataHolder- Specified by:
dataToJSONForEditionin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing 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
-
dataToMap
public Map<String,Object> dataToMap(ViewItemAccessor viewItemAccessor, DataContext context) throws BadItemTypeException Description copied from interface:ModelAwareDataHolderRetrieves data of this DataHolder as a typed-values Map.- Specified by:
dataToMapin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- theViewItemAccessorreferencing the items to include in the resulting Mapcontext- The context of the data- Returns:
- a Map containing all data.
- Throws:
BadItemTypeException- if the value's type does not matches the stored data
-
hasDifferences
public boolean hasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to check- Returns:
trueif there are differences,falseotherwise- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
hasDifferences
public boolean hasDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderCheck if there are differences between the given values and the current ones- Specified by:
hasDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to checkcontext- the context of the synchronization- Returns:
trueif there are differences,falseotherwise- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getDifferences
public Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderGet the collection of model items where there are differences between the given values and the current ones- Specified by:
getDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to check- Returns:
- a collection of model items with differences
- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getDifferences
public Collection<ModelItem> getDifferences(ViewItemAccessor viewItemAccessor, Map<String, Object> values, SynchronizationContext context) throws BadItemTypeExceptionDescription copied from interface:ModelAwareDataHolderGet the collection of model items where there are differences between the given values and the current ones- Specified by:
getDifferencesin interfaceModelAwareDataHolder- Parameters:
viewItemAccessor- TheViewItemAccessorfor all items to checkvalues- the values to checkcontext- the context of the synchronization- Returns:
- a collection of model items with differences
- Throws:
BadItemTypeException- if the type defined by the model of one of the Map's key doesn't match the corresponding value
-
getComposite
public IndexableComposite getComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:DataHolderRetrieves the composite at the given path- Specified by:
getCompositein interfaceDataHolder- Specified by:
getCompositein interfaceIndexableDataHolder- Specified by:
getCompositein interfaceModelAwareDataHolder- 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 compositeUndefinedItemPathException- if the data holder has a model and the given composite path is not defined by this modelBadDataPathCardinalityException- if the data holder has a model and the definition of a part of the data path is multiple. Only the last part can be multiple
-
getLocalComposite
public IndexableComposite getLocalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local composite at the given path- Specified by:
getLocalCompositein interfaceIndexableDataHolder- Specified by:
getLocalCompositein interfaceModelAwareDataHolder- Parameters:
compositePath- path of the externalizable 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 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
public IndexableComposite getExternalComposite(String compositePath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external composite at the given path- Specified by:
getExternalCompositein interfaceIndexableDataHolder- Specified by:
getExternalCompositein interfaceModelAwareDataHolder- Parameters:
compositePath- path of the externalizable 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 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
public IndexableRepeater getRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the repeater at the given path- Specified by:
getRepeaterin interfaceIndexableDataHolder- Specified by:
getRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the repeater to retrieve- Returns:
- the repeater or
nullif 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
public IndexableRepeater getLocalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the local repeater at the given path- Specified by:
getLocalRepeaterin interfaceIndexableDataHolder- Specified by:
getLocalRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif 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
public IndexableRepeater getExternalRepeater(String repeaterPath) throws IllegalArgumentException, BadItemTypeException, UndefinedItemPathException, BadDataPathCardinalityException Description copied from interface:ModelAwareDataHolderRetrieves the external repeater at the given path- Specified by:
getExternalRepeaterin interfaceIndexableDataHolder- Specified by:
getExternalRepeaterin interfaceModelAwareDataHolder- Parameters:
repeaterPath- path of the externalizable repeater to retrieve- Returns:
- the repeater or
nullif 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
-
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- Specified by:
getParentDataHolderin interfaceIndexableDataHolder- Specified by:
getParentDataHolderin interfaceModelAwareDataHolder- Returns:
- the parent of the current
DataHolder
-
getRootDataHolder
Description copied from interface:DataHolderRetrieves theDataHolderthat is the root of the current one- Specified by:
getRootDataHolderin interfaceDataHolder- Specified by:
getRootDataHolderin interfaceIndexableDataHolder- Specified by:
getRootDataHolderin interfaceModelAwareDataHolder- Returns:
- the root
DataHolder
-