Class JCRCalendarEvent
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<JCRCalendarEventFactory>
-
- org.ametys.plugins.explorer.calendars.jcr.JCRCalendarEvent
-
- All Implemented Interfaces:
CalendarEvent,ModifiableCalendarEvent,ACLAmetysObject,AmetysObject,JCRAmetysObject,JCRTraversableAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,ModifiableTraversableAmetysObject,RemovableAmetysObject,TraversableAmetysObject,WorkflowAwareAmetysObject
public class JCRCalendarEvent extends DefaultTraversableAmetysObject<JCRCalendarEventFactory> implements ModifiableCalendarEvent
Default implementation of anCalendarEvent, backed by a JCR node.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETADATA_CONTRIBUTORMetadata's name for last contributor's event*static StringMETADATA_CREATIONMetadata's name for lastModified's event*static StringMETADATA_CREATORMetadata's name for author's event*static StringMETADATA_DESCMetadata's name for description's event*static StringMETADATA_END_DATEMetadata's name for endDate's event*static StringMETADATA_EXCLUDED_DATEMetadata's name for excluded date event*static StringMETADATA_FULL_DAYMetadata's name for fullDay's event*static StringMETADATA_KEYWORDSMetadata's name for keywords' event*static StringMETADATA_LOCATIONMetadata's name for location's event*static StringMETADATA_MODIFIEDMetadata's name for lastModified's event*static StringMETADATA_ORGANISERMetadata's name for organiser's event*static StringMETADATA_RECURRENCE_TYPEMetadata's name for recurrence type event*static StringMETADATA_START_DATEMetadata's name for startDate's event*static StringMETADATA_TITLEMetadata's name for title's event*static StringMETADATA_UNTIL_DATEMetadata's name for until date event*static StringMETADATA_VALIDATEDMetadata's name for last validated date's event*static StringMETADATA_VALIDATORMetadata's name for last validator's event*static StringNODE_ATTENDEE_NAMEName of the node for attendee *static StringNODE_ATTENDEES_NAMEName of the node for attendees *static StringPROPERTY_ATTENDEE_EMAILProperty name for attendee email *static StringPROPERTY_ATTENDEE_EXTERNALProperty name for attendee external *static StringPROPERTY_ATTENDEE_LOGINProperty name for attendee login *static StringPROPERTY_ATTENDEE_MANDATORYProperty name for attendee mandatory *static StringPROPERTY_ATTENDEE_POPULATIONProperty name for attendee population *static StringPROPERTY_WORKFLOW_IDProperty's name for workflow id
-
Constructor Summary
Constructors Constructor Description JCRCalendarEvent(Node node, String parentPath, JCRCalendarEventFactory factory)Creates anJCRCalendarEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CalendarEventAttendee>getAttendees()Get attendees to the eventDategetCreationDate()Retrieves the creation date.UserIdentitygetCreator()Retrieves the the creator.longgetCurrentStepId()Retrieves the current step id of the Ametys objectStringgetDescription()Get the description of the eventDategetEndDate()Get the date of the end of the eventList<Date>getExcludedOccurences()Retrieves the list of excluded event date.DategetFirstOccurrence(Date date)Retrieves the start date of the first Event which end after the dateBooleangetFullDay()Get if the event last all the dayString[]getKeywords()Returns the keywords of this event, as a String array.UserIdentitygetLastContributor()Retrieves the last contributor.DategetLastModified()Retrieves the last modification date.DategetLastValidated()Retrieves the last validation date.UserIdentitygetLastValidator()Retrieves the last validator.StringgetLocation()Get the location of the eventDategetNextOccurrence(Date date)Retrieves the date of the next event after the dateList<Date>getOccurrences(Date startDate, Date endDate)Retrieves the list of all event date between startDate and endDate.UserIdentitygetOrganiser()Retrieves the organiser.EventRecurrenceTypeEnumgetRecurrenceType()Retrieves the recurrence type.DategetRepeatUntil()Retrieves the end date of the frequency.DategetStartDate()Get the date of the begin of the eventStringgetTitle()Get the title of the eventlonggetWorkflowId()Retrieves the workflow id associated with the Ametys object.BooleanisRecurrent()Retrieves if the event is recurrent.voidsetAttendees(List<CalendarEventAttendee> attendees)Set attendees to the eventvoidsetCreationDate(Date date)Set the creation datevoidsetCreator(UserIdentity user)Set the creatorvoidsetCurrentStepId(long stepId)Set the current step id of the Ametys objectvoidsetDescription(String desc)Set the description of the eventvoidsetEndDate(Date endDate)Set the endDate of the eventvoidsetExcludedOccurrences(List<Date> excludedOccurrences)Set the list of excluded event date.voidsetFullDay(Boolean fullDay)Set if the event last all the dayvoidsetKeywords(String[] keywords)Set this event's keywords.voidsetLastContributor(UserIdentity user)Set the last contributorvoidsetLastModified(Date date)Set the last modified datevoidsetLastValidated(Date date)Set the last validation date of the eventvoidsetLastValidator(UserIdentity user)Set the last validator of the eventvoidsetLocation(String location)Set the location of the eventvoidsetOrganiser(UserIdentity user)Set the oragniservoidsetRecurrenceType(String recurrenceType)Set the recurrence type.voidsetRepeatUntil(Date untilDate)Set the end date of the frequency.voidsetStartDate(Date startDate)Set the startDate of the eventvoidsetTitle(String title)Set the title of the eventvoidsetWorkflowId(long workflowId)Set the workflow id of this Ametys object.
This method will throw Exception if the workflow id was already set on this Ametys object.-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
-
-
-
Field Detail
-
METADATA_CREATOR
public static final String METADATA_CREATOR
Metadata's name for author's event*- See Also:
- Constant Field Values
-
METADATA_CREATION
public static final String METADATA_CREATION
Metadata's name for lastModified's event*- See Also:
- Constant Field Values
-
METADATA_CONTRIBUTOR
public static final String METADATA_CONTRIBUTOR
Metadata's name for last contributor's event*- See Also:
- Constant Field Values
-
METADATA_MODIFIED
public static final String METADATA_MODIFIED
Metadata's name for lastModified's event*- See Also:
- Constant Field Values
-
METADATA_TITLE
public static final String METADATA_TITLE
Metadata's name for title's event*- See Also:
- Constant Field Values
-
METADATA_DESC
public static final String METADATA_DESC
Metadata's name for description's event*- See Also:
- Constant Field Values
-
METADATA_KEYWORDS
public static final String METADATA_KEYWORDS
Metadata's name for keywords' event*- See Also:
- Constant Field Values
-
METADATA_LOCATION
public static final String METADATA_LOCATION
Metadata's name for location's event*- See Also:
- Constant Field Values
-
METADATA_START_DATE
public static final String METADATA_START_DATE
Metadata's name for startDate's event*- See Also:
- Constant Field Values
-
METADATA_END_DATE
public static final String METADATA_END_DATE
Metadata's name for endDate's event*- See Also:
- Constant Field Values
-
METADATA_VALIDATED
public static final String METADATA_VALIDATED
Metadata's name for last validated date's event*- See Also:
- Constant Field Values
-
METADATA_VALIDATOR
public static final String METADATA_VALIDATOR
Metadata's name for last validator's event*- See Also:
- Constant Field Values
-
METADATA_FULL_DAY
public static final String METADATA_FULL_DAY
Metadata's name for fullDay's event*- See Also:
- Constant Field Values
-
METADATA_RECURRENCE_TYPE
public static final String METADATA_RECURRENCE_TYPE
Metadata's name for recurrence type event*- See Also:
- Constant Field Values
-
METADATA_UNTIL_DATE
public static final String METADATA_UNTIL_DATE
Metadata's name for until date event*- See Also:
- Constant Field Values
-
METADATA_EXCLUDED_DATE
public static final String METADATA_EXCLUDED_DATE
Metadata's name for excluded date event*- See Also:
- Constant Field Values
-
METADATA_ORGANISER
public static final String METADATA_ORGANISER
Metadata's name for organiser's event*- See Also:
- Constant Field Values
-
PROPERTY_ATTENDEE_POPULATION
public static final String PROPERTY_ATTENDEE_POPULATION
Property name for attendee population *- See Also:
- Constant Field Values
-
PROPERTY_ATTENDEE_LOGIN
public static final String PROPERTY_ATTENDEE_LOGIN
Property name for attendee login *- See Also:
- Constant Field Values
-
PROPERTY_ATTENDEE_EMAIL
public static final String PROPERTY_ATTENDEE_EMAIL
Property name for attendee email *- See Also:
- Constant Field Values
-
PROPERTY_ATTENDEE_EXTERNAL
public static final String PROPERTY_ATTENDEE_EXTERNAL
Property name for attendee external *- See Also:
- Constant Field Values
-
PROPERTY_ATTENDEE_MANDATORY
public static final String PROPERTY_ATTENDEE_MANDATORY
Property name for attendee mandatory *- See Also:
- Constant Field Values
-
NODE_ATTENDEES_NAME
public static final String NODE_ATTENDEES_NAME
Name of the node for attendees *- See Also:
- Constant Field Values
-
NODE_ATTENDEE_NAME
public static final String NODE_ATTENDEE_NAME
Name of the node for attendee *- See Also:
- Constant Field Values
-
PROPERTY_WORKFLOW_ID
public static final String PROPERTY_WORKFLOW_ID
Property's name for workflow id- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRCalendarEvent
public JCRCalendarEvent(Node node, String parentPath, JCRCalendarEventFactory factory)
Creates anJCRCalendarEvent.- Parameters:
node- the node backing thisAmetysObjectparentPath- the parentPath in the Ametys hierarchyfactory- the DefaultAmetysObjectFactory which created the AmetysObject
-
-
Method Detail
-
getTitle
public String getTitle()
Description copied from interface:CalendarEventGet the title of the event- Specified by:
getTitlein interfaceCalendarEvent- Returns:
- the title of the event
-
getDescription
public String getDescription()
Description copied from interface:CalendarEventGet the description of the event- Specified by:
getDescriptionin interfaceCalendarEvent- Returns:
- the description of the event
-
getLocation
public String getLocation()
Description copied from interface:CalendarEventGet the location of the event- Specified by:
getLocationin interfaceCalendarEvent- Returns:
- the location of the event
-
getKeywords
public String[] getKeywords() throws AmetysRepositoryException
Description copied from interface:CalendarEventReturns the keywords of this event, as a String array.- Specified by:
getKeywordsin interfaceCalendarEvent- Returns:
- the keywords of this event.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getStartDate
public Date getStartDate()
Description copied from interface:CalendarEventGet the date of the begin of the event- Specified by:
getStartDatein interfaceCalendarEvent- Returns:
- the date of the event
-
getEndDate
public Date getEndDate()
Description copied from interface:CalendarEventGet the date of the end of the event- Specified by:
getEndDatein interfaceCalendarEvent- Returns:
- the date of the event
-
getFullDay
public Boolean getFullDay()
Description copied from interface:CalendarEventGet if the event last all the day- Specified by:
getFullDayin interfaceCalendarEvent- Returns:
- true if the event last all the day
-
getCreator
public UserIdentity getCreator()
Description copied from interface:CalendarEventRetrieves the the creator.- Specified by:
getCreatorin interfaceCalendarEvent- Returns:
- the creator.
-
getCreationDate
public Date getCreationDate()
Description copied from interface:CalendarEventRetrieves the creation date.- Specified by:
getCreationDatein interfaceCalendarEvent- Returns:
- the creation date.
-
getLastContributor
public UserIdentity getLastContributor()
Description copied from interface:CalendarEventRetrieves the last contributor.- Specified by:
getLastContributorin interfaceCalendarEvent- Returns:
- the last contributor.
-
getLastModified
public Date getLastModified()
Description copied from interface:CalendarEventRetrieves the last modification date.- Specified by:
getLastModifiedin interfaceCalendarEvent- Returns:
- the last modification date.
-
getLastValidator
public UserIdentity getLastValidator() throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:CalendarEventRetrieves the last validator.- Specified by:
getLastValidatorin interfaceCalendarEvent- Returns:
- the last validator.
- Throws:
UnknownMetadataException- if this property does not exists.AmetysRepositoryException- if an error occurs.
-
getLastValidated
public Date getLastValidated() throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:CalendarEventRetrieves the last validation date.- Specified by:
getLastValidatedin interfaceCalendarEvent- Returns:
- the last validation date.
- Throws:
UnknownMetadataException- if this property does not exists.AmetysRepositoryException- if an error occurs.
-
getRecurrenceType
public EventRecurrenceTypeEnum getRecurrenceType()
Description copied from interface:CalendarEventRetrieves the recurrence type.- Specified by:
getRecurrenceTypein interfaceCalendarEvent- Returns:
- the recurrence type.
-
isRecurrent
public Boolean isRecurrent()
Description copied from interface:CalendarEventRetrieves if the event is recurrent.- Specified by:
isRecurrentin interfaceCalendarEvent- Returns:
- true if the event is recurrent.
-
getRepeatUntil
public Date getRepeatUntil()
Description copied from interface:CalendarEventRetrieves the end date of the frequency.- Specified by:
getRepeatUntilin interfaceCalendarEvent- Returns:
- the end date of the frequency.
-
getExcludedOccurences
public List<Date> getExcludedOccurences()
Description copied from interface:CalendarEventRetrieves the list of excluded event date.- Specified by:
getExcludedOccurencesin interfaceCalendarEvent- Returns:
- the list of excluded event date.
-
getOrganiser
public UserIdentity getOrganiser() throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:CalendarEventRetrieves the organiser.- Specified by:
getOrganiserin interfaceCalendarEvent- Returns:
- the organiser.
- Throws:
UnknownMetadataException- if this property does not exists.AmetysRepositoryException- if an error occurs.
-
setTitle
public void setTitle(String title)
Description copied from interface:ModifiableCalendarEventSet the title of the event- Specified by:
setTitlein interfaceModifiableCalendarEvent- Parameters:
title- the title
-
setDescription
public void setDescription(String desc)
Description copied from interface:ModifiableCalendarEventSet the description of the event- Specified by:
setDescriptionin interfaceModifiableCalendarEvent- Parameters:
desc- the description
-
setLocation
public void setLocation(String location)
Description copied from interface:ModifiableCalendarEventSet the location of the event- Specified by:
setLocationin interfaceModifiableCalendarEvent- Parameters:
location- the location
-
setKeywords
public void setKeywords(String[] keywords)
Description copied from interface:ModifiableCalendarEventSet this event's keywords.- Specified by:
setKeywordsin interfaceModifiableCalendarEvent- Parameters:
keywords- the keywords.
-
setStartDate
public void setStartDate(Date startDate)
Description copied from interface:ModifiableCalendarEventSet the startDate of the event- Specified by:
setStartDatein interfaceModifiableCalendarEvent- Parameters:
startDate- the start date
-
setEndDate
public void setEndDate(Date endDate)
Description copied from interface:ModifiableCalendarEventSet the endDate of the event- Specified by:
setEndDatein interfaceModifiableCalendarEvent- Parameters:
endDate- the end date
-
setFullDay
public void setFullDay(Boolean fullDay)
Description copied from interface:ModifiableCalendarEventSet if the event last all the day- Specified by:
setFullDayin interfaceModifiableCalendarEvent- Parameters:
fullDay- is a fullday event
-
setCreator
public void setCreator(UserIdentity user) throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:ModifiableCalendarEventSet the creator- Specified by:
setCreatorin interfaceModifiableCalendarEvent- Parameters:
user- The creator- Throws:
UnknownMetadataExceptionAmetysRepositoryException
-
setCreationDate
public void setCreationDate(Date date) throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:ModifiableCalendarEventSet the creation date- Specified by:
setCreationDatein interfaceModifiableCalendarEvent- Parameters:
date- The creation date- Throws:
UnknownMetadataExceptionAmetysRepositoryException
-
setLastContributor
public void setLastContributor(UserIdentity user) throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:ModifiableCalendarEventSet the last contributor- Specified by:
setLastContributorin interfaceModifiableCalendarEvent- Parameters:
user- The last contributor- Throws:
UnknownMetadataExceptionAmetysRepositoryException
-
setLastModified
public void setLastModified(Date date) throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:ModifiableCalendarEventSet the last modified date- Specified by:
setLastModifiedin interfaceModifiableCalendarEvent- Parameters:
date- The last modified date- Throws:
UnknownMetadataExceptionAmetysRepositoryException
-
setLastValidator
public void setLastValidator(UserIdentity user) throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:ModifiableCalendarEventSet the last validator of the event- Specified by:
setLastValidatorin interfaceModifiableCalendarEvent- Parameters:
user- the last validator of the event- Throws:
UnknownMetadataExceptionAmetysRepositoryException
-
setLastValidated
public void setLastValidated(Date date) throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:ModifiableCalendarEventSet the last validation date of the event- Specified by:
setLastValidatedin interfaceModifiableCalendarEvent- Parameters:
date- the last validation date of the event- Throws:
UnknownMetadataExceptionAmetysRepositoryException
-
setRecurrenceType
public void setRecurrenceType(String recurrenceType)
Description copied from interface:ModifiableCalendarEventSet the recurrence type.- Specified by:
setRecurrenceTypein interfaceModifiableCalendarEvent- Parameters:
recurrenceType- the recurrence type
-
setRepeatUntil
public void setRepeatUntil(Date untilDate)
Description copied from interface:ModifiableCalendarEventSet the end date of the frequency.- Specified by:
setRepeatUntilin interfaceModifiableCalendarEvent- Parameters:
untilDate- the end date of the recurrence
-
setExcludedOccurrences
public void setExcludedOccurrences(List<Date> excludedOccurrences)
Description copied from interface:ModifiableCalendarEventSet the list of excluded event date.- Specified by:
setExcludedOccurrencesin interfaceModifiableCalendarEvent- Parameters:
excludedOccurrences- excluded date
-
getOccurrences
public List<Date> getOccurrences(Date startDate, Date endDate)
Description copied from interface:CalendarEventRetrieves the list of all event date between startDate and endDate.- Specified by:
getOccurrencesin interfaceCalendarEvent- Parameters:
startDate- the start dateendDate- the end date- Returns:
- the list of all event date between startDate and endDate.
-
getFirstOccurrence
public Date getFirstOccurrence(Date date)
Description copied from interface:CalendarEventRetrieves the start date of the first Event which end after the date- Specified by:
getFirstOccurrencein interfaceCalendarEvent- Parameters:
date- the date- Returns:
- the start date of the first Event which end after the date
-
getNextOccurrence
public Date getNextOccurrence(Date date)
Description copied from interface:CalendarEventRetrieves the date of the next event after the date- Specified by:
getNextOccurrencein interfaceCalendarEvent- Parameters:
date- the date- Returns:
- the date of the next event after the date
-
getWorkflowId
public long getWorkflowId() throws AmetysRepositoryException
Description copied from interface:WorkflowAwareAmetysObjectRetrieves the workflow id associated with the Ametys object.- Specified by:
getWorkflowIdin interfaceWorkflowAwareAmetysObject- Returns:
- the workflow id.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setWorkflowId
public void setWorkflowId(long workflowId) throws AmetysRepositoryException
Description copied from interface:WorkflowAwareAmetysObjectSet the workflow id of this Ametys object.
This method will throw Exception if the workflow id was already set on this Ametys object.- Specified by:
setWorkflowIdin interfaceWorkflowAwareAmetysObject- Parameters:
workflowId- the workflow id of the object.- Throws:
AmetysRepositoryException- if an error occurs.
-
getCurrentStepId
public long getCurrentStepId()
Description copied from interface:WorkflowAwareAmetysObjectRetrieves the current step id of the Ametys object- Specified by:
getCurrentStepIdin interfaceWorkflowAwareAmetysObject- Returns:
- the current step id
-
setCurrentStepId
public void setCurrentStepId(long stepId)
Description copied from interface:WorkflowAwareAmetysObjectSet the current step id of the Ametys object- Specified by:
setCurrentStepIdin interfaceWorkflowAwareAmetysObject- Parameters:
stepId- the step id to set
-
setOrganiser
public void setOrganiser(UserIdentity user)
Description copied from interface:ModifiableCalendarEventSet the oragniser- Specified by:
setOrganiserin interfaceModifiableCalendarEvent- Parameters:
user- The oragniser
-
getAttendees
public List<CalendarEventAttendee> getAttendees() throws RepositoryException
Get attendees to the event- Returns:
- the attendees
- Throws:
RepositoryException- if an error occurred
-
setAttendees
public void setAttendees(List<CalendarEventAttendee> attendees) throws RepositoryException
Set attendees to the event- Parameters:
attendees- the list of attendees- Throws:
RepositoryException- if an error occurred
-
-