Package org.olat.admin.securitygroup.gui

Examples of org.olat.admin.securitygroup.gui.IdentitiesAddEvent


      //closed dialog box either by clicking ok, or closing the box
      if (event == Event.CANCELLED_EVENT || DialogBoxUIFactory.isOkEvent(event)) {
        fireEvent(ureq, Event.CANCELLED_EVENT);
      }
    } else if(event instanceof IdentitiesAddEvent ) {
      IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent) event;
      BusinessGroupAddResponse response = null;
      addLoggingResourceable(LoggingResourceable.wrap(currBusinessGroup));
      if (source == ownerGrpCntrllr) {
        response = bgm.addOwnersAndFireEvent(ureq.getIdentity(), identitiesAddedEvent.getAddIdentities(), currBusinessGroup, flags);
      } else if (source == partipGrpCntrllr) {
        response = bgm.addParticipantsAndFireEvent(ureq.getIdentity(), identitiesAddedEvent.getAddIdentities(), currBusinessGroup, flags);         
      } else if (source == waitingGruppeController) {
        response = bgm.addToWaitingListAndFireEvent(ureq.getIdentity(), identitiesAddedEvent.getAddIdentities(), currBusinessGroup, flags);                 
      }
      identitiesAddedEvent.setIdentitiesAddedEvent(response.getAddedIdentities());
      identitiesAddedEvent.setIdentitiesWithoutPermission(response.getIdentitiesWithoutPermission());
      identitiesAddedEvent.setIdentitiesAlreadyInGroup(response.getIdentitiesAlreadyInGroup());     
      fireEvent(ureq, Event.CHANGED_EVENT );
    else if (event instanceof IdentitiesRemoveEvent) {
      List<Identity> identities = ((IdentitiesRemoveEvent) event).getRemovedIdentities();
      if (source == ownerGrpCntrllr) {
        bgm.removeOwnersAndFireEvent(ureq.getIdentity(), identities, currBusinessGroup, flags);
View Full Code Here


      repositoryEntry = RepositoryManager.getInstance().lookupRepositoryEntry(repositoryEntry.getKey());
    }
    String cmd = event.getCommand();
    if (source == groupEditController) {
      if(event instanceof IdentitiesAddEvent ) { //FIXME:chg: Move into seperate RepositoryOwnerGroupController like BusinessGroupEditController ?
        IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent) event;
        RepositoryManager rm = RepositoryManager.getInstance();
        //add to group and also adds identities really added to the event.
        //this is then later used by the GroupController to determine if the
        //model should be updated or not.
        rm.addOwners(ureq.getIdentity(),identitiesAddedEvent,repositoryEntry);
View Full Code Here

        return;
      }
    } else if (source == accountManagerGroupController) {
      BGConfigFlags flags = BGConfigFlags.createRightGroupDefaultFlags();
      if (event instanceof IdentitiesAddEvent) {
        IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent)event;
        BusinessGroupAddResponse response = BusinessGroupManagerImpl.getInstance().addParticipantsAndFireEvent(urequest.getIdentity(), identitiesAddedEvent.getAddIdentities(), accountManagerGroup, flags);
        identitiesAddedEvent.setIdentitiesAddedEvent(response.getAddedIdentities());
        identitiesAddedEvent.setIdentitiesWithoutPermission(response.getIdentitiesWithoutPermission());
        identitiesAddedEvent.setIdentitiesAlreadyInGroup(response.getIdentitiesAlreadyInGroup());
        getLogger().info("Add users as account-managers");
        fireEvent(urequest, Event.CHANGED_EVENT );     
      } else if (event instanceof IdentitiesRemoveEvent) {
        BusinessGroupManagerImpl.getInstance().removeParticipantsAndFireEvent(urequest.getIdentity(), ((IdentitiesRemoveEvent) event).getRemovedIdentities(), accountManagerGroup, flags);
        getLogger().info("Remove users as account-managers");
View Full Code Here

 
  public void event(UserRequest urequest, Controller source, Event event) {
    if (source == projectLeaderController) {
      BGConfigFlags flags = BGConfigFlags.createRightGroupDefaultFlags();
      if (event instanceof IdentitiesAddEvent) {
        IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent)event;
        BusinessGroupAddResponse response = BusinessGroupManagerImpl.getInstance().addOwnersAndFireEvent(urequest.getIdentity(), identitiesAddedEvent.getAddIdentities(), project.getProjectGroup(), flags);
        identitiesAddedEvent.setIdentitiesAddedEvent(response.getAddedIdentities());
        identitiesAddedEvent.setIdentitiesWithoutPermission(response.getIdentitiesWithoutPermission());
        identitiesAddedEvent.setIdentitiesAlreadyInGroup(response.getIdentitiesAlreadyInGroup());
        getLogger().info("Add users as project-leader");
        fireEvent(urequest, Event.CHANGED_EVENT );     
      } else if (event instanceof IdentitiesRemoveEvent) {
        BusinessGroupManagerImpl.getInstance().removeOwnersAndFireEvent(urequest.getIdentity(), ((IdentitiesRemoveEvent) event).getRemovedIdentities(), project.getProjectGroup(), flags);
        getLogger().info("Remove users as account-managers");
        fireEvent(urequest, Event.CHANGED_EVENT );
      }
    } else if (source == projectMemberController) {
      BGConfigFlags flags = BGConfigFlags.createRightGroupDefaultFlags();
      if (event instanceof IdentitiesAddEvent) {
        IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent)event;
        BusinessGroupAddResponse response = BusinessGroupManagerImpl.getInstance().addParticipantsAndFireEvent(urequest.getIdentity(), identitiesAddedEvent.getAddIdentities(), project.getProjectGroup(), flags);
        identitiesAddedEvent.setIdentitiesAddedEvent(response.getAddedIdentities());
        identitiesAddedEvent.setIdentitiesWithoutPermission(response.getIdentitiesWithoutPermission());
        identitiesAddedEvent.setIdentitiesAlreadyInGroup(response.getIdentitiesAlreadyInGroup());
        getLogger().info("Add users as project-members");
        fireEvent(urequest, Event.CHANGED_EVENT );     
      } else if (event instanceof IdentitiesRemoveEvent) {
        BusinessGroupManagerImpl.getInstance().removeParticipantsAndFireEvent(urequest.getIdentity(), ((IdentitiesRemoveEvent) event).getRemovedIdentities(), project.getProjectGroup(), flags);
        getLogger().info("Remove users as account-managers");
        fireEvent(urequest, Event.CHANGED_EVENT );
      }
    } else if (source == projectCandidatesController) {
      BGConfigFlags flags = BGConfigFlags.createRightGroupDefaultFlags();
      if (event instanceof IdentitiesAddEvent) {
        IdentitiesAddEvent identitiesAddEvent = (IdentitiesAddEvent)event;
        List<Identity> addedIdentities = ProjectBrokerManagerFactory.getProjectGroupManager().addCandidates(identitiesAddEvent.getAddIdentities(), project);
        identitiesAddEvent.setIdentitiesAddedEvent(addedIdentities);
        fireEvent(urequest, Event.CHANGED_EVENT );     
      } else if (event instanceof IdentitiesRemoveEvent) {
        ProjectBrokerManagerFactory.getProjectGroupManager().removeCandidates(((IdentitiesRemoveEvent)event).getRemovedIdentities(), project);
        fireEvent(urequest, Event.CHANGED_EVENT );
      } else if (event instanceof IdentitiesMoveEvent) {
View Full Code Here

      }
    } else if (source == groupController) {
      // remove modal dialog
      cmc.deactivate();
      if(event instanceof IdentitiesAddEvent ) { //FIXME:chg: Move into seperate RepositoryOwnerGroupController like BusinessGroupEditController ?
        IdentitiesAddEvent identitiesAddedEvent = (IdentitiesAddEvent) event;
        List<Identity> list = identitiesAddedEvent.getAddIdentities();
        for (Identity identity : list) {
          ManagerFactory.getManager().addIdentityToSecurityGroup(identity, currentCatalogEntry.getOwnerGroup());
          identitiesAddedEvent.getAddedIdentities().add(identity);
        }
      } else if (event instanceof IdentitiesRemoveEvent) {
        IdentitiesRemoveEvent identitiesRemoveEvent = (IdentitiesRemoveEvent) event;
        List<Identity> list = identitiesRemoveEvent.getRemovedIdentities();
        for (Identity identity : list) {
View Full Code Here

TOP

Related Classes of org.olat.admin.securitygroup.gui.IdentitiesAddEvent

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.