示例#1
0
  private static void drawThesisRanking(
      Page page, PhdProgramPublicCandidacyHashCode hashCode, String email) throws IOException {

    page.h(3, "Thesis Rank", "mtop2");
    final PhdIndividualProgramProcess process = hashCode.getIndividualProgramProcess();

    page.tableStart("tstyle2");

    page.rowStart();
    page.header("Rank");
    page.header("Name");
    page.header("Teacher");
    page.header("Description");
    page.rowEnd();

    Collection<ThesisSubjectOrder> thesisSubjectOrders = process.getThesisSubjectOrdersSorted();

    for (ThesisSubjectOrder thesisSubjectOrder : thesisSubjectOrders) {
      page.rowStart();
      page.column(thesisSubjectOrder.getSubjectOrder().toString());
      page.column(thesisSubjectOrder.getThesisSubject().getName().getContent());
      page.column(
          thesisSubjectOrder.getThesisSubject().getTeacher() != null
              ? thesisSubjectOrder.getThesisSubject().getTeacher().getPerson().getName()
              : "");
      page.rowEnd();
    }

    page.tableEnd();
  }
示例#2
0
  private static void drawDocuments(
      final Page page, final PhdProgramPublicCandidacyHashCode hashCode, final String folderName)
      throws IOException {

    page.h(3, "Documents", "mtop2");

    final PhdIndividualProgramProcess process = hashCode.getIndividualProgramProcess();
    if (!process.getCandidacyProcessDocuments().isEmpty()) {

      final String documentName = folderName + "-documents.zip";
      final String url =
          APPLICATION_PREFIX_LINK
              + "/phd/epfl/applications/candidateDocuments?candidateOid="
              + hashCode.getExternalId();
      page.pStart("mbottom0").link(url, documentName).pEnd();

      page.tableStart("tstyle2 thwhite thnowrap thlight thleft thtop ulnomargin ");
      page.rowStart().header("Document type").header("Upload time").header("Filename").rowEnd();

      for (final PhdProgramProcessDocument document : process.getCandidacyProcessDocuments()) {
        page.rowStart().column(document.getDocumentType().getLocalizedName());
        page.column(document.getUploadTime().toString("dd/MM/yyyy HH:mm"));
        page.column(document.getFilename()).rowEnd();
      }

      page.tableEnd();
    }
  }
示例#3
0
  private static void drawPhdIndividualProgramInformation(
      final Page page, final PhdProgramPublicCandidacyHashCode hashCode) throws IOException {
    final PhdIndividualProgramProcess process = hashCode.getIndividualProgramProcess();

    page.h(3, "Application information");
    page.tableStart("tstyle2 thwhite thnowrap thlight thleft thtop ulnomargin ");
    page.rowStart()
        .headerStartWithStyle("width: 125px;")
        .write("Candidacy Date:")
        .headerEnd()
        .column(process.getCandidacyDate().toString("dd/MM/yyyy"))
        .rowEnd();
    page.rowStart()
        .header("Area:")
        .column(process.getPhdProgramFocusArea().getName().getContent())
        .rowEnd();
    page.rowStart()
        .header(Unit.getInstitutionAcronym() + " Phd Program:")
        .column(process.getPhdProgram().getName().getContent(MultiLanguageString.en))
        .rowEnd();
    if (process.getExternalPhdProgram() != null) {
      page.rowStart()
          .header("EPFL Phd Program:")
          .column(process.getExternalPhdProgram().getName().getContent(MultiLanguageString.en));
    }
    page.rowStart().header("Title:").column(string(process.getThesisTitle())).rowEnd();
    page.rowStart().header("Collaboration:").column(process.getCollaborationTypeName()).rowEnd();
    page.rowStart().header("Year:").column(process.getExecutionYear().getYear()).rowEnd();
    page.tableEnd();
  }
示例#4
0
  static byte[] drawLetter(final PhdCandidacyReferee referee, final int count) throws IOException {
    final Page page = new Page();

    page.h2(APPLICATION_NAME);
    page.h(3, "Applicant", "mtop2");

    candidateInformation(referee, page);
    letterInformation(referee, page);

    page.close();
    return page.toByteArray();
  }
