protected void event(UserRequest ureq, Controller source, Event event) {
if (source == subscriptionsTableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
String actionid = te.getActionId();
Subscriber sub = subscriptionsTableModel.getObject(te.getRowId());
if (actionid.equals("launch")) {
// User want to go to the subscription source, e.g. the forum or the
// folder
NotificationUIFactory.launchSubscriptionResource(ureq, getWindowControl(), sub);
} else if (actionid.equals("del")) {
delYesNoC = activateYesNoDialog(ureq, null, translate("confirm.delete"), delYesNoC);
delYesNoC.setUserObject(sub);
return;
}
}
} else if (source == delYesNoC) {
if (DialogBoxUIFactory.isYesEvent(event)) { // ok
// Remove subscription and update data model
Subscriber sub = (Subscriber) delYesNoC.getUserObject();
NotificationsManager.getInstance().unsubscribe(sub);
updateSubscriptionsDataModel();
showInfo("info.notification.deleted");
// Notify parent controller
fireEvent(ureq, Event.CHANGED_EVENT);