示例#1
0
 @Override
 public void sanitizeForSaving() {
   googleId = Sanitizer.sanitizeGoogleId(googleId);
   email = Sanitizer.sanitizeEmail(email);
   course = Sanitizer.sanitizeTitle(course);
   name = Sanitizer.sanitizeName(name);
   team = Sanitizer.sanitizeTitle(team);
   section = Sanitizer.sanitizeTitle(section);
   comments = Sanitizer.sanitizeTextField(comments);
 }
示例#2
0
 public StudentAttributes(
     String section, String team, String name, String email, String comment, String courseId) {
   this();
   this.section = Sanitizer.sanitizeTitle(section);
   this.team = Sanitizer.sanitizeTitle(team);
   this.lastName = Sanitizer.sanitizeName(StringHelper.splitName(name)[1]);
   this.name = Sanitizer.sanitizeName(name);
   this.email = Sanitizer.sanitizeEmail(email);
   this.comments = Sanitizer.sanitizeTextField(comment);
   this.course = Sanitizer.sanitizeTitle(courseId);
 }
示例#3
0
 @Override
 public void sanitizeForSaving() {
   this.googleId = Sanitizer.sanitizeGoogleId(this.googleId);
   this.email = Sanitizer.sanitizeEmail(this.email);
   this.course = Sanitizer.sanitizeTitle(this.course);
   this.name = Sanitizer.sanitizeName(this.name);
   this.team = Sanitizer.sanitizeTitle(this.team);
   this.section = Sanitizer.sanitizeTitle(this.section);
   this.comments = Sanitizer.sanitizeTextField(this.comments);
   this.googleId = Sanitizer.sanitizeForHtml(this.googleId);
   this.email = Sanitizer.sanitizeForHtml(this.email);
   this.course = Sanitizer.sanitizeForHtml(this.course);
   this.name = Sanitizer.sanitizeForHtml(this.name);
   this.team = Sanitizer.sanitizeForHtml(this.team);
   this.section = Sanitizer.sanitizeForHtml(this.section);
   this.comments = Sanitizer.sanitizeForHtml(this.comments);
 }
示例#4
0
  public StudentAttributes(Student student) {
    this();
    this.email = student.getEmail();
    this.course = student.getCourseId();
    this.name = student.getName();
    this.lastName = student.getLastName();
    this.comments = Sanitizer.sanitizeTextField(student.getComments());
    this.team = Sanitizer.sanitizeTitle(student.getTeamName());
    this.section =
        ((student.getSectionName() == null)
            ? Const.DEFAULT_SECTION
            : Sanitizer.sanitizeTitle(student.getSectionName()));
    // TODO: Is this supposed to be null or "" ?? Find out and standardize.
    this.googleId = ((student.getGoogleId() == null) ? "" : student.getGoogleId());
    Long keyAsLong = student.getRegistrationKey();
    this.key = (keyAsLong == null ? null : Student.getStringKeyForLongKey(keyAsLong));

    // TODO: this is for backward compatibility with old system. Old system
    // considers "" as unregistered. It should be changed to consider
    // null as unregistered.
  }
示例#5
0
  public StudentAttributes(Student student) {
    this();
    this.email = student.getEmail();
    this.course = student.getCourseId();
    this.name = student.getName();
    this.lastName = student.getLastName();
    this.comments = Sanitizer.sanitizeTextField(student.getComments());
    this.team = Sanitizer.sanitizeTitle(student.getTeamName());
    this.section =
        (student.getSectionName() == null)
            ? Const.DEFAULT_SECTION
            : Sanitizer.sanitizeTitle(student.getSectionName());
    this.googleId = (student.getGoogleId() == null) ? "" : student.getGoogleId();
    Long keyAsLong = student.getRegistrationKey();
    this.key = (keyAsLong == null) ? null : Student.getStringKeyForLongKey(keyAsLong);
    /*
     * TODO: this is for backward compatibility with old system.
     * Old system considers "" as unregistered.
     * It should be changed to consider null as unregistered.
     */

    this.createdAt = student.getCreatedAt();
    this.updatedAt = student.getUpdatedAt();
  }
 public StudentProfileAttributes(
     String googleId,
     String shortName,
     String email,
     String institute,
     String nationality,
     String gender,
     String moreInfo,
     String pictureKey) {
   this.googleId = googleId;
   this.shortName = Sanitizer.sanitizeName(shortName);
   this.email = Sanitizer.sanitizeEmail(email);
   this.institute = Sanitizer.sanitizeTitle(institute);
   this.nationality = Sanitizer.sanitizeName(nationality);
   this.gender = gender;
   this.moreInfo = moreInfo;
   this.pictureKey = pictureKey;
 }