Package org.olat.admin

Source Code of org.olat.admin.BulkReplayUserFrom

/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <p>
*/
package org.olat.admin;

import org.olat.core.gui.components.form.Form;
import org.olat.core.gui.formelements.CheckBoxElement;
import org.olat.core.gui.formelements.PasswordElement;
import org.olat.core.gui.formelements.TextAreaElement;
import org.olat.core.gui.translator.Translator;

/**
* Description:<br>
* It's a legacy form, because flexi form does not support replay url mode up to now. and this form is most likely used from
* a load test to set other users load-testable.
*
* <P>
* Initial Date:  13.11.2008 <br>
* @author patrickb
*/
class BulkReplayUserFrom extends Form {

  private CheckBoxElement isOn;
  private PasswordElement addOlatPasswordAuthentication;
  private TextAreaElement tuser;

  public BulkReplayUserFrom(String name, Translator translator) {
    super(name, translator);
    tuser = new TextAreaElement("bulkuserreplay.tt", 10, 60, null);
    addFormElement("bulkuserreplay.tt", tuser);
    isOn = new CheckBoxElement("bulkuserreplay.chkbx.onoff", true);
    addFormElement("isOn", isOn);
   
    addOlatPasswordAuthentication = new PasswordElement("bulkuserreplay.addOlatPasswordAuthentication", 255);
    addFormElement("addOlatPasswordAuthentication", addOlatPasswordAuthentication);
   
    //
    addSubmitKey("save", "save");
  }

  /**
   * @see org.olat.core.gui.components.form.Form#validate()
   */
  @Override
  public boolean validate() {
    return true;
  }
 
  String[] getUsernames(){
    String[] retVal = tuser.getValue().split("\r\n");
    return retVal;
  }
 
  boolean isOn(){
    return isOn.isChecked();
  }
 
  String getPassword() {
    return addOlatPasswordAuthentication.getValue();
  }

}
TOP

Related Classes of org.olat.admin.BulkReplayUserFrom

TOP
Copyright © 2018 www.massapi.com. 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.