001/*
002 *  Copyright 2014 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.explorer.calendars;
017
018import java.util.Date;
019import java.util.List;
020
021import org.ametys.core.user.UserIdentity;
022import org.ametys.plugins.repository.AmetysRepositoryException;
023import org.ametys.plugins.repository.metadata.UnknownMetadataException;
024import org.ametys.plugins.workflow.repository.WorkflowAwareAmetysObject;
025
026/**
027 * Calendar event interface
028 */
029public interface CalendarEvent extends WorkflowAwareAmetysObject
030{
031    /**
032     * Get the title of the event
033     * @return the title of the event
034     */
035    public String getTitle();
036    
037    /**
038     * Get the description of the event
039     * @return the description of the event
040     */
041    public String getDescription();
042    
043    /**
044     * Get the location of the event
045     * @return the location of the event
046     */
047    public String getLocation();
048    
049    /**
050     * Get the date of the begin of the event
051     * @return the date of the event
052     */
053    public Date getStartDate();
054    
055    /**
056     * Get the date of the end of the event
057     * @return the date of the event
058     */
059    public Date getEndDate();
060    
061    /**
062     * Get if the event last all the day
063     * @return true if the event last all the day
064     */
065    public Boolean getFullDay();
066    
067    /**
068     * Retrieves the the creator.
069     * @return the creator.
070     * @throws UnknownMetadataException if this property does not exists.
071     * @throws AmetysRepositoryException if an error occurs.
072     */
073    public UserIdentity getCreator() throws UnknownMetadataException, AmetysRepositoryException;
074    
075    /**
076     * Retrieves the creation date.
077     * @return the creation date.
078     * @throws UnknownMetadataException if this property does not exists.
079     * @throws AmetysRepositoryException if an error occurs.
080     */
081    public Date getCreationDate() throws UnknownMetadataException, AmetysRepositoryException;
082    
083    /**
084     * Retrieves the last contributor.
085     * @return the last contributor.
086     * @throws UnknownMetadataException if this property does not exists.
087     * @throws AmetysRepositoryException if an error occurs.
088     */
089    public UserIdentity getLastContributor() throws UnknownMetadataException, AmetysRepositoryException;
090    
091    /**
092     * Retrieves the last modification date.
093     * @return the last modification date.
094     * @throws UnknownMetadataException if this property does not exists.
095     * @throws AmetysRepositoryException if an error occurs.
096     */
097    public Date getLastModified() throws UnknownMetadataException, AmetysRepositoryException;
098    
099    /**
100     * Retrieves the last validator.
101     * @return the last validator.
102     * @throws UnknownMetadataException if this property does not exists.
103     * @throws AmetysRepositoryException if an error occurs.
104     */
105    public UserIdentity getLastValidator() throws UnknownMetadataException, AmetysRepositoryException;
106   
107   /**
108     * Retrieves the last validation date.
109     * @return the last validation date.
110     * @throws UnknownMetadataException if this property does not exists.
111     * @throws AmetysRepositoryException if an error occurs.
112     */
113    public Date getLastValidated() throws UnknownMetadataException, AmetysRepositoryException;
114   
115    /**
116     * Returns the keywords of this event, as a String array.
117     * @return the keywords of this event.
118     * @throws AmetysRepositoryException if an error occurs.
119     */
120    public String[] getKeywords() throws AmetysRepositoryException;
121    
122    /**
123     * Retrieves the recurrence type.
124     * @return the recurrence type.
125     */
126    public EventRecurrenceTypeEnum getRecurrenceType();
127    
128    /**
129     * Retrieves if the event is recurrent.
130     * @return true if the event is recurrent.
131     */
132    public Boolean isRecurrent();
133    
134    /**
135     * Retrieves the end date of the frequency.
136     * @return the end date of the frequency.
137     */
138    public Date getRepeatUntil();
139    
140    /**
141     * Retrieves the list of excluded event date.
142     * @return the list of excluded event date.
143     */
144    public List<Date> getExcludedOccurences();
145    
146    /**
147     * Retrieves the list of all event date between startDate and endDate.
148     * @param startDate the start date
149     * @param endDate the end date
150     * @return the list of all event date between startDate and endDate.
151     */
152    public List<Date> getOccurrences(Date startDate, Date endDate);
153    
154    /**
155     * Retrieves the start date of the first Event which end after the date
156     * @param date the date
157     * @return the start date of the first Event which end after the date
158     */
159    public Date getFirstOccurrence(Date date);
160    
161    /**
162     * Retrieves the date of the next event after the date
163     * @param date the date
164     * @return the date of the next event after the date
165     */
166    public Date getNextOccurrence(Date date);
167    
168    /**
169     * Retrieves the organiser.
170     * @return the organiser.
171     * @throws UnknownMetadataException if this property does not exists.
172     * @throws AmetysRepositoryException if an error occurs.
173     */
174    public UserIdentity getOrganiser() throws UnknownMetadataException, AmetysRepositoryException;
175    
176}