Class MessagingConnectorCalendarManager
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.calendars.MessagingConnectorCalendarManager
-
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
public class MessagingConnectorCalendarManager extends AbstractLogEnabled implements Serviceable, Component, Contextualizable
Manager for manipulating messaging connector linked to calendars event of a project
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_SYNCHRONIZED_ID
Property's name for synchronized id idstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description MessagingConnectorCalendarManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_createEvent(JCRCalendarEvent event, UserIdentity organiser, List<CalendarEventAttendee> attendees)
Create event in the messaging connectorprotected void
_editEvent(JCRCalendarEvent event, UserIdentity organiser, List<CalendarEventAttendee> attendees)
Edit event in the messaging connectorprotected List<CalendarEventAttendee>
_getAttendeeListFromParameter(List<Map<String,Object>> attendeesList)
Get attendees list from the attendees parameterprotected String
_getEventTitle(JCRCalendarEvent event)
Get the computed title of the eventprotected UserIdentity
_getUserFromParameter(Map<String,Object> userMap)
Get user from the user parametervoid
addEventInvitation(Map<String,Object> parameters, String eventId)
Add event invitation parameters (attendees and organiser)void
contextualize(Context context)
void
deleteEvent(JCRCalendarEvent event)
Delete event in the messaging connectorvoid
editEventInvitation(Map<String,Object> parameters, String eventId)
Edit event invitation parameters (attendees and organiser)Map<String,Object>
getAttendees(String eventId)
Retrieves attendees to the eventMap<String,MessagingConnector.FreeBusyStatus>
getFreeBusy(String startDate, String endDate, boolean isAllDay, Map<String,Object> organiserMap, Map<String,String> attendeesList)
Get the list of attendees email with their free/busy statusMap<String,Object>
getOrganiser(String eventId)
Retrieves organiser to the eventString
getSynchronizedId(JCRCalendarEvent event)
Get the synchronized id (for messaging connector) of the eventboolean
isEventStillSynchronized(String eventId)
True if the event is still synchronized in the messaging connectorboolean
isEventSynchronized(String eventId)
True if the event is synchronized in the messaging connectorboolean
isValidUser(Map<String,Object> userAsMap)
True if user exists in the messaging connectorvoid
service(ServiceManager manager)
void
setAttendees(String eventId, List<CalendarEventAttendee> attendees)
Set attendees to the eventvoid
setInvitations(String eventId, Map<String,Object> organiserMap, List<Map<String,Object>> attendeesList)
Set invitation to the eventvoid
setOrganiser(String eventId, UserIdentity organiser)
Set organiser to the eventvoid
setSynchronizedId(JCRCalendarEvent event, String synchronizedId)
Set the synchronized id (for messaging connector) to the eventboolean
supportInvitation()
True if messaging connector support invitation-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
PROPERTY_SYNCHRONIZED_ID
public static final String PROPERTY_SYNCHRONIZED_ID
Property's name for synchronized id id- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessagingConnectorCalendarManager
public MessagingConnectorCalendarManager()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setSynchronizedId
public void setSynchronizedId(JCRCalendarEvent event, String synchronizedId)
Set the synchronized id (for messaging connector) to the event- Parameters:
event
- the eventsynchronizedId
- the synchronized id
-
getSynchronizedId
public String getSynchronizedId(JCRCalendarEvent event)
Get the synchronized id (for messaging connector) of the event- Parameters:
event
- the event- Returns:
- the synchronized id
-
setAttendees
public void setAttendees(String eventId, List<CalendarEventAttendee> attendees)
Set attendees to the event- Parameters:
eventId
- the event idattendees
- the list of attendees
-
setOrganiser
public void setOrganiser(String eventId, UserIdentity organiser)
Set organiser to the event- Parameters:
eventId
- the event idorganiser
- the organiser
-
addEventInvitation
public void addEventInvitation(Map<String,Object> parameters, String eventId)
Add event invitation parameters (attendees and organiser)- Parameters:
parameters
- the map of parameterseventId
- the event id
-
editEventInvitation
public void editEventInvitation(Map<String,Object> parameters, String eventId)
Edit event invitation parameters (attendees and organiser)- Parameters:
parameters
- the map of parameterseventId
- the event id
-
_createEvent
protected void _createEvent(JCRCalendarEvent event, UserIdentity organiser, List<CalendarEventAttendee> attendees)
Create event in the messaging connector- Parameters:
event
- the eventorganiser
- the organiserattendees
- the list of attendee
-
deleteEvent
public void deleteEvent(JCRCalendarEvent event)
Delete event in the messaging connector- Parameters:
event
- the event
-
_editEvent
protected void _editEvent(JCRCalendarEvent event, UserIdentity organiser, List<CalendarEventAttendee> attendees)
Edit event in the messaging connector- Parameters:
event
- the eventorganiser
- the organiserattendees
- the list of attendee
-
_getEventTitle
protected String _getEventTitle(JCRCalendarEvent event)
Get the computed title of the event- Parameters:
event
- the event- Returns:
- the computed title of the event
-
supportInvitation
public boolean supportInvitation()
True if messaging connector support invitation- Returns:
- true if messaging connector support invitation
-
isValidUser
public boolean isValidUser(Map<String,Object> userAsMap)
True if user exists in the messaging connector- Parameters:
userAsMap
- the user- Returns:
- true if user exists in the messaging connector
-
isEventStillSynchronized
public boolean isEventStillSynchronized(String eventId)
True if the event is still synchronized in the messaging connector- Parameters:
eventId
- the event id- Returns:
- true if the event exist
-
isEventSynchronized
public boolean isEventSynchronized(String eventId)
True if the event is synchronized in the messaging connector- Parameters:
eventId
- the event id- Returns:
- true if the event exist
-
getFreeBusy
public Map<String,MessagingConnector.FreeBusyStatus> getFreeBusy(String startDate, String endDate, boolean isAllDay, Map<String,Object> organiserMap, Map<String,String> attendeesList)
Get the list of attendees email with their free/busy status- Parameters:
startDate
- the start dateendDate
- the end dateisAllDay
- true if is all dayorganiserMap
- the organiser mapattendeesList
- the attendee list- Returns:
- the list of attendees email with their free/busy status
-
setInvitations
public void setInvitations(String eventId, Map<String,Object> organiserMap, List<Map<String,Object>> attendeesList)
Set invitation to the event- Parameters:
eventId
- the event idorganiserMap
- the organiser mapattendeesList
- the attendees list
-
getAttendees
public Map<String,Object> getAttendees(String eventId)
Retrieves attendees to the event- Parameters:
eventId
- the event id- Returns:
- The map of attendees
-
getOrganiser
public Map<String,Object> getOrganiser(String eventId)
Retrieves organiser to the event- Parameters:
eventId
- the event id- Returns:
- The organiser
-
_getUserFromParameter
protected UserIdentity _getUserFromParameter(Map<String,Object> userMap)
Get user from the user parameter- Parameters:
userMap
- the user map from parameters- Returns:
- the user
-
_getAttendeeListFromParameter
protected List<CalendarEventAttendee> _getAttendeeListFromParameter(List<Map<String,Object>> attendeesList)
Get attendees list from the attendees parameter- Parameters:
attendeesList
- the attendees list from parameters- Returns:
- the attendees list
-
-