예제 #1
0
  @Override
  protected Collection<Person> getReceivers(Thesis thesis) {
    Person student = thesis.getStudent().getPerson();
    Person orientator = thesis.getOrientator().getPerson();
    Person coorientator = getPerson(thesis.getCoorientator());
    Person president = getPerson(thesis.getPresident());

    Set<Person> persons = personSet(student, orientator, coorientator, president);
    for (ThesisEvaluationParticipant participant : thesis.getVowels()) {
      persons.add(participant.getPerson());
    }

    // also send proposal approval to the contact team
    ExecutionYear executionYear = thesis.getEnrolment().getExecutionYear();
    for (ScientificCommission member :
        thesis.getDegree().getScientificCommissionMembers(executionYear)) {
      if (member.isContact()) {
        persons.add(member.getPerson());
      }
    }

    return persons;
  }
예제 #2
0
  @Override
  protected String getMessage(Thesis thesis) {
    Person currentPerson = AccessControl.getPerson();
    ExecutionYear executionYear = ExecutionYear.readCurrentExecutionYear();

    String title = thesis.getTitle().getContent();
    String year = executionYear.getYear();
    String degreeName = thesis.getDegree().getNameFor(executionYear).getContent();
    String studentName = thesis.getStudent().getPerson().getName();
    String studentNumber = thesis.getStudent().getNumber().toString();
    String presidentName = name(thesis.getPresident());
    String presidentAffiliation = affiliation(thesis.getPresident());
    String orientatorName = name(thesis.getOrientator());
    String orientatorAffiliation = affiliation(thesis.getOrientator());
    String coorientatorName = name(thesis.getCoorientator());
    String coorientatorAffiliation = affiliation(thesis.getCoorientator());
    String vowel1Name = name(thesis.getVowels(), 0);
    String vowel1Affiliation = affiliation(thesis.getVowels(), 0);
    String vowel2Name = name(thesis.getVowels(), 1);
    String vowel2Affiliation = affiliation(thesis.getVowels(), 1);
    String vowel3Name = name(thesis.getVowels(), 2);
    String vowel3Affiliation = affiliation(thesis.getVowels(), 2);

    String date = String.format(new Locale("pt"), "%1$td de %1$tB de %1$tY", new Date());
    String currentPersonName = currentPerson.getNickname();

    if (thesis.isCoordinator()) {
      return getMessage(
          COORDINATOR_BODY_KEY,
          year,
          degreeName,
          studentName,
          studentNumber,
          presidentName,
          presidentAffiliation,
          orientatorName,
          orientatorAffiliation,
          includeFlag(coorientatorName),
          coorientatorName,
          coorientatorAffiliation,
          includeFlag(vowel1Name),
          vowel1Name,
          vowel1Affiliation,
          includeFlag(vowel2Name),
          vowel2Name,
          vowel2Affiliation,
          includeFlag(vowel3Name),
          vowel3Name,
          vowel3Affiliation,
          date,
          currentPersonName);
    } else {
      return getMessage(
          BODY_KEY,
          year,
          degreeName,
          studentName,
          studentNumber,
          presidentName,
          presidentAffiliation,
          orientatorName,
          orientatorAffiliation,
          includeFlag(coorientatorName),
          coorientatorName,
          coorientatorAffiliation,
          includeFlag(vowel1Name),
          vowel1Name,
          vowel1Affiliation,
          includeFlag(vowel2Name),
          vowel2Name,
          vowel2Affiliation,
          includeFlag(vowel3Name),
          vowel3Name,
          vowel3Affiliation,
          date,
          currentPersonName);
    }
  }