use of org.olat.modules.fo.ForumChangedEvent in project openolat by klemens.
the class MessageListController method doOpenThread.
private void doOpenThread() {
if (thread != null) {
thread = forumManager.getMessageById(thread.getKey());
Status status = Status.getStatus(thread.getStatusCode());
status.setClosed(false);
thread.setStatusCode(Status.getStatusCode(status));
thread = forumManager.updateMessage(thread, true);
// before sending async event
DBFactory.getInstance().commit();
closeThreadButton.setVisible(true && !guestOnly);
openThreadButton.setVisible(false);
mainVC.setDirty(true);
ForumChangedEvent event = new ForumChangedEvent(ForumChangedEvent.OPEN, thread.getKey(), null, getIdentity());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, forumOres);
ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_THREAD_REOPEN, getClass(), LoggingResourceable.wrap(thread));
}
}
use of org.olat.modules.fo.ForumChangedEvent in project openolat by klemens.
the class MessageListController method event.
@Override
public void event(Event event) {
if (event instanceof ForumChangedEvent) {
ForumChangedEvent fce = (ForumChangedEvent) event;
if (ForumChangedEvent.CHANGED_MESSAGE.equals(fce.getCommand()) || ForumChangedEvent.NEW_MESSAGE.equals(fce.getCommand()) || ForumChangedEvent.DELETED_MESSAGE.equals(fce.getCommand())) {
Long threadtopKey = fce.getThreadtopKey();
Long senderId = fce.getSendByIdentityKey();
if (thread != null && threadtopKey != null && thread.getKey().equals(threadtopKey) && (senderId == null || !senderId.equals(getIdentity().getKey()))) {
reloadList = true;
}
}
}
}
use of org.olat.modules.fo.ForumChangedEvent in project openolat by klemens.
the class MessageListController method doCloseThread.
/**
* Sets the closed status to the thread message.
* @param ureq
* @param msg
* @param closed
*/
private void doCloseThread() {
if (thread != null) {
thread = forumManager.getMessageById(thread.getKey());
Status status = Status.getStatus(thread.getStatusCode());
status.setClosed(true);
thread.setStatusCode(Status.getStatusCode(status));
thread = forumManager.updateMessage(thread, false);
// before sending async event
DBFactory.getInstance().commit();
closeThreadButton.setVisible(false);
openThreadButton.setVisible(true && !guestOnly);
mainVC.setDirty(true);
ForumChangedEvent event = new ForumChangedEvent(ForumChangedEvent.CLOSE, thread.getKey(), null, getIdentity());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, forumOres);
ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_THREAD_CLOSE, getClass(), LoggingResourceable.wrap(thread));
}
}
Aggregations