/** * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, * org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event) */ public void event(UserRequest ureq, Controller source, Event event) { if (source == tableCtr) { if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) { TableEvent te = (TableEvent) event; LockEntry lockToRelease = locksTableModel.getObject(te.getRowId()); dialogController = activateYesNoDialog(ureq, null, translate("lock.release.sure"), dialogController); dialogController.setUserObject(lockToRelease); } } else if (source == dialogController) { if (DialogBoxUIFactory.isYesEvent(event)) { LockEntry lockToRelease = (LockEntry) dialogController.getUserObject(); MultiUserEvent mue = new LockRemovedEvent(lockToRelease); OLATResourceable lockEntryOres = OresHelper.createOLATResourceableInstance(LockEntry.class, 0l); CoordinatorManager.getInstance() .getCoordinator() .getEventBus() .fireEventToListenersOf(mue, lockEntryOres); CoordinatorManager.getInstance() .getCoordinator() .getLocker() .releaseLockEntry(lockToRelease); lockToRelease = null; resetTableModel(); } } }
/** * @see ObjectAccessEvent * @param action * @param ores */ public static void changed(int action, OLATResourceable ores) { ObjectAccessEvent cevent = new ObjectAccessEvent(action, ores); CoordinatorManager.getInstance() .getCoordinator() .getEventBus() .fireEventToListenersOf(cevent, ores); }
/** * @see * org.olat.repository.handlers.RepositoryHandler#cleanupOnDelete(org.olat.core.id.OLATResourceable, * org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl) */ @Override public boolean cleanupOnDelete(final OLATResourceable res) { CoordinatorManager.getInstance() .getCoordinator() .getEventBus() .fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res); // For now, notifications are not implemented since a blog feed is meant // to be subscriped to anyway. // NotificationsManager.getInstance().deletePublishersOf(res); FeedManager.getInstance().delete(res); return true; }
/** Re-initialize this controller. Fetches sessions again. */ public void resetTableModel() { List<LockEntry> locks = CoordinatorManager.getInstance().getCoordinator().getLocker().adminOnlyGetLockEntries(); locksTableModel = new LockTableModel(locks); tableCtr.setTableDataModel(locksTableModel); }