Search in sources :

Example 21 with OLATResourceableJustBeforeDeletedEvent

use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project openolat by klemens.

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;
}
Also used : OLATResourceableJustBeforeDeletedEvent(org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent)

Example 22 with OLATResourceableJustBeforeDeletedEvent

use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project openolat by klemens.

the class CourseHandler method cleanupOnDelete.

@Override
public boolean cleanupOnDelete(RepositoryEntry entry, OLATResourceable res) {
    // notify all current users of this resource (course) that it will be deleted now.
    CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res);
    // archiving is done within readyToDelete
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource resource = rm.findResourceable(res);
    CourseFactory.deleteCourse(entry, resource);
    return true;
}
Also used : OLATResourceableJustBeforeDeletedEvent(org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent) OLATResourceManager(org.olat.resource.OLATResourceManager) OLATResource(org.olat.resource.OLATResource)

Example 23 with OLATResourceableJustBeforeDeletedEvent

use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project openolat by klemens.

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;
}
Also used : OLATResourceableJustBeforeDeletedEvent(org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent)

Example 24 with OLATResourceableJustBeforeDeletedEvent

use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project openolat by klemens.

the class PodcastHandler 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 podcast feed is meant
    // to be subscriped to anyway.
    // NotificationsManager.getInstance().deletePublishersOf(res);
    FeedManager.getInstance().deleteFeed(res);
    return true;
}
Also used : OLATResourceableJustBeforeDeletedEvent(org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent)

Example 25 with OLATResourceableJustBeforeDeletedEvent

use of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent in project openolat by klemens.

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();
    }
}
Also used : AssertException(org.olat.core.logging.AssertException) OLATResourceableJustBeforeDeletedEvent(org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent)

Aggregations

OLATResourceableJustBeforeDeletedEvent (org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent)28 AssertException (org.olat.core.logging.AssertException)6 ObjectNotFoundException (org.hibernate.ObjectNotFoundException)2 StaleObjectStateException (org.hibernate.StaleObjectStateException)2 CollaborationTools (org.olat.collaboration.CollaborationTools)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)2 TreeModel (org.olat.core.gui.components.tree.TreeModel)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 Identity (org.olat.core.id.Identity)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 DBRuntimeException (org.olat.core.logging.DBRuntimeException)2 KnownIssueException (org.olat.core.logging.KnownIssueException)2 AssessmentChangedEvent (org.olat.course.assessment.AssessmentChangedEvent)2 PublishEvent (org.olat.course.editor.PublishEvent)2 AssessmentEvent (org.olat.course.nodes.iq.AssessmentEvent)2 DeletableGroupData (org.olat.group.DeletableGroupData)2 BusinessGroupModifiedEvent (org.olat.group.ui.edit.BusinessGroupModifiedEvent)2 OLATResource (org.olat.resource.OLATResource)2 OLATResourceManager (org.olat.resource.OLATResourceManager)2