Package org.olat.course.editor

Examples of org.olat.course.editor.PublishEvent


   * Called at course publish.
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {
    if (event instanceof PublishEvent) {
      PublishEvent pe = (PublishEvent) event;
      //FIXME: LD: temporary introduced the (pe.getCommand() == PublishEvent.EVENT_IDENTIFIER) to filter the events from the same VM
      if (pe.getState() == PublishEvent.PRE_PUBLISH && pe.getEventIdentifier() == PublishEvent.EVENT_IDENTIFIER) {
        // PRE PUBLISH -> check node for changes
        addToUpcomingWork(pe);
        return;
      } else if (pe.getState() == PublishEvent.PUBLISH && pe.getEventIdentifier() == PublishEvent.EVENT_IDENTIFIER) {
        // a publish event, check if it matches a previous checked
        boolean recalc = false;
        Long resId = pe.getPublishedCourseResId();
        synchronized (upcomingWork) { //o_clusterOK by:ld synchronized OK - only one cluster node must update the EfficiencyStatements (the course is locked for editing) (same as e.g. file indexer)
          recalc = upcomingWork.contains(resId);
          if (recalc) {
            upcomingWork.remove(resId);
          }
        }
        if (recalc) {
          ICourse pubCourse = CourseFactory.loadCourse(pe.getPublishedCourseResId());
          UpdateEfficiencyStatementsWorker worker = new UpdateEfficiencyStatementsWorker(pubCourse);
          updateESPool.execute(worker);
        }
      }
    }
View Full Code Here


   *
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {   
    if (event instanceof PublishEvent) {
      PublishEvent pe = (PublishEvent) event;
      if (pe.getState() == PublishEvent.PRE_PUBLISH) {
        // so far not interested in PRE PUBLISH event, but one could add user
        // and the currently active BB information. This in turn could be used
        // by the publish event issuer to decide whether or not to publish...
        return;
      }
      if (!course.getResourceableId().equals(pe.getPublishedCourseResId())) throw new AssertException("not the same course");
      // long pts = pe.getLatestPublishTimestamp();
      // disable this controller and issue a information
      // FIXME:fj:b - implement the 'there are 5 users using this course at the
      // moment' warning (in the publishcontroller)
      if (isInEditor) {
View Full Code Here

TOP

Related Classes of org.olat.course.editor.PublishEvent

Copyright © 2018 www.massapicom. 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.