use of org.olat.modules.fo.Status in project openolat by klemens.
the class MessageListController method doShowThread.
/**
* Sets the hidden status to the threadtop message.
* @param ureq
* @param msg
* @param hidden
*/
private void doShowThread() {
if (thread != null) {
thread = forumManager.getMessageById(thread.getKey());
Status status = Status.getStatus(thread.getStatusCode());
status.setHidden(false);
thread.setStatusCode(Status.getStatusCode(status));
thread = forumManager.updateMessage(thread, true);
// before sending async event
DBFactory.getInstance().commit();
hideThreadButton.setVisible(true && !guestOnly);
showThreadButton.setVisible(false);
mainVC.setDirty(true);
ForumChangedEvent event = new ForumChangedEvent(ForumChangedEvent.SHOW, thread.getKey(), null, getIdentity());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, forumOres);
ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_THREAD_SHOW, getClass(), LoggingResourceable.wrap(thread));
}
}
use of org.olat.modules.fo.Status in project openolat by klemens.
the class MessageListController method doHideThread.
/**
* Sets the hidden status to the thread message.
* @param ureq
* @param msg
* @param hidden
*/
private void doHideThread() {
if (thread != null) {
thread = forumManager.getMessageById(thread.getKey());
Status status = Status.getStatus(thread.getStatusCode());
status.setHidden(true);
thread.setStatusCode(Status.getStatusCode(status));
thread = forumManager.updateMessage(thread, false);
// before sending async event
DBFactory.getInstance().commit();
hideThreadButton.setVisible(false);
showThreadButton.setVisible(true && !guestOnly);
mainVC.setDirty(true);
ForumChangedEvent event = new ForumChangedEvent(ForumChangedEvent.HIDE, thread.getKey(), null, getIdentity());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, forumOres);
ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_THREAD_HIDE, getClass(), LoggingResourceable.wrap(thread));
}
}
use of org.olat.modules.fo.Status in project openolat by klemens.
the class MessageListController method doToogleSticky.
private void doToogleSticky() {
Status status = Status.getStatus(thread.getStatusCode());
status.setSticky(!status.isSticky());
thread.setStatusCode(Status.getStatusCode(status));
thread = forumManager.updateMessage(thread, false);
DBFactory.getInstance().commit();
stickyButton.setVisible(!status.isSticky() && foCallback.mayEditMessageAsModerator());
removeStickyButton.setVisible(status.isSticky() && foCallback.mayEditMessageAsModerator());
mainVC.setDirty(true);
ForumChangedEvent event = new ForumChangedEvent(ForumChangedEvent.STICKY, thread.getKey(), null, getIdentity());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, forumOres);
ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_MESSAGE_EDIT, getClass(), LoggingResourceable.wrap(thread));
}
use of org.olat.modules.fo.Status in project OpenOLAT by OpenOLAT.
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));
}
}
use of org.olat.modules.fo.Status in project OpenOLAT by OpenOLAT.
the class MessageListController method doShowThread.
/**
* Sets the hidden status to the threadtop message.
* @param ureq
* @param msg
* @param hidden
*/
private void doShowThread() {
if (thread != null) {
thread = forumManager.getMessageById(thread.getKey());
Status status = Status.getStatus(thread.getStatusCode());
status.setHidden(false);
thread.setStatusCode(Status.getStatusCode(status));
thread = forumManager.updateMessage(thread, true);
// before sending async event
DBFactory.getInstance().commit();
hideThreadButton.setVisible(true && !guestOnly);
showThreadButton.setVisible(false);
mainVC.setDirty(true);
ForumChangedEvent event = new ForumChangedEvent(ForumChangedEvent.SHOW, thread.getKey(), null, getIdentity());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(event, forumOres);
ThreadLocalUserActivityLogger.log(ForumLoggingAction.FORUM_THREAD_SHOW, getClass(), LoggingResourceable.wrap(thread));
}
}
Aggregations