org.sakaiproject.component.legacy.announcement
Class BaseAnnouncementService.BaseAnnouncementChannelEdit

java.lang.Object
  extended byjava.util.Observable
      extended byorg.sakaiproject.component.legacy.message.BaseMessageService.BaseMessageChannelEdit
          extended byorg.sakaiproject.component.legacy.announcement.BaseAnnouncementService.BaseAnnouncementChannelEdit
All Implemented Interfaces:
AnnouncementChannel, AnnouncementChannelEdit, Edit, Entity, EventListener, MessageChannel, MessageChannelEdit, SessionBindingListener
Enclosing class:
BaseAnnouncementService

public class BaseAnnouncementService.BaseAnnouncementChannelEdit
extends BaseMessageService.BaseMessageChannelEdit
implements AnnouncementChannelEdit

AnnouncementChannel implementation


Field Summary
 
Fields inherited from class org.sakaiproject.component.legacy.message.BaseMessageService.BaseMessageChannelEdit
m_active, m_context, m_event, m_id, m_isRemoved, m_properties
 
Fields inherited from interface org.sakaiproject.service.legacy.entity.Entity
SEPARATOR
 
Constructor Summary
BaseAnnouncementService.BaseAnnouncementChannelEdit(Element el)
          Construct from a channel (and possibly messages) already defined in XML in a DOM tree.
BaseAnnouncementService.BaseAnnouncementChannelEdit(MessageChannel other)
          Construct as a copy of another message.
BaseAnnouncementService.BaseAnnouncementChannelEdit(String ref)
          Construct with a reference.
 
Method Summary
 AnnouncementMessageEdit addAnnouncementMessage()
          A (AnnouncementMessageEdit) cover for addMessage.
 AnnouncementMessage addAnnouncementMessage(String subject, boolean draft, List attachments, String body)
          a (AnnouncementMessage) cover for addMessage to add a new message to this channel.
 AnnouncementMessageEdit editAnnouncementMessage(String messageId)
          A (AnnouncementMessageEdit) cover for editMessage.
 AnnouncementMessage getAnnouncementMessage(String messageId)
          Return a specific announcement channel message, as specified by message name.
 List getMessages(Filter filter, boolean ascending)
          Return a list of all or filtered messages in the channel.
 
Methods inherited from class org.sakaiproject.component.legacy.message.BaseMessageService.BaseMessageChannelEdit
activate, addMessage, allowAddChannelMessage, allowAddMessage, allowEditMessage, allowEditMessage, allowGetMessages, allowRemoveMessage, cancelMessage, closeEdit, commitMessage, commitMessage, editMessage, finalize, findFilterMessages, findMessage, findMessages, getContext, getEvent, getGroupsAllowAddMessage, getGroupsAllowFunction, getGroupsAllowGetMessage, getId, getMessage, getProperties, getPropertiesEdit, getReference, getReference, getUrl, getUrl, isActiveEdit, isIntersectionGroupRefsToGroups, mergeMessage, notify, removeMessage, removeMessage, setEvent, setRemoved, toXml, valueBound, valueUnbound
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.service.legacy.message.MessageChannel
addMessage, allowAddChannelMessage, allowAddMessage, allowEditMessage, allowGetMessages, allowRemoveMessage, cancelMessage, commitMessage, commitMessage, editMessage, getContext, getGroupsAllowAddMessage, getGroupsAllowGetMessage, getMessage, mergeMessage, removeMessage, removeMessage
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.Entity
getId, getProperties, getReference, getReference, getUrl, getUrl, toXml
 
Methods inherited from interface org.sakaiproject.service.legacy.entity.Edit
getPropertiesEdit, isActiveEdit
 

Constructor Detail

BaseAnnouncementService.BaseAnnouncementChannelEdit

public BaseAnnouncementService.BaseAnnouncementChannelEdit(String ref)
Construct with a reference.

Parameters:
ref - The channel reference.

BaseAnnouncementService.BaseAnnouncementChannelEdit

public BaseAnnouncementService.BaseAnnouncementChannelEdit(MessageChannel other)
Construct as a copy of another message.

Parameters:
other - The other message to copy.

BaseAnnouncementService.BaseAnnouncementChannelEdit

public BaseAnnouncementService.BaseAnnouncementChannelEdit(Element el)
Construct from a channel (and possibly messages) already defined in XML in a DOM tree. The Channel is added to storage.

Parameters:
el - The XML DOM element defining the channel.
Method Detail

getAnnouncementMessage

public AnnouncementMessage getAnnouncementMessage(String messageId)
                                           throws IdUnusedException,
                                                  PermissionException
Return a specific announcement channel message, as specified by message name.

Specified by:
getAnnouncementMessage in interface AnnouncementChannel
Parameters:
messageId - The id of the message to get.
Returns:
the AnnouncementMessage that has the specified id.
Throws:
IdUnusedException - If this name is not a defined message in this announcement channel.
PermissionException - If the user does not have any permissions to read the message.

getMessages

public List getMessages(Filter filter,
                        boolean ascending)
                 throws PermissionException
Return a list of all or filtered messages in the channel. The order in which the messages will be found in the iteration is by date, oldest first if ascending is true, newest first if ascending is false.

Specified by:
getMessages in interface MessageChannel
Overrides:
getMessages in class BaseMessageService.BaseMessageChannelEdit
Parameters:
filter - A filtering object to accept messages, or null if no filtering is desired.
ascending - Order of messages, ascending if true, descending if false
Returns:
a list on channel Message objects or specializations of Message objects (may be empty).
Throws:
PermissionException - if the user does not have read permission to the channel.

editAnnouncementMessage

public AnnouncementMessageEdit editAnnouncementMessage(String messageId)
                                                throws IdUnusedException,
                                                       PermissionException,
                                                       InUseException
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!

Specified by:
editAnnouncementMessage in interface AnnouncementChannel
Parameters:
messageId - The id of the message to get.
Returns:
the Message that has the specified id.
Throws:
IdUnusedException - If this name is not a defined message in this channel.
PermissionException - If the user does not have any permissions to read the message.
InUseException - if the current user does not have permission to mess with this user.

addAnnouncementMessage

public AnnouncementMessageEdit addAnnouncementMessage()
                                               throws PermissionException
A (AnnouncementMessageEdit) cover for addMessage. Add a new message to this channel. Must commitEdit() to make official, or cancelEdit() when done!

Specified by:
addAnnouncementMessage in interface AnnouncementChannel
Returns:
The newly added message, locked for update.
Throws:
PermissionException - If the user does not have write permission to the channel.

addAnnouncementMessage

public AnnouncementMessage addAnnouncementMessage(String subject,
                                                  boolean draft,
                                                  List attachments,
                                                  String body)
                                           throws PermissionException
a (AnnouncementMessage) cover for addMessage to add a new message to this channel.

Specified by:
addAnnouncementMessage in interface AnnouncementChannel
Parameters:
subject - The message header subject.
draft - The message header draft indication.
attachments - The message header attachments, a vector of Reference objects.
body - The message body.
Returns:
The newly added message.
Throws:
PermissionException - If the user does not have write permission to the channel.