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;
020import java.util.Map;
021
022import org.ametys.plugins.explorer.ExplorerNode;
023import org.ametys.plugins.repository.TraversableAmetysObject;
024
025/**
026 * Calendar Interface
027 */
028public interface Calendar extends ExplorerNode, TraversableAmetysObject
029{
030    /**
031     * Enumeration of calendar visiblity
032     */
033    public enum CalendarVisibility
034    {
035        /** Public */
036        PUBLIC,
037        /** Private */
038        PRIVATE;
039    }
040    
041    /**
042     * Get the color of the calendar
043     * @return the color of the calendar
044     */
045    public String getColor();
046    
047    /**
048     * Get the calendar visibility
049     * @return the calendar visibility
050     */
051    public CalendarVisibility getVisibility();
052    
053    /**
054     * Get the name of the workflow of the calendar
055     * @return the name of the workflow of the calendar
056     */
057    public String getWorkflowName();
058    
059    /**
060     * Get the template description of the calendar
061     * @return the template description of the calendar
062     */
063    public String getTemplateDescription();
064    
065    /**
066     * Get the events and its occurrences of the calendar between two dates
067     * @param startDate Begin date
068     * @param endDate End date
069     * @return the map of events and its occurrences
070     */
071    public Map<CalendarEvent, List<Date>> getEvents(Date startDate, Date endDate);
072}