001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/announcement/tags/sakai_2-4-1/announcement-api/api/src/java/org/sakaiproject/announcement/cover/AnnouncementService.java $
003: * $Id: AnnouncementService.java 22562 2007-03-13 19:52:22Z josrodri@iupui.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.announcement.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * AnnouncementService is a static Cover for the {@link org.sakaiproject.announcement.api.AnnouncementService AnnouncementService}; see that interface for usage details.
027: * </p>
028: *
029: * @author University of Michigan, Sakai Software Development Team
030: * @version $Revision: 22562 $
031: */
032: public class AnnouncementService {
033: /**
034: * Access the component instance: special cover only method.
035: *
036: * @return the component instance.
037: */
038: public static org.sakaiproject.announcement.api.AnnouncementService getInstance() {
039: if (ComponentManager.CACHE_COMPONENTS) {
040: if (m_instance == null)
041: m_instance = (org.sakaiproject.announcement.api.AnnouncementService) ComponentManager
042: .get(org.sakaiproject.announcement.api.AnnouncementService.class);
043: return m_instance;
044: } else {
045: return (org.sakaiproject.announcement.api.AnnouncementService) ComponentManager
046: .get(org.sakaiproject.announcement.api.AnnouncementService.class);
047: }
048: }
049:
050: private static org.sakaiproject.announcement.api.AnnouncementService m_instance = null;
051:
052: public static java.lang.String APPLICATION_ID = org.sakaiproject.announcement.api.AnnouncementService.APPLICATION_ID;
053:
054: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.announcement.api.AnnouncementService.REFERENCE_ROOT;
055:
056: public static java.lang.String SECURE_ANNC_ROOT = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_ROOT;
057:
058: public static java.lang.String SECURE_ANNC_READ = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_READ;
059:
060: public static java.lang.String SECURE_ANNC_ADD = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_ADD;
061:
062: public static java.lang.String SECURE_ANNC_REMOVE_OWN = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_REMOVE_OWN;
063:
064: public static java.lang.String SECURE_ANNC_REMOVE_ANY = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_REMOVE_ANY;
065:
066: public static java.lang.String SECURE_ANNC_UPDATE_OWN = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_UPDATE_OWN;
067:
068: public static java.lang.String SECURE_ANNC_UPDATE_ANY = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_UPDATE_ANY;
069:
070: public static java.lang.String SECURE_ANNC_READ_DRAFT = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ANNC_READ_DRAFT;
071:
072: public static java.lang.String SECURE_READ = org.sakaiproject.announcement.api.AnnouncementService.SECURE_READ;
073:
074: public static java.lang.String SECURE_ADD = org.sakaiproject.announcement.api.AnnouncementService.SECURE_ADD;
075:
076: public static java.lang.String SECURE_REMOVE_OWN = org.sakaiproject.announcement.api.AnnouncementService.SECURE_REMOVE_OWN;
077:
078: public static java.lang.String SECURE_REMOVE_ANY = org.sakaiproject.announcement.api.AnnouncementService.SECURE_REMOVE_ANY;
079:
080: public static java.lang.String SECURE_UPDATE_OWN = org.sakaiproject.announcement.api.AnnouncementService.SECURE_UPDATE_OWN;
081:
082: public static java.lang.String SECURE_UPDATE_ANY = org.sakaiproject.announcement.api.AnnouncementService.SECURE_UPDATE_ANY;
083:
084: public static java.lang.String SECURE_READ_DRAFT = org.sakaiproject.announcement.api.AnnouncementService.SECURE_READ_DRAFT;
085:
086: public static java.lang.String REF_TYPE_CHANNEL = org.sakaiproject.announcement.api.AnnouncementService.REF_TYPE_CHANNEL;
087:
088: public static java.lang.String REF_TYPE_MESSAGE = org.sakaiproject.announcement.api.AnnouncementService.REF_TYPE_MESSAGE;
089:
090: public static org.sakaiproject.announcement.api.AnnouncementChannel getAnnouncementChannel(
091: java.lang.String param0)
092: throws org.sakaiproject.exception.IdUnusedException,
093: org.sakaiproject.exception.PermissionException {
094: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
095: if (service == null)
096: return null;
097:
098: return service.getAnnouncementChannel(param0);
099: }
100:
101: public static org.sakaiproject.announcement.api.AnnouncementChannelEdit addAnnouncementChannel(
102: java.lang.String param0)
103: throws org.sakaiproject.exception.IdUsedException,
104: org.sakaiproject.exception.IdInvalidException,
105: org.sakaiproject.exception.PermissionException {
106: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
107: if (service == null)
108: return null;
109:
110: return service.addAnnouncementChannel(param0);
111: }
112:
113: public static java.util.List getChannels() {
114: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
115: if (service == null)
116: return null;
117:
118: return service.getChannels();
119: }
120:
121: public static boolean allowGetChannel(java.lang.String param0) {
122: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
123: if (service == null)
124: return false;
125:
126: return service.allowGetChannel(param0);
127: }
128:
129: public static boolean allowAddChannel(java.lang.String param0) {
130: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
131: if (service == null)
132: return false;
133:
134: return service.allowAddChannel(param0);
135: }
136:
137: public static org.sakaiproject.message.api.MessageChannelEdit addChannel(
138: java.lang.String param0)
139: throws org.sakaiproject.exception.IdUsedException,
140: org.sakaiproject.exception.IdInvalidException,
141: org.sakaiproject.exception.PermissionException {
142: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
143: if (service == null)
144: return null;
145:
146: return service.addChannel(param0);
147: }
148:
149: public static boolean allowEditChannel(java.lang.String param0) {
150: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
151: if (service == null)
152: return false;
153:
154: return service.allowEditChannel(param0);
155: }
156:
157: public static org.sakaiproject.message.api.MessageChannelEdit editChannel(
158: java.lang.String param0)
159: throws org.sakaiproject.exception.IdUnusedException,
160: org.sakaiproject.exception.PermissionException,
161: org.sakaiproject.exception.InUseException {
162: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
163: if (service == null)
164: return null;
165:
166: return service.editChannel(param0);
167: }
168:
169: public static void commitChannel(
170: org.sakaiproject.message.api.MessageChannelEdit param0) {
171: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
172: if (service == null)
173: return;
174:
175: service.commitChannel(param0);
176: }
177:
178: public static void cancelChannel(
179: org.sakaiproject.message.api.MessageChannelEdit param0) {
180: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
181: if (service == null)
182: return;
183:
184: service.cancelChannel(param0);
185: }
186:
187: public static boolean allowRemoveChannel(java.lang.String param0) {
188: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
189: if (service == null)
190: return false;
191:
192: return service.allowRemoveChannel(param0);
193: }
194:
195: public static void removeChannel(
196: org.sakaiproject.message.api.MessageChannelEdit param0)
197: throws org.sakaiproject.exception.PermissionException {
198: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
199: if (service == null)
200: return;
201:
202: service.removeChannel(param0);
203: }
204:
205: public static java.lang.String channelReference(
206: java.lang.String param0, java.lang.String param1) {
207: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
208: if (service == null)
209: return null;
210:
211: return service.channelReference(param0, param1);
212: }
213:
214: public static java.lang.String messageReference(
215: java.lang.String param0, java.lang.String param1,
216: java.lang.String param2) {
217: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
218: if (service == null)
219: return null;
220:
221: return service.messageReference(param0, param1, param2);
222: }
223:
224: public static java.lang.String messageReference(
225: java.lang.String param0, java.lang.String param1) {
226: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
227: if (service == null)
228: return null;
229:
230: return service.messageReference(param0, param1);
231: }
232:
233: public static void cancelMessage(
234: org.sakaiproject.message.api.MessageEdit param0) {
235: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
236: if (service == null)
237: return;
238:
239: service.cancelMessage(param0);
240: }
241:
242: public static java.util.List getMessages(java.lang.String param0,
243: org.sakaiproject.time.api.Time param1, int param2,
244: boolean param3, boolean param4, boolean param5)
245: throws org.sakaiproject.exception.PermissionException {
246: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
247: if (service == null)
248: return null;
249:
250: return service.getMessages(param0, param1, param2, param3,
251: param4, param5);
252: }
253:
254: public static java.util.List getChannelIds(java.lang.String param0) {
255: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
256: if (service == null)
257: return null;
258:
259: return service.getChannelIds(param0);
260: }
261:
262: public static org.sakaiproject.message.api.Message getMessage(
263: org.sakaiproject.entity.api.Reference param0)
264: throws org.sakaiproject.exception.IdUnusedException,
265: org.sakaiproject.exception.PermissionException {
266: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
267: if (service == null)
268: return null;
269:
270: return service.getMessage(param0);
271: }
272:
273: public static org.sakaiproject.message.api.MessageChannel getChannel(
274: java.lang.String param0)
275: throws org.sakaiproject.exception.IdUnusedException,
276: org.sakaiproject.exception.PermissionException {
277: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
278: if (service == null)
279: return null;
280:
281: return service.getChannel(param0);
282: }
283:
284: public static java.lang.String merge(java.lang.String param0,
285: org.w3c.dom.Element param1, java.lang.String param2,
286: java.lang.String param3, java.util.Map param4,
287: java.util.HashMap param5, java.util.Set param6) {
288: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
289: if (service == null)
290: return null;
291:
292: return service.merge(param0, param1, param2, param3, param4,
293: param5, param6);
294: }
295:
296: public static java.lang.String getLabel() {
297: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
298: if (service == null)
299: return null;
300:
301: return service.getLabel();
302: }
303:
304: public static java.lang.String archive(java.lang.String param0,
305: org.w3c.dom.Document param1, java.util.Stack param2,
306: java.lang.String param3, java.util.List param4) {
307: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
308: if (service == null)
309: return null;
310:
311: return service.archive(param0, param1, param2, param3, param4);
312: }
313:
314: public static java.util.Map getSummary(java.lang.String param0,
315: int param1, int param2)
316: throws org.sakaiproject.exception.IdUsedException,
317: org.sakaiproject.exception.IdInvalidException,
318: org.sakaiproject.exception.PermissionException {
319: org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
320: if (service == null)
321: return null;
322:
323: return service.getSummary(param0, param1, param2);
324: }
325: }
|