示例#5
0
  private static void drawGuidings(
      final Page page, final PhdProgramPublicCandidacyHashCode hashCode) throws IOException {
    final PhdIndividualProgramProcess process = hashCode.getIndividualProgramProcess();
    page.h(3, "Phd supervisors (if applicable)", "mtop2");

    if (!process.getGuidingsSet().isEmpty()) {
      int count = 1;
      for (final PhdParticipant guiding : process.getGuidingsSet()) {
        page.pStart("mbottom0").strong(String.valueOf(count) + ". ").pEnd();
        drawGuiding(page, guiding);
        count++;
      }
    } else {
      page.pStart().write("Not defined").pEnd();
    }
  }
示例#6
0
  private static void drawQualifications(
      final Page page, final PhdProgramPublicCandidacyHashCode hashCode) throws IOException {
    final PhdIndividualProgramProcess process = hashCode.getIndividualProgramProcess();
    page.h(3, "Academic Degrees", "mtop2");

    if (!process.getQualifications().isEmpty()) {
      int count = 1;
      for (final Qualification qualification : process.getQualifications()) {
        page.pStart("mbottom0").strong(String.valueOf(count) + ". ").pEnd();
        drawQualification(page, qualification);
        count++;
      }
    } else {
      page.pStart().write("Not defined").pEnd();
    }
  }
示例#7
0
  private static void drawCandidacyReferees(
      final Page page, final PhdProgramPublicCandidacyHashCode hashCode, final String folderName)
      throws IOException {
    final PhdIndividualProgramProcess process = hashCode.getIndividualProgramProcess();
    page.h(3, "Reference letters (referees)", "mtop2");

    if (!process.getPhdCandidacyReferees().isEmpty()) {
      int count = 1;
      for (final PhdCandidacyReferee referee : process.getPhdCandidacyReferees()) {
        page.pStart("mbottom0").strong(String.valueOf(count) + ". ").pEnd();
        drawReferee(page, referee, count, folderName);
        count++;
      }
    } else {
      page.pStart().write("Not defined").pEnd();
    }
  }
示例#8
0
  static byte[] exportPresentationPage() throws IOException {
    List<PhdProgramPublicCandidacyHashCode> unfocusAreaCandidates =
        new ArrayList<PhdProgramPublicCandidacyHashCode>();

    final Page page = new Page();
    page.h2(APPLICATION_NAME);

    for (final Entry<PhdProgramFocusArea, Set<PhdProgramPublicCandidacyHashCode>> entry :
        getApplicants(unfocusAreaCandidates).entrySet()) {
      page.h(3, getFocusAreaTitle(entry), "mtop2");

      page.ulStart();
      for (final PhdProgramPublicCandidacyHashCode code : entry.getValue()) {
        final String url =
            APPLICATION_PREFIX_LINK + "/phd/epfl/applications/show?process=" + code.getValue();
        page.liStart().link(url, code.getPerson().getName()).liEnd();
      }
      page.ulEnd();
    }

    page.close();

    return page.toByteArray();
  }
