Package org.exoplatform.agenda.util
Class Utils
java.lang.Object
org.exoplatform.agenda.util.Utils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddUserSpacesIdentities(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, String username, List<Long> identityIds) static voidbroadcastEvent(org.exoplatform.services.listener.ListenerService listenerService, String eventName, Object source, Object data) static booleancanAccessCalendar(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, long userIdentityId) static booleancanCreateEvent(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, long userIdentityId) static booleancanEditCalendar(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, long userIdentityId) static booleancanInviteeEdit(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId) static booleancheckAclByCalendarOwner(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, String username, boolean readonly) static voiddetectEventModifiedFields(org.exoplatform.agenda.model.Event newEvent, org.exoplatform.agenda.model.Event oldEvent, org.exoplatform.agenda.model.AgendaEventModification eventModification) getCalendarOwnersOfUser(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.identity.model.Identity userIdentity) static net.fortuna.ical4j.model.RecurgetICalendarRecur(org.exoplatform.agenda.model.EventRecurrence recurrence, ZoneId zoneId) static net.fortuna.ical4j.model.TimeZonegetICalTimeZone(ZoneId zoneId) static org.exoplatform.social.core.identity.model.IdentitygetIdentityById(org.exoplatform.social.core.manager.IdentityManager identityManager, long identityId) static org.exoplatform.social.core.identity.model.IdentitygetIdentityById(org.exoplatform.social.core.manager.IdentityManager identityManager, String identityId) static longgetIdentityIdByUsername(org.exoplatform.social.core.manager.IdentityManager identityManager, String username) static ZonedDateTimegetOccurrenceId(boolean allDay, ZonedDateTime eventStartDate, ZoneId eventStartDateTimeZone) static ZonedDateTimegetOccurrenceId(boolean allDay, net.fortuna.ical4j.model.DateTime eventStartDate, ZoneId eventStartDateTimeZone) static List<org.exoplatform.agenda.model.Event> getOccurrences(org.exoplatform.agenda.model.Event event, LocalDate from, LocalDate to, int limit) static StringgetResourceBundleLabel(Locale locale, String label) getSpaceMembersBySpaceName(String spaceName, org.exoplatform.social.core.space.spi.SpaceService spaceService) static StringgetUserLanguage(String userId) Gets platform language of user.static booleanisEventAttendee(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long identityId, List<org.exoplatform.agenda.model.EventAttendee> eventAttendees) static booleanisEventAttendee(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long identityId, org.exoplatform.agenda.model.EventAttendeeList eventAttendeeList) static booleanisExternal(String userId) static ZonedDateTimetoDateTime(String dateTimeString, ZoneId userTimeZone)
-
Field Details
-
POST_CREATE_AGENDA_EVENT_EVENT
- See Also:
-
POST_UPDATE_AGENDA_EVENT_EVENT
- See Also:
-
POST_DELETE_AGENDA_EVENT_EVENT
- See Also:
-
POST_EVENT_RESPONSE_SENT
- See Also:
-
POST_EVENT_RESPONSE_SAVED
- See Also:
-
POST_CREATE_AGENDA_EVENT_POLL
- See Also:
-
POST_VOTES_AGENDA_EVENT_POLL
- See Also:
-
POST_VOTE_AGENDA_EVENT_POLL
- See Also:
-
POST_DISMISS_AGENDA_EVENT_POLL
- See Also:
-
-
Method Details
-
getCalendarOwnersOfUser
-
addUserSpacesIdentities
public static void addUserSpacesIdentities(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, String username, List<Long> identityIds) throws Exception - Throws:
Exception
-
getOccurrences
-
getOccurrenceId
public static ZonedDateTime getOccurrenceId(boolean allDay, net.fortuna.ical4j.model.DateTime eventStartDate, ZoneId eventStartDateTimeZone) -
getOccurrenceId
public static ZonedDateTime getOccurrenceId(boolean allDay, ZonedDateTime eventStartDate, ZoneId eventStartDateTimeZone) -
getICalendarRecur
public static net.fortuna.ical4j.model.Recur getICalendarRecur(org.exoplatform.agenda.model.EventRecurrence recurrence, ZoneId zoneId) -
checkAclByCalendarOwner
public static boolean checkAclByCalendarOwner(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, String username, boolean readonly) throws IllegalAccessException - Parameters:
identityManager-IdentityManagerservice instancespaceService-SpaceServiceservice instanceownerId- calendar ownerIdentitytechnical identifierusername- name of user accessing calendar datareadonly- whether the access is to read or to write- Returns:
- true if user can modify calendar, else return false
- Throws:
IllegalAccessException- when the user ACL fails
-
canCreateEvent
public static boolean canCreateEvent(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, long userIdentityId) - Parameters:
identityManager-IdentityManagerservice instancespaceService-SpaceServiceservice instanceownerId- calendar ownerIdentitytechnical identifieruserIdentityId-Identityidentifier of user accessing calendar data- Returns:
- true if user can create event in a calendar, else return false
-
canInviteeEdit
public static boolean canInviteeEdit(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId) - Parameters:
identityManager-IdentityManagerservice instancespaceService-SpaceServiceservice instanceownerId- calendar ownerIdentitytechnical identifier- Returns:
- true if owner is a space and has at least one redactor, else return false
-
canEditCalendar
public static boolean canEditCalendar(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, long userIdentityId) - Parameters:
identityManager-IdentityManagerservice instancespaceService-SpaceServiceservice instanceownerId- calendar ownerIdentitytechnical identifieruserIdentityId-Identityidentifier of user accessing calendar data- Returns:
- true if user can modify calendar or its events, else return false
-
canAccessCalendar
public static boolean canAccessCalendar(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long ownerId, long userIdentityId) - Parameters:
identityManager-IdentityManagerservice instancespaceService-SpaceServiceservice instanceownerId- calendar ownerIdentitytechnical identifieruserIdentityId-Identityidentifier of user accessing calendar data- Returns:
- true if user can access calendar or its events, else return false
-
broadcastEvent
-
getIdentityById
public static org.exoplatform.social.core.identity.model.Identity getIdentityById(org.exoplatform.social.core.manager.IdentityManager identityManager, long identityId) -
getIdentityById
public static org.exoplatform.social.core.identity.model.Identity getIdentityById(org.exoplatform.social.core.manager.IdentityManager identityManager, String identityId) -
getIdentityIdByUsername
public static long getIdentityIdByUsername(org.exoplatform.social.core.manager.IdentityManager identityManager, String username) -
getSpaceMembersBySpaceName
-
isEventAttendee
public static boolean isEventAttendee(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long identityId, org.exoplatform.agenda.model.EventAttendeeList eventAttendeeList) -
isEventAttendee
public static boolean isEventAttendee(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, long identityId, List<org.exoplatform.agenda.model.EventAttendee> eventAttendees) -
getICalTimeZone
-
toDateTime
-
detectEventModifiedFields
public static void detectEventModifiedFields(org.exoplatform.agenda.model.Event newEvent, org.exoplatform.agenda.model.Event oldEvent, org.exoplatform.agenda.model.AgendaEventModification eventModification) -
getResourceBundleLabel
-
getUserLanguage
Gets platform language of user. In case of any errors return null.- Parameters:
userId- user Id- Returns:
- the platform language
-
isExternal
-