sendMessage : function(to, meData, subject, body, category, reply, callback, sendMail, context, optionalParams) {
Sends a Sakai message to one or more users. If a group id is received, the message is sent to users that are members of that group.
param {Array|String} to Array with the ids of the users or groups to post a message to or a String with one user or group id.
param {String} meData Who the message is from - sakai.data.me (or equivolent profile)
param {String} subject The subject for this message
param {String} body The text that this message will contain
param {String} [category='message'] The category for this message
param {String} [reply] The id of the message you are replying on
param {Function} [callback] A callback function which is executed at the end of the operation
param {Boolean} [sendMail] True if a mail needs to be sent, False if no mail is needed. Unles specified false the default will be true and a mail will be sent
param {Boolean|String} [context] String used in switch to set sakai:templatePath and sakai:templateParams
param {Object} [optionalParams] Passed in when out of the group context to provide data necessary to send the message (Ids, titles) that can't be retrieved from the global object
var addRecipient = function(userids) {
Adds the given userids (String or Array) to the current list of recipients
param {Array|String} userids Either a single userid (String) or a list of userids (Array) to be added to the current list of recipients
return None
processMessages : function(results) {
Processes the messages from the server, stripping out everything we don't need
getAllMessages : function(box, category, search, messagesPerPage, currentPage, sortBy, sortOrder, callback, doProcessing, doFlip) {
Gets all messages from a box
param {String} box The name of the box to get messages from
param {String} category The type of messages to get from the box
param {Number} messagesPerPage The number of messages to fetch
param {Number} currentPage The page offset to start from
param {String} sortBy The name of the field to sort on
param {String} sortOrder Sort messages asc or desc
param {Function} callback The function that will be called on completion
param {Boolean} doProcessing process the messages after they come back to make them easier to deal with defaults to true
param {Boolean} doFlip Flip the to and from
getMessage : function(id, box, meData, callback) {
Retrieve a message based on its box and its id. This function will also include the user that has sent the message
param {String} id Unique id of the message
param {String} box Message box the message lives in. The possible options are inbox, outbox and trash
param {Object} meData Me object
param {Function} callback Function to call once the message has been retrieved
getUnreadMessagesCountOverview : function(box, callback, ignoreCache) {
Gets a count of the unread messages for each box belonging to the current user
getUnreadMessageCount : function(box, callback, category) {
Gets a count of the unread messages in a box belonging to the current user
sendMessageToGroup : function(groupID, message) {
Sends a message to all members of a group
param {String} groupID The user ID of the recipient
param {String} message The text of the message
return {Boolean} true or false depending on whether the sending was successful or not
},
SAKIII-599: Unable to currently send a message via: - /~userid/message.create.html or - /~groupid/message.create.html Until backend support is available, sakai.api.Communication.sendMessage has been modified to support groupids. Any groupids included in the 'to' list argument will be expanded and messages sent to those users. Once backend support to message a group directly is available, it will be important to complete this function to support posting messages to group pages directly and to track messages sent to groups as opposed to individual users (i.e. Message sent to: 'user1, user2, group5' instead of Message sent to: 'user1, user2, [list of users in group5]')
inviteUser : function(userID) {
Invites a user to become a contact of the logged in user
param {String} groupID The user ID of the recipient
param {String} message The text of the message
return {Boolean} true or false depending on whether the sending was successful or not