public class ChatTool extends Object implements org.sakaiproject.chat2.model.RoomObserver, org.sakaiproject.chat2.model.PresenceObserver
| Modifier and Type | Field and Description |
|---|---|
protected org.sakaiproject.courier.api.CourierService |
m_courierService
Constructor discovered injected CourierService.
|
| Constructor and Description |
|---|
ChatTool() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
countChannelMessages(org.sakaiproject.chat2.model.ChatChannel channel) |
SelectItem |
createSelect(Object id,
String description) |
String |
getAccessibleOptionsLink() |
protected String |
getAllMessagesText() |
boolean |
getCanCreateChannel() |
boolean |
getCanEditChannel(org.sakaiproject.chat2.model.ChatChannel channel) |
boolean |
getCanManageTool()
Check for add/edit/del perms on the channel
|
boolean |
getCanPost() |
boolean |
getCanRead(org.sakaiproject.chat2.model.ChatChannel channel) |
boolean |
getCanRemoveChannel(org.sakaiproject.chat2.model.ChatChannel channel) |
boolean |
getCanRemoveChannelMessages(org.sakaiproject.chat2.model.ChatChannel channel) |
boolean |
getCanRemoveMessage(org.sakaiproject.chat2.model.ChatMessage message) |
boolean |
getCanRenderAllMessages() |
boolean |
getCanRenderDateMessages() |
boolean |
getCanRenderMessageOptions()
Determins if the message option display dropdown gets rendered or not
|
boolean |
getCanRenderNoMessages() |
boolean |
getCanRenderNumberMessages() |
List<DecoratedChatChannel> |
getChatChannels()
gets the tool decorated channels
|
String |
getChatFunctionPrefix() |
org.sakaiproject.chat2.model.ChatManager |
getChatManager()
gets the chatManager
|
List<SelectItem> |
getChatRoomsSelectItems()
This creates select items out of the channels available to the tool
|
ColorMapper |
getColorMapper() |
protected String |
getContext()
Gets the id of the site we are in
|
String |
getCourierString()
This allows us to change/give the courier address.
|
DecoratedChatChannel |
getCurrentChannel()
gets the current channel
|
DecoratedChatChannel |
getCurrentChannelEdit() |
String |
getCurrentChatChannelId()
gets the channel id of the current channel.
|
DecoratedChatMessage |
getCurrentMessage() |
DecoratedSynopticOptions |
getCurrentSynopticOptions() |
protected String |
getCustomOptionText(String filterType,
int filterParam) |
protected String |
getCustomOptionValue(String filterType) |
String |
getDatesMessage() |
boolean |
getDisplayDate() |
boolean |
getDisplayId() |
boolean |
getDisplayTime() |
String |
getEnterTool()
This is called from the first page to redirect the user to the proper view.
|
String |
getFramePlacementId()
Returns the frame identifier for resizing
|
boolean |
getMaintainer() |
String |
getMessageFromBundle(String key) |
String |
getMessageFromBundle(String key,
Object[] args) |
String |
getMessageOptions() |
List<SelectItem> |
getMessageOptionsList() |
String |
getMessageOwnerDisplayName(org.sakaiproject.chat2.model.ChatMessage message) |
protected List<DecoratedChatMessage> |
getMessages(String context,
Date limitDate,
int numMessages,
boolean sortAsc) |
protected int |
getMessagesCount(String context,
Date limitDate) |
String |
getMessagesShownTotalText() |
String |
getNewMessageText() |
protected String |
getNoMessagesText() |
protected String |
getPastXDaysText(int x) |
protected String |
getPastXMessagesText(int x) |
String |
getPermissionsMessage() |
List<DecoratedChatMessage> |
getRoomMessages() |
int |
getRoomMessagesCount()
Finds the current messages count for the current room
|
String |
getServerUrl() |
String |
getSessionId() |
int |
getSiteChannelCount()
gets the number of channels in this site
|
protected List<org.sakaiproject.chat2.model.ChatChannel> |
getSiteChannels()
gets the channels in this site
|
boolean |
getSoundAlert() |
List<DecoratedChatMessage> |
getSynopticMessages() |
String |
getToolContext() |
org.sakaiproject.tool.api.ToolManager |
getToolManager() |
String |
getToolString()
Gets the id of the tool we are in
|
String |
getToolTitle() |
List<String> |
getUsersInCurrentChannel()
this gets the users in a channel.
|
String |
getViewingChatRoomText() |
String |
getViewOptions() |
org.sakaiproject.site.api.Site |
getWorksite() |
protected int |
initMessageOptions() |
boolean |
isDatesRestricted() |
DecoratedSynopticOptions |
lookupSynopticOptions() |
String |
processActionAddRoom() |
String |
processActionBackToRoom() |
String |
processActionCancelChangeChannel()
When the user wants to cancel changing a room
|
String |
processActionDeleteMessage()
Deletes the current message
|
String |
processActionDeleteMessageCancel()
Cancels the delete of the current message
|
protected String |
processActionDeleteMessageConfirm(DecoratedChatMessage message)
Deletes the specified message
|
String |
processActionDeleteRoom()
deletes the current room and all it's messages
|
String |
processActionDeleteRoomCancel()
cancels the deletion of a room via the confirmation
|
protected String |
processActionDeleteRoomConfirm(DecoratedChatChannel chatChannel)
Sets the current room and goes to confirm deleting the room
|
String |
processActionDeleteRoomMessages()
deletes the current room's messages
|
String |
processActionDeleteRoomMessagesCancel()
cancels the deletion of a room's messages via the confirmation
|
protected String |
processActionDeleteRoomMessagesConfirm(DecoratedChatChannel chatChannel)
Sets the current room and goes to confirm deleting the room's messages
|
protected String |
processActionEditRoom(DecoratedChatChannel chatChannel)
Sets the current room and goes to edit that room
|
String |
processActionEditRoomCancel()
Sets the current room to null
|
String |
processActionEditRoomSave()
Sets the current room to null
|
protected String |
processActionEnterRoom(DecoratedChatChannel chatChannel)
Sets the current room and goes to the room page
|
String |
processActionListRooms() |
String |
processActionPermissions() |
String |
processActionSetAsDefaultRoom(DecoratedChatChannel decoChannel) |
String |
processActionSynopticOptions() |
String |
processActionSynopticOptionsCancel() |
String |
processActionSynopticOptionsSave() |
void |
receivedMessage(String roomId,
Object message)
in the context of the event manager thread
|
protected void |
resetCurrentChannel(DecoratedChatChannel oldChannel) |
void |
roomDeleted(String roomId) |
void |
setChatManager(org.sakaiproject.chat2.model.ChatManager chatManager)
Sets the chatManager
|
void |
setColorMapper(ColorMapper colorMapper) |
void |
setCurrentChannel(DecoratedChatChannel channel)
Implements a change of the chat room.
|
void |
setCurrentChannelEdit(DecoratedChatChannel currentChannelEdit) |
void |
setCurrentChatChannelId(String channelId) |
void |
setCurrentMessage(DecoratedChatMessage currentMessage) |
void |
setCurrentSynopticOptions(DecoratedSynopticOptions currentSynopticOptions) |
void |
setMessageOptions(String messageOptions) |
void |
setNewMessageText(String newMessageText) |
void |
setToolContext(String toolContext) |
void |
setToolManager(org.sakaiproject.tool.api.ToolManager toolManager) |
protected void |
setupTool() |
void |
setViewOptions(String d) |
void |
userJoined(String location,
String user) |
void |
userLeft(String location,
String user)
In addition to refreshing the list, this code takes care of
removing instances associated with processes that are now dead.
|
protected boolean |
validateChannel(org.sakaiproject.chat2.model.ChatChannel channel)
Make sure that the channel has a title when saving, the title isn't
too long, and the description isn't too long
|
void |
validatePositiveNumber(FacesContext context,
UIComponent component,
Object value) |
protected org.sakaiproject.courier.api.CourierService m_courierService
protected void setupTool()
public String getEnterTool()
public List<String> getUsersInCurrentChannel()
public void receivedMessage(String roomId, Object message)
receivedMessage in interface org.sakaiproject.chat2.model.RoomObserverpublic void roomDeleted(String roomId)
roomDeleted in interface org.sakaiproject.chat2.model.RoomObserverpublic void userJoined(String location, String user)
userJoined in interface org.sakaiproject.chat2.model.PresenceObserverpublic void userLeft(String location, String user)
userLeft in interface org.sakaiproject.chat2.model.PresenceObserverprotected boolean validateChannel(org.sakaiproject.chat2.model.ChatChannel channel)
channel - public String processActionCancelChangeChannel()
public String processActionSetAsDefaultRoom(DecoratedChatChannel decoChannel)
public String processActionAddRoom()
public String processActionPermissions()
public String processActionSynopticOptions()
public String processActionSynopticOptionsSave()
public String processActionSynopticOptionsCancel()
public String processActionBackToRoom()
public String getChatFunctionPrefix()
public String getPermissionsMessage()
public String getDatesMessage()
public boolean isDatesRestricted()
public org.sakaiproject.site.api.Site getWorksite()
protected String processActionEnterRoom(DecoratedChatChannel chatChannel)
chatChannel - public String processActionListRooms()
protected String processActionEditRoom(DecoratedChatChannel chatChannel)
chatChannel - public String processActionEditRoomSave()
public String processActionEditRoomCancel()
protected String processActionDeleteRoomConfirm(DecoratedChatChannel chatChannel)
chatChannel - public String processActionDeleteRoom()
public String processActionDeleteRoomCancel()
protected String processActionDeleteRoomMessagesConfirm(DecoratedChatChannel chatChannel)
chatChannel - public String processActionDeleteRoomMessages()
public String processActionDeleteRoomMessagesCancel()
public String processActionDeleteMessage()
protected String processActionDeleteMessageConfirm(DecoratedChatMessage message)
message - public String processActionDeleteMessageCancel()
public String getCourierString()
public boolean getCanManageTool()
public String getCurrentChatChannelId()
public void setCurrentChatChannelId(String channelId)
public DecoratedChatChannel getCurrentChannel()
public void setCurrentChannel(DecoratedChatChannel channel)
channel - protected void resetCurrentChannel(DecoratedChatChannel oldChannel)
public DecoratedChatChannel getCurrentChannelEdit()
public void setCurrentChannelEdit(DecoratedChatChannel currentChannelEdit)
currentChannelEdit - the currentChannelEdit to setpublic DecoratedChatMessage getCurrentMessage()
public void setCurrentMessage(DecoratedChatMessage currentMessage)
currentMessage - the currentMessage to setpublic DecoratedSynopticOptions lookupSynopticOptions()
public DecoratedSynopticOptions getCurrentSynopticOptions()
public void setCurrentSynopticOptions(DecoratedSynopticOptions currentSynopticOptions)
synopticOptions - the synopticOptions to setpublic List<SelectItem> getChatRoomsSelectItems()
public List<DecoratedChatChannel> getChatChannels()
public org.sakaiproject.chat2.model.ChatManager getChatManager()
public String getViewOptions()
public void setViewOptions(String d)
protected int initMessageOptions()
public String getMessageOptions()
public void setMessageOptions(String messageOptions)
messageOptions - the messageOptions to setpublic String getNewMessageText()
public void setNewMessageText(String newMessageText)
public void setChatManager(org.sakaiproject.chat2.model.ChatManager chatManager)
chatManager - ChatManagerpublic org.sakaiproject.tool.api.ToolManager getToolManager()
public void setToolManager(org.sakaiproject.tool.api.ToolManager toolManager)
public ColorMapper getColorMapper()
public void setColorMapper(ColorMapper colorMapper)
public boolean getDisplayDate()
public boolean getDisplayTime()
public boolean getDisplayId()
public boolean getCanRenderAllMessages()
public boolean getCanRenderDateMessages()
public boolean getCanRenderNumberMessages()
public boolean getCanRenderNoMessages()
public List<SelectItem> getMessageOptionsList()
public boolean getCanRenderMessageOptions()
public boolean getSoundAlert()
protected int countChannelMessages(org.sakaiproject.chat2.model.ChatChannel channel)
public List<DecoratedChatMessage> getRoomMessages()
public int getRoomMessagesCount()
public List<DecoratedChatMessage> getSynopticMessages()
protected List<DecoratedChatMessage> getMessages(String context, Date limitDate, int numMessages, boolean sortAsc)
context - limitDate - numMessages - sortAsc - protected int getMessagesCount(String context, Date limitDate)
public boolean getCanRemoveMessage(org.sakaiproject.chat2.model.ChatMessage message)
public boolean getCanRemoveChannel(org.sakaiproject.chat2.model.ChatChannel channel)
public boolean getCanRemoveChannelMessages(org.sakaiproject.chat2.model.ChatChannel channel)
public boolean getCanEditChannel(org.sakaiproject.chat2.model.ChatChannel channel)
public boolean getCanCreateChannel()
public boolean getCanRead(org.sakaiproject.chat2.model.ChatChannel channel)
public boolean getCanPost()
public boolean getMaintainer()
public String getMessageOwnerDisplayName(org.sakaiproject.chat2.model.ChatMessage message)
protected String getPastXDaysText(int x)
protected String getPastXMessagesText(int x)
protected String getNoMessagesText()
protected String getAllMessagesText()
public String getMessagesShownTotalText()
public String getViewingChatRoomText()
public String getServerUrl()
public String getToolString()
protected String getContext()
public String getFramePlacementId()
protected List<org.sakaiproject.chat2.model.ChatChannel> getSiteChannels()
public int getSiteChannelCount()
public SelectItem createSelect(Object id, String description)
public String getToolContext()
public void setToolContext(String toolContext)
public String getSessionId()
public void validatePositiveNumber(FacesContext context, UIComponent component, Object value)
public String getToolTitle()
public String getAccessibleOptionsLink()
Copyright © 2003-2015 The Sakai Foundation. All Rights Reserved.