예제 #1
0
  @Atomic
  public static void run(
      DegreeCurricularPlan degreeCurricularPlan, Thesis thesis, PersonChange change)
      throws FenixServiceException {
    Person person = getPerson(change);

    if (!AccessControl.getPerson().hasRole(RoleType.SCIENTIFIC_COUNCIL)) {
      thesis.checkIsScientificCommission();
    }

    switch (change.type) {
      case orientator:
        thesis.setOrientator(person);
        break;
      case coorientator:
        thesis.setCoorientator(person);
        break;
      case president:
        thesis.setPresident(person);
        break;
      case vowel:
        if (change.target != null) {
          change.target.delete();
          if (person != null) {
            thesis.addVowel(person);
          }
        } else {
          if (person != null) {
            thesis.addVowel(person);
          }
        }

        break;
    }
  }
예제 #2
0
  @Atomic
  public static void remove(final ThesisEvaluationParticipant thesisEvaluationParticipant) {
    final Thesis thesis = thesisEvaluationParticipant.getThesis();
    if (!AccessControl.getPerson().hasRole(RoleType.SCIENTIFIC_COUNCIL)) {
      thesis.checkIsScientificCommission();
    }
    final ThesisParticipationType type = thesisEvaluationParticipant.getType();
    thesisEvaluationParticipant.delete();

    if (!thesis.isCreditsDistributionNeeded()) {
      thesis.setCoorientatorCreditsDistribution(null);
    }
  }
예제 #3
0
  @Atomic
  public static void add(
      final Thesis thesis,
      final ThesisParticipationType thesisParticipationType,
      final Person person) {
    if (person != null) {
      if (!AccessControl.getPerson().hasRole(RoleType.SCIENTIFIC_COUNCIL)) {
        thesis.checkIsScientificCommission();
      }

      new ThesisEvaluationParticipant(thesis, person, thesisParticipationType);

      if (!thesis.isCreditsDistributionNeeded()) {
        thesis.setCoorientatorCreditsDistribution(null);
      }
    }
  }