示例#1
0
 public static Candidacy readByCandidacyNumber(Integer candidacyNumber) {
   for (Candidacy candidacy : Bennu.getInstance().getCandidaciesSet()) {
     if (candidacy.getNumber().equals(candidacyNumber)) {
       return candidacy;
     }
   }
   return null;
 }
示例#2
0
 public final Integer createCandidacyNumber() {
   if (Bennu.getInstance().getCandidaciesSet().size() == 0) {
     return Integer.valueOf(1);
   }
   Candidacy candidacy =
       Collections.max(Bennu.getInstance().getCandidaciesSet(), new BeanComparator("number"));
   return candidacy.getNumber() + 1;
 }
示例#3
0
 public static Set<Candidacy> readCandidaciesBetween(final Integer from, final Integer to) {
   final Set<Candidacy> result = new HashSet<Candidacy>();
   for (final Candidacy candidacy : Bennu.getInstance().getCandidaciesSet()) {
     if (candidacy.getNumber() >= from && candidacy.getNumber() <= to) {
       result.add(candidacy);
     }
   }
   return result;
 }
  private Candidacy getCandidacy(HttpServletRequest request) {
    final String candidacyID = request.getParameter("candidacyID");
    for (final Candidacy candidacy : getUserView(request).getPerson().getCandidaciesSet()) {
      if (candidacy.getExternalId().equals(candidacyID)) {
        return candidacy;
      }
    }

    return null;
  }
  public ActionForward viewDetail(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    final Candidacy candidacy = getCandidacy(request);
    request.setAttribute(
        "canChangePersonalData", candidacy.getActiveCandidacySituation().canChangePersonalData());
    request.setAttribute("candidacy", candidacy);

    return mapping.findForward("viewDetail");
  }
  private void fillRequest(HttpServletRequest request, Candidacy candidacy) {
    if (RenderUtils.getViewState("candidacyDocuments") != null) {
      RenderUtils.invalidateViewState("candidacyDocuments");
    }
    List<CandidacyDocumentUploadBean> candidacyDocuments =
        new ArrayList<CandidacyDocumentUploadBean>();
    for (CandidacyDocument candidacyDocument : candidacy.getCandidacyDocuments()) {
      candidacyDocuments.add(new CandidacyDocumentUploadBean(candidacyDocument));
    }

    request.setAttribute("candidacyDocuments", candidacyDocuments);
    request.setAttribute("candidacy", candidacy);
  }