001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/calendar/tags/sakai_2-4-1/calendar-api/api/src/java/org/sakaiproject/calendar/cover/CalendarService.java $
003: * $Id: CalendarService.java 14459 2006-09-12 18:37:51Z bkirschn@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.calendar.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>CalendarService is a static Cover for the {@link org.sakaiproject.calendar.api.CalendarService CalendarService};
026: * see that interface for usage details.</p>
027: */
028: public class CalendarService {
029: /** session attribute for list of all calendars user can reference */
030: public static final String SESSION_CALENDAR_LIST = org.sakaiproject.calendar.api.CalendarService.SESSION_CALENDAR_LIST;
031:
032: /**
033: * Access the component instance: special cover only method.
034: * @return the component instance.
035: */
036: public static org.sakaiproject.calendar.api.CalendarService getInstance() {
037: if (ComponentManager.CACHE_COMPONENTS) {
038: if (m_instance == null)
039: m_instance = (org.sakaiproject.calendar.api.CalendarService) ComponentManager
040: .get(org.sakaiproject.calendar.api.CalendarService.class);
041: return m_instance;
042: } else {
043: return (org.sakaiproject.calendar.api.CalendarService) ComponentManager
044: .get(org.sakaiproject.calendar.api.CalendarService.class);
045: }
046: }
047:
048: private static org.sakaiproject.calendar.api.CalendarService m_instance = null;
049:
050: public static java.lang.String APPLICATION_ID = org.sakaiproject.calendar.api.CalendarService.APPLICATION_ID;
051: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.calendar.api.CalendarService.REFERENCE_ROOT;
052: public static java.lang.String REF_TYPE_CALENDAR = org.sakaiproject.calendar.api.CalendarService.REF_TYPE_CALENDAR;
053: public static java.lang.String REF_TYPE_CALENDAR_PDF = org.sakaiproject.calendar.api.CalendarService.REF_TYPE_CALENDAR_PDF;
054: public static java.lang.String REF_TYPE_EVENT = org.sakaiproject.calendar.api.CalendarService.REF_TYPE_EVENT;
055: public static int MOD_NA = org.sakaiproject.calendar.api.CalendarService.MOD_NA;
056: public static int MOD_THIS = org.sakaiproject.calendar.api.CalendarService.MOD_THIS;
057: public static int MOD_ALL = org.sakaiproject.calendar.api.CalendarService.MOD_ALL;
058: public static int MOD_REST = org.sakaiproject.calendar.api.CalendarService.MOD_REST;
059: public static int MOD_PRIOR = org.sakaiproject.calendar.api.CalendarService.MOD_PRIOR;
060: public static int UNKNOWN_VIEW = org.sakaiproject.calendar.api.CalendarService.UNKNOWN_VIEW;
061: public static int DAY_VIEW = org.sakaiproject.calendar.api.CalendarService.DAY_VIEW;
062: public static int WEEK_VIEW = org.sakaiproject.calendar.api.CalendarService.WEEK_VIEW;
063: public static int MONTH_VIEW = org.sakaiproject.calendar.api.CalendarService.MONTH_VIEW;
064: public static int LIST_VIEW = org.sakaiproject.calendar.api.CalendarService.LIST_VIEW;
065:
066: public static java.lang.String calendarReference(
067: java.lang.String param0, java.lang.String param1) {
068: org.sakaiproject.calendar.api.CalendarService service = getInstance();
069: if (service == null)
070: return null;
071:
072: return service.calendarReference(param0, param1);
073: }
074:
075: public static java.lang.String calendarPdfReference(
076: java.lang.String param0, java.lang.String param1,
077: int param2, java.lang.String param3,
078: java.lang.String param4,
079: org.sakaiproject.time.api.TimeRange param5) {
080: org.sakaiproject.calendar.api.CalendarService service = getInstance();
081: if (service == null)
082: return null;
083:
084: return service.calendarPdfReference(param0, param1, param2,
085: param3, param4, param5);
086: }
087:
088: public static java.util.List getCalendars() {
089: org.sakaiproject.calendar.api.CalendarService service = getInstance();
090: if (service == null)
091: return null;
092:
093: return service.getCalendars();
094: }
095:
096: public static org.sakaiproject.calendar.api.CalendarEdit addCalendar(
097: java.lang.String param0)
098: throws org.sakaiproject.exception.IdUsedException,
099: org.sakaiproject.exception.IdInvalidException,
100: org.sakaiproject.exception.PermissionException {
101: org.sakaiproject.calendar.api.CalendarService service = getInstance();
102: if (service == null)
103: return null;
104:
105: return service.addCalendar(param0);
106: }
107:
108: public static boolean allowGetCalendar(java.lang.String param0) {
109: org.sakaiproject.calendar.api.CalendarService service = getInstance();
110: if (service == null)
111: return false;
112:
113: return service.allowGetCalendar(param0);
114: }
115:
116: public static boolean allowImportCalendar(java.lang.String param0) {
117: org.sakaiproject.calendar.api.CalendarService service = getInstance();
118: if (service == null)
119: return false;
120:
121: return service.allowImportCalendar(param0);
122: }
123:
124: public static boolean allowEditCalendar(java.lang.String param0) {
125: org.sakaiproject.calendar.api.CalendarService service = getInstance();
126: if (service == null)
127: return false;
128:
129: return service.allowEditCalendar(param0);
130: }
131:
132: public static boolean allowMergeCalendar(java.lang.String param0) {
133: org.sakaiproject.calendar.api.CalendarService service = getInstance();
134: if (service == null)
135: return false;
136:
137: return service.allowMergeCalendar(param0);
138: }
139:
140: public static org.sakaiproject.calendar.api.CalendarEdit editCalendar(
141: java.lang.String param0)
142: throws org.sakaiproject.exception.IdUnusedException,
143: org.sakaiproject.exception.PermissionException,
144: org.sakaiproject.exception.InUseException {
145: org.sakaiproject.calendar.api.CalendarService service = getInstance();
146: if (service == null)
147: return null;
148:
149: return service.editCalendar(param0);
150: }
151:
152: public static void commitCalendar(
153: org.sakaiproject.calendar.api.CalendarEdit param0) {
154: org.sakaiproject.calendar.api.CalendarService service = getInstance();
155: if (service == null)
156: return;
157:
158: service.commitCalendar(param0);
159: }
160:
161: public static void cancelCalendar(
162: org.sakaiproject.calendar.api.CalendarEdit param0) {
163: org.sakaiproject.calendar.api.CalendarService service = getInstance();
164: if (service == null)
165: return;
166:
167: service.cancelCalendar(param0);
168: }
169:
170: public static void removeCalendar(
171: org.sakaiproject.calendar.api.CalendarEdit param0)
172: throws org.sakaiproject.exception.PermissionException {
173: org.sakaiproject.calendar.api.CalendarService service = getInstance();
174: if (service == null)
175: return;
176:
177: service.removeCalendar(param0);
178: }
179:
180: public static java.lang.String eventReference(
181: java.lang.String param0, java.lang.String param1,
182: java.lang.String param2) {
183: org.sakaiproject.calendar.api.CalendarService service = getInstance();
184: if (service == null)
185: return null;
186:
187: return service.eventReference(param0, param1, param2);
188: }
189:
190: public static org.sakaiproject.calendar.api.CalendarEventVector getEvents(
191: java.util.List param0,
192: org.sakaiproject.time.api.TimeRange param1) {
193: org.sakaiproject.calendar.api.CalendarService service = getInstance();
194: if (service == null)
195: return null;
196:
197: return service.getEvents(param0, param1);
198: }
199:
200: public static org.sakaiproject.calendar.api.RecurrenceRule newRecurrence(
201: java.lang.String param0, int param1,
202: org.sakaiproject.time.api.Time param2) {
203: org.sakaiproject.calendar.api.CalendarService service = getInstance();
204: if (service == null)
205: return null;
206:
207: return service.newRecurrence(param0, param1, param2);
208: }
209:
210: public static org.sakaiproject.calendar.api.RecurrenceRule newRecurrence(
211: java.lang.String param0, int param1) {
212: org.sakaiproject.calendar.api.CalendarService service = getInstance();
213: if (service == null)
214: return null;
215:
216: return service.newRecurrence(param0, param1);
217: }
218:
219: public static org.sakaiproject.calendar.api.RecurrenceRule newRecurrence(
220: java.lang.String param0, int param1, int param2) {
221: org.sakaiproject.calendar.api.CalendarService service = getInstance();
222: if (service == null)
223: return null;
224:
225: return service.newRecurrence(param0, param1, param2);
226: }
227:
228: public static org.sakaiproject.calendar.api.RecurrenceRule newRecurrence(
229: java.lang.String param0) {
230: org.sakaiproject.calendar.api.CalendarService service = getInstance();
231: if (service == null)
232: return null;
233:
234: return service.newRecurrence(param0);
235: }
236:
237: public static org.sakaiproject.calendar.api.Calendar getCalendar(
238: java.lang.String param0)
239: throws org.sakaiproject.exception.IdUnusedException,
240: org.sakaiproject.exception.PermissionException {
241: org.sakaiproject.calendar.api.CalendarService service = getInstance();
242: if (service == null)
243: return null;
244:
245: return service.getCalendar(param0);
246: }
247:
248: public static java.lang.String merge(java.lang.String param0,
249: org.w3c.dom.Element param1, java.lang.String param2,
250: java.lang.String param3, java.util.Map param4,
251: java.util.HashMap param5, java.util.Set param6) {
252: org.sakaiproject.calendar.api.CalendarService service = getInstance();
253: if (service == null)
254: return null;
255:
256: return service.merge(param0, param1, param2, param3, param4,
257: param5, param6);
258: }
259:
260: public static java.lang.String getLabel() {
261: org.sakaiproject.calendar.api.CalendarService service = getInstance();
262: if (service == null)
263: return null;
264:
265: return service.getLabel();
266: }
267:
268: public static java.lang.String archive(java.lang.String param0,
269: org.w3c.dom.Document param1, java.util.Stack param2,
270: java.lang.String param3, java.util.List param4) {
271: org.sakaiproject.calendar.api.CalendarService service = getInstance();
272: if (service == null)
273: return null;
274:
275: return service.archive(param0, param1, param2, param3, param4);
276: }
277: }
|