001: /*
002: * Copyright (c) 2001 - 2005 ivata limited.
003: * All rights reserved.
004: * -----------------------------------------------------------------------------
005: * ivata groupware may be redistributed under the GNU General Public
006: * License as published by the Free Software Foundation;
007: * version 2 of the License.
008: *
009: * These programs are free software; you can redistribute them and/or
010: * modify them under the terms of the GNU General License
011: * as published by the Free Software Foundation; version 2 of the License.
012: *
013: * These programs are distributed in the hope that they will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: *
017: * See the GNU General License in the file LICENSE.txt for more
018: * details.
019: *
020: * If you would like a copy of the GNU General License write to
021: *
022: * Free Software Foundation, Inc.
023: * 59 Temple Place - Suite 330
024: * Boston, MA 02111-1307, USA.
025: *
026: *
027: * To arrange commercial support and licensing, contact ivata at
028: * http://www.ivata.com/contact.jsp
029: * -----------------------------------------------------------------------------
030: * $Log: Calendar.java,v $
031: * Revision 1.4 2005/10/11 18:58:58 colinmacleod
032: * Fixed some checkstyle and javadoc issues.
033: *
034: * Revision 1.3 2005/04/10 20:09:40 colinmacleod
035: * Added new themes.
036: * Changed id type to String.
037: * Changed i tag to em and b tag to strong.
038: * Improved PicoContainerFactory with NanoContainer scripts.
039: *
040: * Revision 1.2 2005/04/09 17:19:16 colinmacleod
041: * Changed copyright text to GPL v2 explicitly.
042: *
043: * Revision 1.1.1.1 2005/03/10 17:47:40 colinmacleod
044: * Restructured ivata op around Hibernate/PicoContainer.
045: * Renamed ivata groupware.
046: *
047: * Revision 1.4 2004/11/12 18:17:26 colinmacleod
048: * Ordered imports.
049: *
050: * Revision 1.3 2004/11/12 16:08:08 colinmacleod
051: * Removed dependencies on SSLEXT.
052: * Moved Persistence classes to ivata masks.
053: *
054: * Revision 1.2 2004/07/13 19:42:12 colinmacleod
055: * Moved project to POJOs from EJBs.
056: * Applied PicoContainer to services layer (replacing session EJBs).
057: * Applied Hibernate to persistence layer (replacing entity EJBs).
058: *
059: * Revision 1.1 2004/03/27 10:31:25 colinmacleod
060: * Split off business logic from remote facades to POJOs.
061: * -----------------------------------------------------------------------------
062: */
063: package com.ivata.groupware.business.calendar;
064:
065: import java.util.Collection;
066:
067: import com.ivata.groupware.admin.security.server.SecuritySession;
068: import com.ivata.groupware.business.calendar.event.EventDO;
069: import com.ivata.groupware.business.calendar.event.meeting.MeetingDO;
070: import com.ivata.mask.util.SystemException;
071: import com.ivata.mask.validation.ValidationErrors;
072:
073: /**
074: * The calendar provides functions for adding, amending, removing and viewing
075: * events.
076: *
077: * @author Colin MacLeod
078: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
079: * @since ivata groupware 0.9 (24-Mar-2004)
080: * @version $Revision: 1.4 $
081: */
082: public interface Calendar {
083: /**
084: * Name used to identify calendar message resource strings.
085: */
086: String BUNDLE_PATH = "calendar";
087:
088: /**
089: * <p>
090: * Add a new event to the calendar.
091: * </p>
092: *
093: * @param securitySession Used to check current user is allowed to
094: * add the event.
095: * @param eventDO Event to be added.
096: * @return Added event, with details exactly as they are stored in the
097: * system.
098: * @throws SystemException If the event cannot be added for any reason.
099: */
100: EventDO addEvent(final SecuritySession securitySession,
101: final EventDO eventDO) throws SystemException;
102:
103: /**
104: * <p>
105: * Amend an existing event in the calendar.
106: * </p>
107: *
108: * @param securitySession Used to check current user is allowed to
109: * amend the event.
110: * @param eventDO Event to be amended.
111: * @return Added event, with details exactly as they are stored in the
112: * system.
113: * @throws SystemException If the event cannot be amended for any reason.
114: */
115: EventDO amendEvent(final SecuritySession securitySession,
116: final EventDO eventDO) throws SystemException;
117:
118: /**
119: * <p>
120: * Locate an event by its unique identifier.
121: * </p>
122: *
123: * @param securitySession Used to check current user is allowed to
124: * view the event.
125: * @param id Unique identifier of the event to be returned.
126: * @return Event matching this unique identifier.
127: * @throws SystemException If the event cannot be retrieved for any reason.
128: */
129: EventDO findEventByPrimaryKey(
130: final SecuritySession securitySession, final String id)
131: throws SystemException;
132:
133: /**
134: * <p>
135: * Locate all events for a single day.
136: * </p>
137: *
138: * @param securitySession Used to filter events for only those the current
139: * user is allowed to view.
140: * @param day Calendar day for which to return events.
141: * @return <code>Collection</code> containing <code>EventDO</code>
142: * instances.
143: * @throws SystemException If the events cannot be retrieved for any reason.
144: */
145: Collection findEventsForDay(final SecuritySession securitySession,
146: final java.util.Calendar day) throws SystemException;
147:
148: /**
149: * <p>
150: * Remove an event from the system.
151: * </p>
152: *
153: * @param securitySession Used to check current user is allowed to
154: * remove the event.
155: * @param eventDO Event to be removed.
156: * @throws SystemException If the event cannot be added for any reason.
157: */
158: void removeEvent(final SecuritySession securitySession,
159: final EventDO eventDO) throws SystemException;
160:
161: /**
162: * <p>
163: * Confirm all of the elements of the event are present and valid.
164: * </p>
165: *
166: * @param securitySession Used to check current user is allowed to
167: * validate the event.
168: * @param eventDO Data object to check for consistency and
169: * completeness.
170: * @return a collection of validation errors if any of the
171: * mandatory fields are missing, or if fields contain invalid values.
172: * @throws SystemException If the event cannot be validated for any reason.
173: */
174: ValidationErrors validate(final SecuritySession securitySession,
175: final EventDO eventDO) throws SystemException;
176:
177: /**
178: * <p>Confirm all of the elements of the meeting and associated event are
179: * present and valid.</p>
180: *
181: * @param securitySession Used to check current user is allowed to
182: * validate the event.
183: * @param meetingDO Data object to check for consistency and
184: * completeness.
185: * @return a collection of validation errors if any of the
186: * mandatory fields are missing, or if fields contain invalid values.
187: * @throws SystemException If the event cannot be validated for any reason.
188: */
189: ValidationErrors validate(final SecuritySession securitySession,
190: final MeetingDO meetingDO) throws SystemException;
191: }
|