Class EditEventFunction
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.plugins.workspaces.workflow.AbstractNodeWorkflowComponent
org.ametys.plugins.workspaces.calendars.workflow.AddEventFunction
org.ametys.plugins.workspaces.calendars.workflow.EditEventFunction
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,EnhancedFunction
,LogEnabled
,Serviceable
Action for editing a calendar event
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
AbstractWorkflowComponent.ConditionFailure
Nested classes/interfaces inherited from interface org.ametys.plugins.workflow.EnhancedFunction
EnhancedFunction.FunctionType
-
Field Summary
Fields inherited from class org.ametys.plugins.workspaces.calendars.workflow.AddEventFunction
_calendarDAO, _calendarEventDAO, _calendarEventJSONHelper, _currentUserProvider, _observationManager, _projectTagsDAO, _resolver
Fields inherited from class org.ametys.plugins.workspaces.workflow.AbstractNodeWorkflowComponent
EXPLORERNODE_KEY
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_VALIDATION_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ZonedDateTime[]
_computeEventDates
(CalendarEvent event, Map<String, Object> jsParameters) Compute the start date and end date of the event from the edited occurrenceprotected void
_createEventFromOccurrence
(CalendarEvent initialEvent, Calendar parentCalendar, Map transientVars, Map<String, Object> jsParameters) Create a new event from the occurrence of a eventprotected void
_excludeOccurrence
(ModifiableCalendarEvent event, ZonedDateTime occurrenceDate) Exclude a occurrence of a eventprotected void
_notifyListeners
(CalendarEvent event) Notify listeners that the event has been updatedvoid
getLabel()
Get the label for this functionvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.plugins.workspaces.calendars.workflow.AddEventFunction
_initializeWorkflow, _setEventData, getFunctionExecType
Methods inherited from class org.ametys.plugins.workspaces.workflow.AbstractNodeWorkflowComponent
getExplorerNode
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.workflow.EnhancedFunction
getArguments, getFullLabel, getVisibilities
-
Field Details
-
_workflowProvider
Workflow provider
-
-
Constructor Details
-
EditEventFunction
public EditEventFunction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAddEventFunction
- Throws:
ServiceException
-
execute
public void execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException - Specified by:
execute
in interfacecom.opensymphony.workflow.FunctionProvider
- Overrides:
execute
in classAddEventFunction
- Throws:
com.opensymphony.workflow.WorkflowException
-
_createEventFromOccurrence
protected void _createEventFromOccurrence(CalendarEvent initialEvent, Calendar parentCalendar, Map transientVars, Map<String, Object> jsParameters) Create a new event from the occurrence of a event- Parameters:
initialEvent
- The initial eventparentCalendar
- The parent calendartransientVars
- The transient variablejsParameters
- The JS parameters
-
_excludeOccurrence
Exclude a occurrence of a event- Parameters:
event
- The eventoccurrenceDate
- The date to exclude
-
_computeEventDates
Compute the start date and end date of the event from the edited occurrence- Parameters:
event
- The eventjsParameters
- The JS parameters- Returns:
- an array with computed start and end dates
-
_notifyListeners
Notify listeners that the event has been updated- Overrides:
_notifyListeners
in classAddEventFunction
- Parameters:
event
- The updated event
-
getLabel
Description copied from interface:EnhancedFunction
Get the label for this function- Specified by:
getLabel
in interfaceEnhancedFunction
- Overrides:
getLabel
in classAddEventFunction
- Returns:
- the label
-