01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/announcement/tags/sakai_2-4-1/announcement-api/api/src/java/org/sakaiproject/announcement/api/AnnouncementChannel.java $
03: * $Id: AnnouncementChannel.java 8167 2006-04-22 23:55:59Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.announcement.api;
21:
22: import java.util.List;
23:
24: import org.sakaiproject.exception.IdUnusedException;
25: import org.sakaiproject.exception.InUseException;
26: import org.sakaiproject.exception.PermissionException;
27: import org.sakaiproject.message.api.MessageChannel;
28:
29: /**
30: * <p>
31: * AnnouncementChannel is the extension to the MessageChanel interface for a Sakai Announcement service announcement channel.
32: * </p>
33: */
34: public interface AnnouncementChannel extends MessageChannel {
35: /**
36: * A (AnnouncementMessage) cover for getMessage to return a specific announcement channel message, as specified by message id.
37: *
38: * @param messageId
39: * The id of the message to get.
40: * @return the AnnouncementMessage that has the specified id.
41: * @exception IdUnusedException
42: * If this name is not a defined message in this announcement channel.
43: * @exception PermissionException
44: * If the user does not have any permissions to read the message.
45: */
46: public AnnouncementMessage getAnnouncementMessage(String messageId)
47: throws IdUnusedException, PermissionException;
48:
49: /**
50: * A (AnnouncementMessageEdit) cover for editMessage. Return a specific channel message, as specified by message name, locked for update. Must commitEdit() to make official, or cancelEdit() when done!
51: *
52: * @param messageId
53: * The id of the message to get.
54: * @return the Message that has the specified id.
55: * @exception IdUnusedException
56: * If this name is not a defined message in this channel.
57: * @exception PermissionException
58: * If the user does not have any permissions to read the message.
59: * @exception InUseException
60: * if the current user does not have permission to mess with this user.
61: */
62: public AnnouncementMessageEdit editAnnouncementMessage(
63: String messageId) throws IdUnusedException,
64: PermissionException, InUseException;
65:
66: /**
67: * a (AnnouncementMessage) cover for addMessage to add a new message to this channel. Must commitEdit() to make official, or cancelEdit() when done!
68: *
69: * @return The newly added message, locked for update.
70: * @exception PermissionException
71: * If the user does not have write permission to the channel.
72: */
73: public AnnouncementMessageEdit addAnnouncementMessage()
74: throws PermissionException;
75:
76: /**
77: * a (AnnouncementMessage) cover for addMessage to add a new message to this channel.
78: *
79: * @param subject
80: * The message header subject.
81: * @param draft
82: * The message header draft indication.
83: * @param attachments
84: * The message header attachments, a vector of Reference objects.
85: * @param body
86: * The message body.
87: * @return The newly added message.
88: * @exception PermissionException
89: * If the user does not have write permission to the channel.
90: */
91: public AnnouncementMessage addAnnouncementMessage(String subject,
92: boolean draft, List attachments, String body)
93: throws PermissionException;
94: }
|