Examples of OLATResourceableJustBeforeDeletedEvent


Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

  /**
   * @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();
    }
   
  }
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

  /**
   * @see org.olat.repository.handlers.RepositoryHandler#cleanupOnDelete(org.olat.core.id.OLATResourceable org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public boolean cleanupOnDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    // notify all current users of this resource (course) that it will be deleted now.
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(res), res);
    //archiving is done within readyToDelete   
    CourseFactory.deleteCourse(res);
    // delete resourceable
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.findResourceable(res);
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

   * @see org.olat.repository.handlers.RepositoryHandler#cleanupOnDelete(org.olat.core.id.OLATResourceable,
   *      org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  public boolean cleanupOnDelete(OLATResourceable res, UserRequest ureq, WindowControl control) {
    CoordinatorManager.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;
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

   *
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {
    if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
      OLATResourceableJustBeforeDeletedEvent bdev = (OLATResourceableJustBeforeDeletedEvent) event;
      Long key = n.getKey();
      if (key != null) { // already persisted
        if (bdev.getOresId().equals(key)) {
          dispose();
        }
      }
    }
  }
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

        // delete is ok
        nm.deleteNote(chosenN);
        // fire local event (for the same user)
        //TODO:fj:a make Note (and all persistables) olatresourceables: problem: type is then NoteImpl instead of Note
        OLATResourceable ores = OresHelper.createOLATResourceableInstance(Note.class, chosenN.getKey());
        ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(new OLATResourceableJustBeforeDeletedEvent(ores), ores);
        getWindowControl().setInfo(translate("note.delete.successfull"));
        populateNLTable();
        chosenN = null;
      } else {
          // answer was "no"
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

        // he/she closes the editor to return to the run main (this controller)
      } else {
        dispose();
      }
    } else if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
      OLATResourceableJustBeforeDeletedEvent ojde = (OLATResourceableJustBeforeDeletedEvent) event;
      // make sure it is our course (actually not needed till now, since we
      // registered only to one event, but good style.
      if (ojde.targetEquals(course, true)) {
        dispose();
      }
    } else if (event instanceof AssessmentChangedEvent) {
      AssessmentChangedEvent ace = (AssessmentChangedEvent) event;
      Identity identity = uce.getIdentityEnvironment().getIdentity();
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {
    try {
    if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
      OLATResourceableJustBeforeDeletedEvent ojde = (OLATResourceableJustBeforeDeletedEvent) event;
      // make sure it is our course (actually not needed till now, since we
      // registered only to one event, but good style.
      if (ojde.targetEquals(ores, true)) {
        // true = throw an exception if the target does not match ores
        dispose();
      }
    }
    } catch (RuntimeException e) {
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

  /**
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {
    if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
      OLATResourceableJustBeforeDeletedEvent ojde = (OLATResourceableJustBeforeDeletedEvent) event;
      // make sure it is our course (actually not needed till now, since we
      // registered only to one event, but good style.
      if (ojde.targetEquals(feed, true)) {
        dispose();
      }
    }
  }
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

   * @see org.olat.repository.handlers.RepositoryHandler#cleanupOnDelete(org.olat.core.id.OLATResourceable,
   *      org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  public boolean cleanupOnDelete(OLATResourceable res, UserRequest ureq, WindowControl control) {
    CoordinatorManager.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().delete(res);
    return true;
View Full Code Here

Examples of org.olat.core.util.resource.OLATResourceableJustBeforeDeletedEvent

  /**
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {
    if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
      OLATResourceableJustBeforeDeletedEvent delEvent = (OLATResourceableJustBeforeDeletedEvent) event;
      if (!delEvent.targetEquals(currBusinessGroup)) throw new AssertException(
          "receiving a delete event for a olatres we never registered for!!!:" + delEvent.getDerivedOres());
      dispose();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.