Package org.olat.basesecurity.events

Examples of org.olat.basesecurity.events.MultiIdentityChosenEvent


    if (sourceController == usc) {
      if (event == Event.CANCELLED_EVENT) {
        removeAsListenerAndDispose(usc);
       
      } else if (event instanceof MultiIdentityChosenEvent) {
        MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
        toDelete = multiEvent.getChosenIdentities();
        if (toDelete.size() == 0) {
          showError("msg.selectionempty");
          return;
        }
        if (!UserDeletionManager.getInstance().isReadyToDelete()) {
View Full Code Here


        }
      }
    }
    if ( source == userSearchCtr ) {
      if (event instanceof MultiIdentityChosenEvent) {
        MultiIdentityChosenEvent mice = (MultiIdentityChosenEvent) event;
        owners = mice.getChosenIdentities();
      }
      if (event instanceof SingleIdentityChosenEvent) {
        SingleIdentityChosenEvent  sice = (SingleIdentityChosenEvent) event;
        final Identity choosenIdentity = sice.getChosenIdentity();
        owners.add(sice.getChosenIdentity());
View Full Code Here

            return;
          }
          toAdd = new ArrayList<Identity>();
          toAdd.add(choosenIdentity);
        } else if (event instanceof MultiIdentityChosenEvent) {
          MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
          toAdd = multiEvent.getChosenIdentities();
          if (toAdd.size() == 0) {
            showError("msg.selectionempty");
            return;
          }
        } else {
          throw new RuntimeException("unknown event ::" + event.getCommand());
        }
        // in both cases continue adding the users or asking for the mail
        // template if available (=not null)
        cmc.deactivate();
        if (addUserMailDefaultTempl == null) {
          doAddIdentitiesToGroup(ureq, toAdd, null);
        } else {
          if (addUserMailCtr != null) addUserMailCtr.dispose();
          addUserMailCtr = new MailNotificationEditController(getWindowControl(), ureq, addUserMailDefaultTempl, true);         
          this.listenTo(addUserMailCtr);
          cmc = new CloseableModalController(getWindowControl(), translate("close"), addUserMailCtr.getInitialComponent());
          cmc.activate();
        }
      }
      // in any case cleanup this controller, not used anymore
      usc.dispose();
      usc = null;

    } else if (sourceController == addUserMailCtr) {
      if (event == Event.DONE_EVENT) {
        MailTemplate customTemplate = addUserMailCtr.getMailTemplate();
        doAddIdentitiesToGroup(ureq, toAdd, customTemplate);
        cmc.deactivate();
      } else if (event == Event.CANCELLED_EVENT) {
        cmc.deactivate();
      } else {
        throw new RuntimeException("unknown event ::" + event.getCommand());
      }

    } else if (sourceController == confirmDelete) {
      if (DialogBoxUIFactory.isYesEvent(event)) {
        // before deleting, assure it is allowed
        if (!mayModifyMembers) throw new AssertException("not allowed to remove member!");
        // list is never null, but can be empty
        // TODO: Theoretically it can happen that the table model here is not accurate!
        // the 'keep at least one' should be handled by the security manager that should
        // synchronizes the method on the group
        int size = identitiesTableModel.getObjects().size();
        if (keepAtLeastOne && (size - toRemove.size() == 0)) {
          showError("msg.atleastone");
        } else {
          doRemoveIdentitiesFromGroup(ureq, toRemove, removeUserMailCustomTempl);
        }
      }

    } else if (sourceController == userToGroupWizardCtr) {
      if (event instanceof MultiIdentityChosenEvent) {
        MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
        List<Identity> choosenIdentities = multiEvent.getChosenIdentities();
        MailTemplate customTemplate = multiEvent.getMailTemplate();
        if (choosenIdentities.size() == 0) {
          showError("msg.selectionempty");
          return;
        }
        doAddIdentitiesToGroup(ureq, choosenIdentities, customTemplate);
View Full Code Here

        }
      } else if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
        TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
        if (tmse.getAction().equals(ACTION_MULTISELECT_CHOOSE)) {
          foundIdentities = tdm.getObjects(tmse.getSelection());
          fireEvent(ureq, new MultiIdentityChosenEvent(foundIdentities));
        }
      }
    } else if (source == autocompleterC) {
      EntriesChosenEvent ece = (EntriesChosenEvent)event;
      List res = ece.getEntries();
View Full Code Here

          SingleIdentityChosenEvent singleEvent = (SingleIdentityChosenEvent) event;
          Identity choosenIdentity = singleEvent.getChosenIdentity();
          toAdd = new ArrayList<Identity>();
          toAdd.add(choosenIdentity);
        } else if (event instanceof MultiIdentityChosenEvent) {
          MultiIdentityChosenEvent multiEvent = (MultiIdentityChosenEvent) event;
          toAdd = multiEvent.getChosenIdentities();
        }
        boolean showMessage = false;
        if(toAdd != null && toAdd.size() > 0) {
          for( Identity identity : toAdd ) {
            status = denManager.doEnroll(identity, selectedEvent, ores, courseNode, true);
View Full Code Here

      }

    } else if (source == nextButton) {
      if (mailTemplate == null) {
        // wizard stops here - no mail template to fill out
        fireEvent(ureq, new MultiIdentityChosenEvent(this.oks));
      } else {
        // next step is the notification mail form
        if (mailCtr != null) mailCtr.dispose();
        mailCtr = new MailNotificationEditController(getWindowControl(), ureq, mailTemplate, false);
        mailCtr.addControllerListener(this);
View Full Code Here

   *      org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == mailCtr) {
      if (event == Event.DONE_EVENT) {
        MultiIdentityChosenEvent multiEvent = new MultiIdentityChosenEvent(this.oks);
        multiEvent.setMailTemplate(mailCtr.getMailTemplate());
        fireEvent(ureq, multiEvent);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.basesecurity.events.MultiIdentityChosenEvent

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.