use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project OpenOLAT by OpenOLAT.
the class OLATResourceableListeningWrapperController method event.
/**
* @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
*/
public void event(Event event) {
if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
OLATResourceableJustBeforeDeletedEvent orj = (OLATResourceableJustBeforeDeletedEvent) event;
if (!orj.targetEquals(ores))
throw new AssertException("disposingwrappercontroller only listens to del event for resource " + ores.getResourceableTypeName() + " / " + ores.getResourceableId() + ", but event was for " + orj.getDerivedOres());
dispose();
}
}
use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project OpenOLAT by OpenOLAT.
the class BusinessGroupMainRunController method event.
/**
* @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
*/
@Override
public void event(Event event) {
if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
OLATResourceableJustBeforeDeletedEvent delEvent = (OLATResourceableJustBeforeDeletedEvent) event;
if (!delEvent.targetEquals(businessGroup)) {
throw new AssertException("receiving a delete event for a olatres we never registered for!!!:" + delEvent.getDerivedOres());
}
dispose();
} else if (event instanceof BusinessGroupModifiedEvent) {
BusinessGroupModifiedEvent bgmfe = (BusinessGroupModifiedEvent) event;
if (event.getCommand().equals(BusinessGroupModifiedEvent.CONFIGURATION_MODIFIED_EVENT)) {
// reset business group property manager
// update reference to update business group object
businessGroup = businessGroupService.loadBusinessGroup(businessGroup);
chatAvailable = isChatAvailable();
main.contextPut("BuddyGroup", businessGroup);
TreeModel trMdl = buildTreeModel();
bgTree.setTreeModel(trMdl);
if (bgEditCntrllr == null) {
// change didn't origin by our own edit controller
showInfo("grouprun.configurationchanged");
bgTree.setSelectedNodeId(trMdl.getRootNode().getIdent());
mainPanel.setContent(main);
} else {
// Activate edit menu item
bgTree.setSelectedNodeId(ACTIVITY_MENUSELECT_ADMINISTRATION);
}
} else if (bgmfe.wasMyselfRemoved(getIdentity()) && !wildcard && !isGroupsAdmin) {
// nothing more here!! The message will be created and displayed upon disposing
// disposed message controller will be set
dispose();
}
} else if (event instanceof AssessmentEvent) {
if (((AssessmentEvent) event).getEventType().equals(AssessmentEvent.TYPE.STARTED)) {
groupRunDisabled = true;
} else if (((AssessmentEvent) event).getEventType().equals(AssessmentEvent.TYPE.STOPPED)) {
groupRunDisabled = false;
}
}
}
use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project OpenOLAT by OpenOLAT.
the class BlogHandler method cleanupOnDelete.
@Override
public boolean cleanupOnDelete(RepositoryEntry entry, 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().deleteFeed(res);
return true;
}
use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project OpenOLAT by OpenOLAT.
the class WikiHandler method cleanupOnDelete.
@Override
public boolean cleanupOnDelete(RepositoryEntry entry, OLATResourceable res) {
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res);
// delete also notifications
NotificationsManager.getInstance().deletePublishersOf(res);
FileResourceManager.getInstance().deleteFileResource(res);
return true;
}
use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project OpenOLAT by OpenOLAT.
the class GlossaryHandler method cleanupOnDelete.
@Override
public boolean cleanupOnDelete(RepositoryEntry entry, OLATResourceable res) {
// FIXME fg
// do not need to notify all current users of this resource, since the only
// way to access this resource
// FIXME:fj:c to be perfect, still need to notify
// repositorydetailscontroller and searchresultcontroller....
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res);
GlossaryManager.getInstance().deleteGlossary(res);
return true;
}
Aggregations