コード例 #1
0
ファイル: PhdGuidersReport.java プロジェクト: joantune/fenix
  private void fillParticipant(
      String guiderRole,
      final PhdIndividualProgramProcess process,
      PhdParticipant phdParticipant,
      HSSFRow row) {
    String processNumber = process.getProcessNumber();
    String studentNumber =
        process.getStudent() != null ? process.getStudent().getNumber().toString() : "";
    String studentName = process.getPerson().getName();

    String participantName = phdParticipant.getName();
    String institution = phdParticipant.getWorkLocation();

    addCellValue(row, onNullEmptyString(processNumber), 0);
    addCellValue(row, onNullEmptyString(studentNumber), 1);
    addCellValue(row, onNullEmptyString(studentName), 2);
    addCellValue(row, onNullEmptyString(participantName), 3);
    addCellValue(row, onNullEmptyString(guiderRole), 4);
    addCellValue(row, onNullEmptyString(institution), 5);

    if (!phdParticipant.isTeacher()) {
      addCellValue(row, onNullEmptyString(null), 6);
      addCellValue(row, onNullEmptyString(null), 7);
      addCellValue(row, onNullEmptyString(null), 8);
    } else {
      InternalPhdParticipant internalPhdParticipant = (InternalPhdParticipant) phdParticipant;
      Teacher teacher = internalPhdParticipant.getTeacher();

      addCellValue(row, onNullEmptyString(teacher.getTeacherId()), 6);
      Department department = internalPhdParticipant.getDepartment();

      addCellValue(row, onNullEmptyString(department != null ? department.getCode() : ""), 7);
      addCellValue(row, onNullEmptyString(department != null ? department.getName() : ""), 8);
    }
  }
コード例 #2
0
  private String buildGuidingsInformation(final Collection<PhdParticipant> guidings) {
    final StringBuilder result = new StringBuilder();
    List<PhdParticipant> guidingsList = new ArrayList<>(guidings);
    for (int i = 0; i < guidingsList.size(); i++) {
      final PhdParticipant guiding = guidingsList.get(i);
      result.append(guiding.getNameWithTitle());
      if (i == guidings.size() - 2) {
        result.append(" ").append(getMessageFromResource("label.and")).append(" ");
      } else {
        result.append(", ");
      }
    }

    if (result.length() > 0) {
      if (result.toString().endsWith(getMessageFromResource("label.and"))) {
        return result.substring(0, result.length() - getMessageFromResource("label.and").length());
      }

      if (result.toString().endsWith(", ")) {
        return result.substring(0, result.length() - 2);
      }
    }

    return result.toString();
  }
コード例 #3
0
  private void createExternalAccess(final ThesisJuryElement juryElement) {

    final PhdParticipant participant = juryElement.getParticipant();
    participant.addAccessType(PhdProcessAccessType.JURY_DOCUMENTS_DOWNLOAD);

    if (juryElement.getReporter().booleanValue()) {
      participant.addAccessType(PhdProcessAccessType.JURY_REPORTER_FEEDBACK_UPLOAD);
    }
  }
コード例 #4
0
 private static void drawGuiding(final Page page, final PhdParticipant guiding)
     throws IOException {
   page.tableStart("tstyle2 thwhite thnowrap thlight thleft thtop ulnomargin ");
   page.rowStart()
       .headerStartWithStyle("width: 125px;")
       .write("Name:")
       .headerEnd()
       .column(guiding.getName())
       .rowEnd();
   page.rowStart().header("Affiliation:").column(guiding.getWorkLocation()).rowEnd();
   page.rowStart().header("Email:").column(guiding.getEmail()).rowEnd();
   page.tableEnd();
 }
コード例 #5
0
  public ActionForward prepareDownloadDocuments(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    final PhdParticipant participant = getPhdParticipant(request);

    if (participant == null) {
      return null;
    }

    request.setAttribute("process", participant.getIndividualProcess());

    return mapping.findForward("downloadDocuments");
  }
コード例 #6
0
  private void sendAlertToJuryElement(
      PhdIndividualProgramProcess process,
      ThesisJuryElement thesisJuryElement,
      String bodyMessage) {
    PhdParticipant participant = thesisJuryElement.getParticipant();

    if (!participant.isInternal()) {
      createExternalAccess(thesisJuryElement);
      participant.ensureExternalAccess();
    }
    final AlertMessage subject =
        AlertMessage.create(
                AlertMessage.get(
                    "message.phd.request.jury.reviews.external.access.subject",
                    process.getPhdProgram().getName()))
            .isKey(false)
            .withPrefix(false);

    final AlertMessage body =
        AlertMessage.create(
                AlertMessage.get(
                        bodyMessage, process.getPerson().getName(), process.getProcessNumber())
                    + "\n\n"
                    + getAccessInformation(
                        process,
                        participant,
                        "message.phd.request.jury.reviews.coordinator.access",
                        "message.phd.request.jury.reviews.teacher.access")
                    + "\n\n"
                    + AlertMessage.get(
                        "message.phd.request.jury.external.access.reviews.body",
                        getDaysLeftForReview(process.getThesisProcess())))
            .isKey(false)
            .withPrefix(false);

    AlertService.alertParticipants(process, subject, body, participant);
  }