Package org.olat.core.util.event

Examples of org.olat.core.util.event.MultiUserEvent


    });//end syncerCallback
  }

  public void event(Event event) {
    if (event instanceof MultiUserEvent) {
      MultiUserEvent mue = (MultiUserEvent) event;
      //do not use setInfoMessage(..) this event comes in from another node, where the infomessage was set.
      InfoMessageManager.infoMessage = mue.getCommand();
    }
  }
View Full Code Here


      if (DialogBoxUIFactory.isYesEvent(event)) {
        // yes case
        doContextDelete();
        this.content.popContent();
        doContextList(ureq, true);
        MultiUserEvent mue = new BGContextEvent(BGContextEvent.CONTEXT_DELETED, this.currentGroupContext);
        CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(mue, this.currentGroupContext);
      }
    } else if (source == this.contextListCtr) {
      if (cmd.equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
View Full Code Here

          // check if already in model
          boolean alreadyAssociated = PersistenceHelper.listContainsObjectByKey(this.repoTableModelEntries, re);
          if (!alreadyAssociated) {
            doAddRepositoryEntry(re);
            fireEvent(ureq, Event.CHANGED_EVENT);
            MultiUserEvent mue = new BGContextEvent(BGContextEvent.RESOURCE_ADDED, this.groupContext);
            CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(mue, this.groupContext);
          }
        }
      }
    } else if (source == this.ownerCtr) {
      if(event instanceof IdentitiesAddEvent ) {
        List<Identity> addedIdentities = new ArrayList<Identity>();
        for (Identity identity : ((IdentitiesAddEvent) event).getAddIdentities()) {
          if (!ManagerFactory.getManager().isIdentityInSecurityGroup(identity, this.groupContext.getOwnerGroup())) {
            ManagerFactory.getManager().addIdentityToSecurityGroup(identity, this.groupContext.getOwnerGroup());
            addedIdentities.add(identity);
          }
        }
        ((IdentitiesAddEvent) event).setIdentitiesAddedEvent(addedIdentities);
      } else if (event instanceof IdentitiesRemoveEvent) {
        for (Identity identity : ((IdentitiesRemoveEvent) event).getRemovedIdentities()) {
          if (ManagerFactory.getManager().isIdentityInSecurityGroup(identity, this.groupContext.getOwnerGroup())) {
            ManagerFactory.getManager().removeIdentityFromSecurityGroup(identity, this.groupContext.getOwnerGroup());
          }
        }
      }
      fireEvent(ureq, Event.CHANGED_EVENT);
    } else if (source == this.resourcesCtr) {
      if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
        TableEvent te = (TableEvent) event;
        String actionid = te.getActionId();
        int rowid = te.getRowId();
        this.currentRepoEntry = (RepositoryEntry)this.repoTableModel.getObject(rowid);
        if (actionid.equals(RepositoryTableModel.TABLE_ACTION_SELECT_LINK)) {
          if (this.groupContext.isDefaultContext()) {
            if (this.repoTableModelEntries.size() == 1) {
              // display error and exit - do not remove resource
              getWindowControl().setError(translate("resource.error.isDefault"));
              this.contextController.setValues(this.groupContext);
              return;
            }
          }
          //present dialog box if resource should be removed
          String text = getTranslator().translate("resource.remove", new String[] { this.groupContext.getName(), this.currentRepoEntry.getDisplayname() });
          this.confirmRemoveResource = activateYesNoDialog(ureq, null, text, this.confirmRemoveResource);
         
        }
      }
    } else if (source == this.confirmRemoveResource) {
      if (DialogBoxUIFactory.isYesEvent(event)) { // yes case
        doRemoveResource(this.currentRepoEntry);
        fireEvent(ureq, Event.CHANGED_EVENT);
        MultiUserEvent mue = new BGContextEvent(BGContextEvent.RESOURCE_REMOVED, this.groupContext);
        CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(mue, this.groupContext);
      }
    } else if (source == this.contextController) {
      if (event == Event.DONE_EVENT) {
        doUpdateContext(ureq);
View Full Code Here

                getWindowControl().setInfo(translate("profile.unsuccessful"));
                // reload user data from db
                ProfileAndHomePageEditController.this.identityToModify = ManagerFactory.getManager().loadIdentityByKey(
                    ProfileAndHomePageEditController.this.identityToModify.getKey());
              }
              CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new MultiUserEvent("changed"),
                  OresHelper.createOLATResourceableInstance(Identity.class, ProfileAndHomePageEditController.this.identityToModify.getKey()));
              if (!emailChanged) resetForm(ureq, getWindowControl());
            }
          });
        if (emailChanged) {
View Full Code Here

  @Override
  public void sendGroupChangeEvent(Project project, Long courseResourceableId, Identity identity) {
    ICourse course = CourseFactory.loadCourse(courseResourceableId);
    RepositoryEntry ores = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
    MultiUserEvent modifiedEvent = new BusinessGroupModifiedEvent(BusinessGroupModifiedEvent.IDENTITY_ADDED_EVENT, project.getProjectGroup(), identity);
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(modifiedEvent, ores);
  }
View Full Code Here

    for (Iterator<Subscriber> it_subs = subscribers.iterator(); it_subs.hasNext();) {
      Subscriber su = it_subs.next();
      subsKeys.add(su.getKey());
    }
    // fire the event
    MultiUserEvent mue = EventFactory.createAffectedEvent(subsKeys);
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(mue, oresMyself);
   
  }
View Full Code Here

          System.out.println("event received!"+event);
          JMSTest.this.event = event;
        }}, id1, ores1);
     
     
      MultiUserEvent mue = new MultiUserEvent("amuecommand");
      bus.fireEventToListenersOf(mue, ores1);
      try {
        Thread.sleep(2000);
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of org.olat.core.util.event.MultiUserEvent

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.