001/*
002 *  Copyright 2022 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 */
016
017package org.ametys.plugins.workspaces.calendars;
018
019import org.apache.avalon.framework.service.ServiceException;
020import org.apache.avalon.framework.service.ServiceManager;
021
022import org.ametys.plugins.explorer.resources.actions.ExplorerResourcesDAO;
023import org.ametys.plugins.workspaces.AbstractWorkspaceDAO;
024
025/**
026 * Abstract class for Calendar DAO's
027 *
028 */
029public abstract class AbstractCalendarDAO extends AbstractWorkspaceDAO
030{
031
032    /** Right to add a calendar */
033    public static final String RIGHTS_CALENDAR_ADD = "Plugins_Workspaces_Calendar_Add";
034    /** Right to edit a calendar */
035    public static final String RIGHTS_CALENDAR_EDIT = "Plugins_Workspaces_Calendar_Edit";
036    /** Right to delete a calendar */
037    public static final String RIGHTS_CALENDAR_DELETE = "Plugins_Workspaces_Calendar_Delete";
038    /** Right to add a event */
039    public static final String RIGHTS_EVENT_ADD = "Plugins_Workspaces_Event_Add";
040    /** Right to edit a event */
041    public static final String RIGHTS_EVENT_EDIT = "Plugins_Workspaces_Event_Edit";
042    /** Right to edit a event */
043    public static final String RIGHTS_OWNED_EVENT_DELETE = "Plugins_Workspaces_Owned_Event_Delete";
044    /** Right to delete a event */
045    public static final String RIGHTS_EVENT_DELETE = "Plugins_Workspaces_Event_Delete";
046    /** Right to delete_own a event */
047    public static final String RIGHTS_EVENT_DELETE_OWN = "Plugins_Workspaces_Owned_Event_Delete";
048    /** Right to handle a resource */
049    public static final String RIGHTS_HANDLE_RESOURCE = "Plugins_Workspaces_Handle_Resource";
050    /** Right to book a resource */
051    public static final String RIGHTS_BOOK_RESOURCE = "Plugins_Workspaces_Book_Resource";
052    
053
054    /** The Messaging connector calendar manager */
055    protected MessagingConnectorCalendarManager _messagingConnectorCalendarManager;
056            
057    /** Explorer resources DAO */
058    protected ExplorerResourcesDAO _explorerResourcesDAO;
059
060    /** The color component */
061    protected CalendarColorsComponent _calendarColors;
062    
063    @Override
064    public void service(ServiceManager manager) throws ServiceException
065    {
066        super.service(manager);
067        _messagingConnectorCalendarManager = (MessagingConnectorCalendarManager) manager.lookup(MessagingConnectorCalendarManager.ROLE);
068        _explorerResourcesDAO = (ExplorerResourcesDAO) manager.lookup(ExplorerResourcesDAO.ROLE);
069        _calendarColors = (CalendarColorsComponent) manager.lookup(CalendarColorsComponent.ROLE);
070    }
071
072}