Package org.olat.repository.controllers

Examples of org.olat.repository.controllers.EntryChangedEvent


  protected void formOK(UserRequest ureq) {
    // update repo entry
    RepositoryManager.getInstance().setDescriptionAndName(entry, displayName.getValue().trim(), description.getValue().trim());
    this.entry = (RepositoryEntry) DBFactory.getInstance().loadObject(entry);
    // inform anybody interrested about this change
    MultiUserEvent modifiedEvent = new EntryChangedEvent(entry, EntryChangedEvent.MODIFIED_DESCRIPTION);
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, entry);
    // notify parent controller
    fireEvent(ureq, Event.CHANGED_EVENT);
  }
View Full Code Here


    return publishTreeModel;
  }

  void changeGeneralAccess(UserRequest ureq, int access){
    RepositoryManager.getInstance().setAccess(repositoryEntry, access);
    MultiUserEvent modifiedEvent = new EntryChangedEvent(repositoryEntry, EntryChangedEvent.MODIFIED_AT_PUBLISH);
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, repositoryEntry);
  }
View Full Code Here

    } else if (event instanceof CourseConfigEvent) {       
      dispose();
     
    } else if (event instanceof EntryChangedEvent && ((EntryChangedEvent)event).getChange()!=EntryChangedEvent.MODIFIED_AT_PUBLISH) {
      //courseRepositoryEntry changed (e.g. fired at course access rule change)
      EntryChangedEvent repoEvent = (EntryChangedEvent) event;     
      if (courseRepositoryEntry.getKey().equals(repoEvent.getChangedEntryKey()) && repoEvent.getChange() == EntryChangedEvent.MODIFIED) {       
        dispose();       
      }
    }
  }
View Full Code Here

          RepositoryManager.getInstance().incrementDownloadCounter(repoEntry);
          ureq.getDispatchResult().setResultingMediaResource(mr);
          return;
        } else { // neither launchable nor downloadable -> show details         
          //REVIEW:pb:replace EntryChangedEvent with a more specific event
          fireEvent(ureq, new EntryChangedEvent(repoEntry, EntryChangedEvent.MODIFIED));
          return;
        }

      } else if (command.startsWith(CATCMD_MOVE)) {
        String s = command.substring(CATCMD_MOVE.length());
        if (s.startsWith(CATENTRY_LEAF)) {
          // move a resource in the catalog - moving of catalog leves is triggered by a toolbox action
          int pos = Integer.parseInt(s.substring(CATENTRY_LEAF.length()));
          linkMarkedToBeEdited = (CatalogEntry) childCe.get(pos);
          removeAsListenerAndDispose(catEntryMoveController);
          boolean ajax = getWindowControl().getWindowBackOffice().getWindowManager().isAjaxEnabled();
          if (ajax) {
            // fancy ajax tree
            catEntryMoveController= new CatalogAjaxMoveController(ureq, getWindowControl(), linkMarkedToBeEdited);
          } else {
            // old-school selection tree
            catEntryMoveController= new CatalogEntryMoveController(getWindowControl(), ureq, linkMarkedToBeEdited, getTranslator());
          }
          listenTo(catEntryMoveController);
          removeAsListenerAndDispose(cmc);
          cmc = new CloseableModalController(getWindowControl(), "close", catEntryMoveController.getInitialComponent());
          listenTo(cmc);
          cmc.activate();
        }
      } else if (command.startsWith(CATCMD_REMOVE)) {
        String s = command.substring(CATCMD_REMOVE.length());
        if (s.startsWith(CATENTRY_LEAF)) {
          int pos = Integer.parseInt(s.substring(CATENTRY_LEAF.length()));
          linkMarkedToBeDeleted = (CatalogEntry) childCe.get(pos);
          // create modal dialog
          String[] trnslP = { linkMarkedToBeDeleted.getName() };
          dialogDeleteLink = activateYesNoDialog(ureq, null, getTranslator().translate(NLS_DIALOG_MODAL_LEAF_DELETE_TEXT, trnslP), dialogDeleteLink);
          return;
        }
      } else if (command.startsWith(CATCMD_EDIT)) {
        String s = command.substring(CATCMD_EDIT.length());
        if (s.startsWith(CATENTRY_LEAF)) {
          int pos = Integer.parseInt(s.substring(CATENTRY_LEAF.length()));
          linkMarkedToBeEdited = (CatalogEntry) childCe.get(pos);
          repositoryEditDescriptionController = new RepositoryEditDescriptionController(ureq, getWindowControl(), linkMarkedToBeEdited.getRepositoryEntry(), false);
          repositoryEditDescriptionController.addControllerListener(this);
          // open form in dialog
          removeAsListenerAndDispose(cmc);
          cmc = new CloseableModalController(getWindowControl(), "close", repositoryEditDescriptionController.getInitialComponent(), true, translate("tools.edit.catalog.category"));
          listenTo(cmc);
          cmc.activate();         
        }
      } else if (command.startsWith(CATCMD_DETAIL)) {
        String s = command.substring(CATCMD_DETAIL.length());
        if (s.startsWith(CATENTRY_LEAF)) {
          int pos = Integer.parseInt(s.substring(CATENTRY_LEAF.length()));
          CatalogEntry showDetailForLink = (CatalogEntry) childCe.get(pos);
          RepositoryEntry repoEnt = showDetailForLink.getRepositoryEntry();         
          fireEvent(ureq, new EntryChangedEvent(repoEnt, EntryChangedEvent.MODIFIED));
          //TODO [ingkr]
          //getWindowControl().getDTabs().activateStatic(ureq, RepositorySite.class.getName(), RepositoryMainController.JUMPFROMEXTERN+RepositoryMainController.JUMPFROMCATALOG+repoEnt.getKey().toString());
          return;
        }
      }
View Full Code Here

TOP

Related Classes of org.olat.repository.controllers.EntryChangedEvent

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.