Class CalendarEntityServiceImpl
java.lang.Object
ch.tocco.nice2.optional.calendar.impl.CalendarEntityServiceImpl
- All Implemented Interfaces:
CalendarEntityService
-
Constructor Summary
ConstructorDescriptionCalendarEntityServiceImpl
(QueryBuilderFactory queryBuilderFactory, Context context, CalendarEventContributionService contributionService, EntityDefaultValueService defaultValueService, CommandExecutor executor) -
Method Summary
Modifier and TypeMethodDescriptiongetOrCreateEntityCalendar
(Entity sourceEntity, String entityName, String calendarTypeId) use to handle Calendar entities that are related to one specific source entity either loads an existing Calendar or creates a new onegetSystemCalendar
(String entityName) loads the system calendar for a given entity model do not use this for entity models that use one calendar for each entity
-
Constructor Details
-
CalendarEntityServiceImpl
public CalendarEntityServiceImpl(QueryBuilderFactory queryBuilderFactory, Context context, CalendarEventContributionService contributionService, EntityDefaultValueService defaultValueService, CommandExecutor executor)
-
-
Method Details
-
getSystemCalendar
Description copied from interface:CalendarEntityService
loads the system calendar for a given entity model do not use this for entity models that use one calendar for each entity- Specified by:
getSystemCalendar
in interfaceCalendarEntityService
- Parameters:
entityName
- the entity model to load the calendar for- Returns:
- an optional containing the system calendar if it exists, empty otherwise
-
getOrCreateEntityCalendar
public Entity getOrCreateEntityCalendar(Entity sourceEntity, String entityName, String calendarTypeId) Description copied from interface:CalendarEntityService
use to handle Calendar entities that are related to one specific source entity either loads an existing Calendar or creates a new one- Specified by:
getOrCreateEntityCalendar
in interfaceCalendarEntityService
- Parameters:
sourceEntity
- the source entity to get the Calendar forentityName
- the entity name for which to get the contributioncalendarTypeId
- the Calendar_type unique_id for which to get the contribution- Returns:
- the Calendar for the source entity
-