org.sakaiproject.component.legacy.chat
Class BaseChatService.BaseChatChannelEdit

java.lang.Object
  extended byjava.util.Observable
      extended byorg.sakaiproject.component.legacy.message.BaseMessageService.BaseMessageChannelEdit
          extended byorg.sakaiproject.component.legacy.chat.BaseChatService.BaseChatChannelEdit
All Implemented Interfaces:
ChatChannel, ChatChannelEdit, Edit, Entity, EventListener, MessageChannel, MessageChannelEdit, SessionBindingListener
Enclosing class:
BaseChatService

public class BaseChatService.BaseChatChannelEdit
extends BaseMessageService.BaseMessageChannelEdit
implements ChatChannelEdit

ChatChannel 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
BaseChatService.BaseChatChannelEdit(Element el)
          Construct from a channel (and possibly messages) already defined in XML in a DOM tree.
BaseChatService.BaseChatChannelEdit(MessageChannel other)
          Construct as a copy of another message.
BaseChatService.BaseChatChannelEdit(String ref)
          Construct with a reference.
 
Method Summary
 ChatMessageEdit addChatMessage()
          A (ChatMessageEdit) cover for addMessage.
 ChatMessage addChatMessage(List attachments, String body)
          a (ChatMessage) cover for addMessage to add a new message to this channel.
 ChatMessageEdit editChatMessage(String messageId)
          A (ChatMessageEdit) cover for editMessage.
 ChatMessage getChatMessage(String messageId)
          Return a specific chat channel message, as specified by message name.
 
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, getMessages, 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, getMessages, 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

BaseChatService.BaseChatChannelEdit

public BaseChatService.BaseChatChannelEdit(String ref)
Construct with a reference.

Parameters:
ref - The channel reference.

BaseChatService.BaseChatChannelEdit

public BaseChatService.BaseChatChannelEdit(MessageChannel other)
Construct as a copy of another message.

Parameters:
other - The other message to copy.

BaseChatService.BaseChatChannelEdit

public BaseChatService.BaseChatChannelEdit(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

getChatMessage

public ChatMessage getChatMessage(String messageId)
                           throws IdUnusedException,
                                  PermissionException
Return a specific chat channel message, as specified by message name.

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

editChatMessage

public ChatMessageEdit editChatMessage(String messageId)
                                throws IdUnusedException,
                                       PermissionException,
                                       InUseException
A (ChatMessageEdit) 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:
editChatMessage in interface ChatChannel
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.

addChatMessage

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

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

addChatMessage

public ChatMessage addChatMessage(List attachments,
                                  String body)
                           throws PermissionException
a (ChatMessage) cover for addMessage to add a new message to this channel.

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