Class EntityCalendarDataRetriever
java.lang.Object
io.jmix.fullcalendarflowui.component.data.AbstractEntityCalendarDataProvider
io.jmix.fullcalendarflowui.component.data.EntityCalendarDataRetriever
- All Implemented Interfaces:
CalendarDataProvider
,CallbackCalendarDataProvider
,EntityCalendarDataProvider
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
@Component("fcalen_CallbackCalendarDataRetriever")
@Scope("prototype")
public class EntityCalendarDataRetriever
extends AbstractEntityCalendarDataProvider
implements CallbackCalendarDataProvider, org.springframework.context.ApplicationContextAware
Data provider for loading entities by request. It is created when calendar's XML description defines
callback data provider.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.fullcalendarflowui.component.data.CallbackCalendarDataProvider
CallbackCalendarDataProvider.ItemsFetchContext
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataManager
protected DateTimeTransformations
protected static final String
protected Class<?>
protected FetchPlan
protected Metadata
protected String
protected static final String
Fields inherited from class io.jmix.fullcalendarflowui.component.data.AbstractEntityCalendarDataProvider
additionalProperties, allDayProperty, backgroundColorProperty, borderColorProperty, classNamesProperty, constraintProperty, descriptionProperty, displayProperty, durationEditableProperty, endDateTimeProperty, groupIdProperty, id, interactiveProperty, overlapProperty, recurringDaysOfWeekProperty, recurringEndDateProperty, recurringEndTimeProperty, recurringStartDateProperty, recurringStartTimeProperty, startDateTimeProperty, startEditableProperty, textColorProperty, titleProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
Class<?>
Class<?>
protected Object
Class<?>
protected boolean
isEndDateUsed
(String query) protected boolean
isStartDateUsed
(String query) protected List<CalendarEvent>
load
(CallbackCalendarDataProvider.ItemsFetchContext fetchContext) protected List<?>
loadItems
(CallbackCalendarDataProvider.ItemsFetchContext fetchContext) A callback method that is invoked byFullCalendar
, for instance, when the user navigates to next/previous dates.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setEntityClass
(Class<?> entityClass) Sets entity class that should be used for loading entities using JPQL query.void
setFetchPlan
(FetchPlan fetchPlan) Sets fetch plan for loading entities using JPQL query.void
setLoadDelegate
(Function<CallbackCalendarDataProvider.ItemsFetchContext, List<CalendarEvent>> loadDelegate) Sets load delegate that will be used for loading events.void
setQueryString
(String queryString) Sets JPQL query string.protected Object
transformToValueWithSystemTimeZone
(LocalDate value, TimeZone timeZone, String propertyName) Methods inherited from class io.jmix.fullcalendarflowui.component.data.AbstractEntityCalendarDataProvider
getAdditionalProperties, getAllDayProperty, getBackgroundColorProperty, getBorderColorProperty, getClassNamesProperty, getConstraintProperty, getDescriptionProperty, getDisplayProperty, getDurationEditableProperty, getEndDateTimeProperty, getGroupIdProperty, getId, getInteractiveProperty, getOverlapProperty, getRecurringDaysOfWeekProperty, getRecurringEndDateProperty, getRecurringEndTimeProperty, getRecurringStartDateProperty, getRecurringStartTimeProperty, getStartDateTimeProperty, getStartEditableProperty, getTextColorProperty, getTitleProperty, isAdditionalProperty, isEventPropertyChanged, setAdditionalProperties, setAllDayProperty, setBackgroundColorProperty, setBorderColorProperty, setClassNamesProperty, setConstraintProperty, setDescriptionProperty, setDisplayProperty, setDurationEditableProperty, setEndDateTimeProperty, setGroupIdProperty, setInteractiveProperty, setOverlapProperty, setRecurringDaysOfWeekProperty, setRecurringEndDateProperty, setRecurringEndTimeProperty, setRecurringStartDateProperty, setRecurringStartTimeProperty, setStartDateTimeProperty, setStartEditableProperty, setTextColorProperty, setTitleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.fullcalendarflowui.component.data.CalendarDataProvider
getId
-
Field Details
-
START_DATE_PARAMETER
- See Also:
-
END_DATE_PARAMETER
- See Also:
-
dataManager
-
metadata
-
dateTimeTransformations
-
entityClass
-
queryString
-
fetchPlan
-
loadDelegate
-
-
Constructor Details
-
EntityCalendarDataRetriever
public EntityCalendarDataRetriever() -
EntityCalendarDataRetriever
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
getLoadDelegate
@Nullable public Function<CallbackCalendarDataProvider.ItemsFetchContext,List<CalendarEvent>> getLoadDelegate()- Returns:
- load delegate or
null
if not set
-
setLoadDelegate
public void setLoadDelegate(@Nullable Function<CallbackCalendarDataProvider.ItemsFetchContext, List<CalendarEvent>> loadDelegate) Sets load delegate that will be used for loading events.- Parameters:
loadDelegate
- delegate to set
-
getEntityMetaClass
- Specified by:
getEntityMetaClass
in interfaceEntityCalendarDataProvider
- Returns:
- entity meta class
-
getEntityClass
- Returns:
- entity class or
null
if not set
-
setEntityClass
Sets entity class that should be used for loading entities using JPQL query.Is not used if load delegate is set.
- Parameters:
entityClass
- entity class, can not be null
-
getQueryString
- Returns:
- query string or
null
if not set
-
setQueryString
Sets JPQL query string.Is not used if load delegate is set.
- Parameters:
queryString
- JPQL query string
-
getFetchPlan
- Returns:
- fetch plan or
null
if not set
-
setFetchPlan
Sets fetch plan for loading entities using JPQL query.Is not used if load delegate is set.
- Parameters:
fetchPlan
- fetch plan
-
onItemsFetch
Description copied from interface:CallbackCalendarDataProvider
A callback method that is invoked byFullCalendar
, for instance, when the user navigates to next/previous dates.- Specified by:
onItemsFetch
in interfaceCallbackCalendarDataProvider
- Parameters:
context
- context that contains information about date range- Returns:
- a list of fetched calendar events
-
getStartPropertyJavaType
- Specified by:
getStartPropertyJavaType
in interfaceEntityCalendarDataProvider
- Returns:
- java type of start date-time property or
null
if property is not specified
-
getEndPropertyJavaType
- Specified by:
getEndPropertyJavaType
in interfaceEntityCalendarDataProvider
- Returns:
- java type of end date-time property or
null
if property is not specified
-
load
-
loadItems
-
getStartParameterValue
protected Object getStartParameterValue(CallbackCalendarDataProvider.ItemsFetchContext fetchContext) -
getEndParameterValue
-
transformToValueWithSystemTimeZone
-
isStartDateUsed
-
isEndDateUsed
-