org.sakaiproject.component.legacy.email
Class BaseMailArchiveService.BaseMailArchiveChannelEdit

java.lang.Object
  extended byjava.util.Observable
      extended byorg.sakaiproject.component.legacy.message.BaseMessageService.BaseMessageChannelEdit
          extended byorg.sakaiproject.component.legacy.email.BaseMailArchiveService.BaseMailArchiveChannelEdit
All Implemented Interfaces:
Edit, Entity, EventListener, MailArchiveChannel, MailArchiveChannelEdit, MessageChannel, MessageChannelEdit, SessionBindingListener
Enclosing class:
BaseMailArchiveService

public class BaseMailArchiveService.BaseMailArchiveChannelEdit
extends BaseMessageService.BaseMessageChannelEdit
implements MailArchiveChannelEdit

MailArchiveChannel 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
BaseMailArchiveService.BaseMailArchiveChannelEdit(Element el)
          Construct from a channel (and possibly messages) already defined in XML in a DOM tree.
BaseMailArchiveService.BaseMailArchiveChannelEdit(MessageChannel other)
          Construct as a copy of another message.
BaseMailArchiveService.BaseMailArchiveChannelEdit(String ref)
          Construct with an id.
 
Method Summary
 MailArchiveMessageEdit addMailArchiveMessage()
          A (MailArchiveMessageEdit) cover for addMessage.
 MailArchiveMessage addMailArchiveMessage(String subject, String fromAddress, Time dateSent, List mailHeaders, List attachments, String body)
          a (MailArchiveMessage) cover for addMessage to add a new message to this channel.
 boolean allowAddMessage(User user)
          check permissions for addMessage() for the given user.
 MailArchiveMessageEdit editMailArchiveMessage(String messageId)
          A (MailArchiveMessageEdit) cover for editMessage.
 boolean getEnabled()
           
 MailArchiveMessage getMailArchiveMessage(String messageId)
          Return a specific mail message channel message, as specified by message name.
 boolean getOpen()
           
 void setEnabled(boolean setting)
          Set the enabled status of the channe.
 void setOpen(boolean setting)
          Set the open status of the channe.
 
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

BaseMailArchiveService.BaseMailArchiveChannelEdit

public BaseMailArchiveService.BaseMailArchiveChannelEdit(String ref)
Construct with an id.

Parameters:
ref - The channel reference.

BaseMailArchiveService.BaseMailArchiveChannelEdit

public BaseMailArchiveService.BaseMailArchiveChannelEdit(MessageChannel other)
Construct as a copy of another message.

Parameters:
other - The other message to copy.

BaseMailArchiveService.BaseMailArchiveChannelEdit

public BaseMailArchiveService.BaseMailArchiveChannelEdit(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

getMailArchiveMessage

public MailArchiveMessage getMailArchiveMessage(String messageId)
                                         throws IdUnusedException,
                                                PermissionException
Return a specific mail message channel message, as specified by message name.

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

editMailArchiveMessage

public MailArchiveMessageEdit editMailArchiveMessage(String messageId)
                                              throws IdUnusedException,
                                                     PermissionException,
                                                     InUseException
A (MailArchiveMessageEdit) 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!

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.

addMailArchiveMessage

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

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

addMailArchiveMessage

public MailArchiveMessage addMailArchiveMessage(String subject,
                                                String fromAddress,
                                                Time dateSent,
                                                List mailHeaders,
                                                List attachments,
                                                String body)
                                         throws PermissionException
a (MailArchiveMessage) cover for addMessage to add a new message to this channel.

Specified by:
addMailArchiveMessage in interface MailArchiveChannel
Parameters:
subject - The message header subject.
fromAddress - The mail from: address from the message.
dateSent - The date: sent from the message.
mailHeaders - The full set of mail headers from the message.
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.

getEnabled

public boolean getEnabled()
Specified by:
getEnabled in interface MailArchiveChannel
Returns:
true if the channel enabled, false if not.

getOpen

public boolean getOpen()
Specified by:
getOpen in interface MailArchiveChannel
Returns:
true if the channel is open to messages from outside the membership, false if not.

setEnabled

public void setEnabled(boolean setting)
Set the enabled status of the channe. Disabled channels will not recieve email.

Specified by:
setEnabled in interface MailArchiveChannelEdit
Parameters:
setting - The new setting.

setOpen

public void setOpen(boolean setting)
Set the open status of the channe. Open channels will recieve email from anyone - otherwise messages will be accepted only from users (based on the main from email address) with add permission.

Specified by:
setOpen in interface MailArchiveChannelEdit
Parameters:
setting - The new setting.

allowAddMessage

public boolean allowAddMessage(User user)
check permissions for addMessage() for the given user.

Specified by:
allowAddMessage in interface MailArchiveChannel
Parameters:
user - The user.
Returns:
true if the specified user is allowed to addMessage(...), false if not.