示例#9
0
  private static void letterInformation(final PhdCandidacyReferee referee, final Page page)
      throws IOException {

    final PhdCandidacyRefereeLetter letter = referee.getLetter();

    page.h(3, "Reference Letter", "mtop2");
    page.tableStart("tstyle2 thwhite thnowrap thlight thleft thtop ulnomargin");

    page.rowStart()
        .headerStartWithStyle("width: 200px;")
        .write("How long have you known the applicant?")
        .headerEnd()
        .column(string(letter.getHowLongKnownApplicant()) + " months")
        .rowEnd();
    page.rowStart().header("In what capacity?").column(string(letter.getCapacity())).rowEnd();
    page.rowStart()
        .header("Comparison group:")
        .column(string(letter.getComparisonGroup()))
        .rowEnd();
    page.rowStart()
        .header("Rank in class (if applicable):")
        .column(string(letter.getRankInClass()))
        .rowEnd();
    page.rowStart()
        .header("Academic performance:")
        .column(string(letter.getAcademicPerformance().getLocalizedName()))
        .rowEnd();
    page.rowStart()
        .header("Social and Communication Skills:")
        .column(string(letter.getSocialAndCommunicationSkills().getLocalizedName()))
        .rowEnd();
    page.rowStart()
        .header("Potential to excel in a PhD:")
        .column(string(letter.getPotencialToExcelPhd().getLocalizedName()))
        .rowEnd();

    page.rowStart().header("Recomendation letter:");
    if (letter.getFile() != null) {
      page.column(letter.getFile().getDisplayName() + " (file is inside documents zip file)");
    } else {
      page.column("-");
    }
    page.rowEnd();

    page.rowStart().header("Comments:").column(string(letter.getComments())).rowEnd();
    page.rowStart().header("Name:").column(string(letter.getRefereeName())).rowEnd();
    page.rowStart().header("Position/Title:").column(string(letter.getRefereePosition())).rowEnd();
    page.rowStart().header("Institution:").column(string(letter.getRefereeInstitution())).rowEnd();
    page.rowStart().header("Address:").column(string(letter.getRefereeInstitution())).rowEnd();
    page.rowStart().header("City:").column(string(letter.getRefereeCity())).rowEnd();
    page.rowStart().header("Zip code:").column(string(letter.getRefereeZipCode())).rowEnd();
    page.rowStart()
        .header("Country:")
        .column(
            letter.getRefereeCountry() != null
                ? letter.getRefereeCountry().getLocalizedName().getContent()
                : "-")
        .rowEnd();
    page.rowStart().header("Email:").column(string(letter.getRefereeEmail())).rowEnd();

    page.tableEnd();
  }
示例#10
0
  private static void drawPersonalInformation(
      final Page page, final PhdProgramPublicCandidacyHashCode hashCode, final String folderName)
      throws IOException {

    final Person person = hashCode.getPerson();

    page.h(3, "Personal Information", "mtop2");
    page.tableStart("tstyle2 thwhite thnowrap thlight thleft thtop ulnomargin ");

    page.rowStart("tdbold")
        .headerStartWithStyle("width: 125px;")
        .write("Name:")
        .headerEnd()
        .column(person.getName())
        .rowEnd();
    page.rowStart()
        .header("Gender:")
        .column(person.getGender().toLocalizedString(Locale.ENGLISH))
        .rowEnd();
    page.rowStart()
        .header("Identity card type:")
        .column(person.getIdDocumentType().getLocalizedName())
        .rowEnd();
    page.rowStart().header("Identity card #:").column(person.getDocumentIdNumber()).rowEnd();
    page.rowStart().header("Issued by:").column(person.getEmissionLocationOfDocumentId()).rowEnd();
    page.rowStart()
        .header("Fiscal number:")
        .column(string(person.getSocialSecurityNumber()))
        .rowEnd();
    page.rowStart()
        .header("Date of birth:")
        .column(person.getDateOfBirthYearMonthDay().toString("dd/MM/yyyy"))
        .rowEnd();
    page.rowStart().header("Birthplace:").column(person.getDistrictSubdivisionOfBirth()).rowEnd();
    page.rowStart()
        .header("Nationality:")
        .column(person.getCountry().getCountryNationality().getContent())
        .rowEnd();
    page.rowStart().header("Address:").column(person.getAddress()).rowEnd();
    page.rowStart().header("City:").column(person.getArea()).rowEnd();
    page.rowStart().header("Zip code:").column(person.getAreaCode()).rowEnd();
    page.rowStart()
        .header("Country:")
        .column(
            (person.getCountryOfResidence() != null
                ? person.getCountryOfResidence().getName()
                : "-"))
        .rowEnd();
    page.rowStart().header("Phone:").column(person.getDefaultPhoneNumber()).rowEnd();
    page.rowStart().header("Mobile:").column(person.getDefaultMobilePhoneNumber()).rowEnd();
    page.rowStart().header("Email:").column(person.getDefaultEmailAddressValue()).rowEnd();

    page.tableEnd();

    page.h(3, "Photo");
    String photoUrl = APPLICATION_PREFIX_LINK + "/phd/epfl/applications/photo";
    final Photograph photo = person.getPersonalPhotoEvenIfPending();
    if (photo != null) {
      photoUrl += "?photoOid=" + photo.getExternalId();
    }
    page.photo(photoUrl);
  }