| org.sakaiproject.message.api.MessageService
All known Subclasses: org.sakaiproject.message.impl.BaseMessageService,
MessageService | public interface MessageService extends EntityProducer(Code) | |
GenericMessageService is the base interface for the different specific Sakai communications service such as Chat, Announcements, etc.
The service manages a set of message channels, each containing a set of messages.
Channels and Messages can be worked with through the MessageChannel and Message APIs and their extensions.
|
Method Summary | |
public MessageChannelEdit | addChannel(String ref) Add a new channel. | public boolean | allowAddChannel(String ref) check permissions for addChannel().
Parameters: ref - The channel reference. | public boolean | allowEditChannel(String ref) check permissions for editChannel()
Parameters: ref - The channel reference. | public boolean | allowGetChannel(String ref) check permissions for getChannel().
Parameters: ref - The channel reference. | public boolean | allowRemoveChannel(String ref) Check permissions for removeChannel().
Parameters: ref - The channel reference. | public void | cancelChannel(MessageChannelEdit edit) Cancel the changes made to a MessageChannelEdit object, and release the lock. | public void | cancelMessage(MessageEdit edit) Cancel the changes made to a MessageEdit object, and release the lock. | public String | channelReference(String context, String id) Access the internal reference which can be used to access the channel from within the system.
Parameters: context - The context. Parameters: id - The channel id. | public void | commitChannel(MessageChannelEdit edit) Commit the changes made to a MessageChannelEdit object, and release the lock. | public MessageChannelEdit | editChannel(String ref) Return a specific channel, as specified by channel id, locked for update. | public MessageChannel | getChannel(String ref) Return a specific channel.
Parameters: ref - The channel reference. | public List | getChannelIds(String context) Access a list of channel ids that are defined related to the context. | public List | getChannels() Return a list of all the defined channels. | public Message | getMessage(Reference ref) Get a message, given a reference. | public List | getMessages(String channelRef, Time afterDate, int limitedToLatest, boolean ascending, boolean includeDrafts, boolean pubViewOnly) Access a list of messages in the channel, that are after the date, limited to just the n latest messages, ordered as specified, including drafts if specified. | public Map | getSummary(String ref, int items, int days) | public String | messageReference(String context, String channelId, String id) Access the internal reference which can be used to access the message from within the system.
Parameters: context - The context. Parameters: channelId - The channel id. Parameters: id - The message id. | public String | messageReference(String channelRef, String id) Access the internal reference which can be used to access the message from within the system.
Parameters: channelRef - The channel reference. Parameters: id - The message id. | public void | removeChannel(MessageChannelEdit channel) Remove a channel - it must be locked from editChannel(). |
REF_TYPE_CHANNEL | final public static String REF_TYPE_CHANNEL(Code) | | The Reference type for a channel.
|
REF_TYPE_MESSAGE | final public static String REF_TYPE_MESSAGE(Code) | | The Reference type for a messgae.
|
SECURE_ADD | final public static String SECURE_ADD(Code) | | Security function / event for adding channel / message.
|
SECURE_ALL_GROUPS | final public static String SECURE_ALL_GROUPS(Code) | | Security function giving the user permission to all groups, if granted to at the channel or site level.
|
SECURE_READ | final public static String SECURE_READ(Code) | | Security function / event for reading channel / message.
|
SECURE_READ_DRAFT | final public static String SECURE_READ_DRAFT(Code) | | Security function / event for accessing someone elses draft.
|
SECURE_REMOVE_ANY | final public static String SECURE_REMOVE_ANY(Code) | | Security function / event for removing anyone's message or channel.
|
SECURE_REMOVE_OWN | final public static String SECURE_REMOVE_OWN(Code) | | Security function / event for removing one's own message.
|
SECURE_UPDATE_ANY | final public static String SECURE_UPDATE_ANY(Code) | | Security function / event for updating any message.
|
SECURE_UPDATE_OWN | final public static String SECURE_UPDATE_OWN(Code) | | Security function / event for updating one's own message or the channel.
|
allowAddChannel | public boolean allowAddChannel(String ref)(Code) | | check permissions for addChannel().
Parameters: ref - The channel reference. true if the user is allowed to addChannel(channelId), false if not. |
allowEditChannel | public boolean allowEditChannel(String ref)(Code) | | check permissions for editChannel()
Parameters: ref - The channel reference. true if the user is allowed to update the channel, false if not. |
allowGetChannel | public boolean allowGetChannel(String ref)(Code) | | check permissions for getChannel().
Parameters: ref - The channel reference. true if the user is allowed to getChannel(channelId), false if not. |
allowRemoveChannel | public boolean allowRemoveChannel(String ref)(Code) | | Check permissions for removeChannel().
Parameters: ref - The channel reference. true if the user is allowed to removeChannel(), false if not. |
cancelChannel | public void cancelChannel(MessageChannelEdit edit)(Code) | | Cancel the changes made to a MessageChannelEdit object, and release the lock. The MessageChannelEdit is disabled, and not to be used after this call.
Parameters: user - The MessageChannelEdit object to cancel. |
cancelMessage | public void cancelMessage(MessageEdit edit)(Code) | | Cancel the changes made to a MessageEdit object, and release the lock. The MessageEdit is disabled, and not to be used after this call.
Parameters: user - The MessageEdit object to cancel. |
channelReference | public String channelReference(String context, String id)(Code) | | Access the internal reference which can be used to access the channel from within the system.
Parameters: context - The context. Parameters: id - The channel id. The the internal reference which can be used to access the channel from within the system. |
commitChannel | public void commitChannel(MessageChannelEdit edit)(Code) | | Commit the changes made to a MessageChannelEdit object, and release the lock. The MessageChannelEdit is disabled, and not to be used after this call.
Parameters: user - The MessageChannelEdit object to commit. |
getChannelIds | public List getChannelIds(String context)(Code) | | Access a list of channel ids that are defined related to the context.
Parameters: context - The context in which to search A List (String) of channel id for channels withing the context. |
getChannels | public List getChannels()(Code) | | Return a list of all the defined channels.
a list of MessageChannel (or extension) objects (may be empty). |
getMessages | public List getMessages(String channelRef, Time afterDate, int limitedToLatest, boolean ascending, boolean includeDrafts, boolean pubViewOnly) throws PermissionException(Code) | | Access a list of messages in the channel, that are after the date, limited to just the n latest messages, ordered as specified, including drafts if specified. Channel read permission is required, unless pubViewOnly is selected - draft read on the
channel is required to see drafts.
Parameters: afterDate - if null, no date limit, else limited to only messages after this date. Parameters: limitedToLatest - if 0, no count limit, else limited to only the latest this number of messages. Parameters: ascending - if true, sort oldest first, else sort latest first. Parameters: includeDrafts - if true, include drafts (if the user has draft permission), else leave them out. Parameters: pubViewOnly - if true, include only messages marked pubview, else include any. A list of Message objects that meet the criteria; may be empty exception: PermissionException - If the current user does not have channel read permission. |
messageReference | public String messageReference(String context, String channelId, String id)(Code) | | Access the internal reference which can be used to access the message from within the system.
Parameters: context - The context. Parameters: channelId - The channel id. Parameters: id - The message id. The the internal reference which can be used to access the message from within the system. |
messageReference | public String messageReference(String channelRef, String id)(Code) | | Access the internal reference which can be used to access the message from within the system.
Parameters: channelRef - The channel reference. Parameters: id - The message id. The the internal reference which can be used to access the message from within the system. |
|
|