Ejemplo n.º 1
0
  private void setProjectBean(HttpServletRequest request) {
    pb.setProjectname(request.getParameter("projectname"));
    pb.setTraining(request.getParameter("training"));
    pb.setEducation(request.getParameter("education"));
    pb.setOutreach(request.getParameter("outreach"));
    pb.setObserving(request.getParameter("observing"));
    pb.setDataservices(request.getParameter("dataservices"));
    pb.setVariability(request.getParameter("variability"));
    pb.setOperational(request.getParameter("operational"));
    pb.setResearch(request.getParameter("research"));
    pb.setVhistorical(request.getParameter("vhistorical"));
    pb.setVprojections(request.getParameter("vprojections"));
    pb.setAsurface(request.getParameter("asurface"));
    pb.setUpperair(request.getParameter("upperair"));
    pb.setComposition(request.getParameter("composition"));
    pb.setOsurface(request.getParameter("osurface"));
    pb.setSubsurface(request.getParameter("subsurface"));
    pb.setTerrestrial(request.getParameter("terrestrial"));
    pb.setSeasonal(request.getParameter("seasonal"));
    pb.setAnnual(request.getParameter("annual"));
    pb.setDecadal(request.getParameter("decadal"));
    pb.setEffect(request.getParameter("effect"));
    pb.setImpacts(request.getParameter("impacts"));
    pb.setEhistorical(request.getParameter("ehistorical"));
    pb.setEprojections(request.getParameter("eprojections"));
    pb.setAdaptation(request.getParameter("adaptation"));
    pb.setPhs(request.getParameter("phs"));
    pb.setFwr(request.getParameter("fwr"));
    pb.setEne(request.getParameter("ene"));
    pb.setTcc(request.getParameter("tcc"));
    pb.setCpd(request.getParameter("cpd"));
    pb.setScr(request.getParameter("scr"));
    pb.setAfi(request.getParameter("afi"));
    pb.setRat(request.getParameter("rat"));
    pb.setEco(request.getParameter("eco"));
    pb.setOth(request.getParameter("oth"));
    pb.setGuidance(request.getParameter("guidance"));
    pb.setGvariability(request.getParameter("gvariability"));
    pb.setGeffects(request.getParameter("geffects"));
    pb.setApps(request.getParameter("apps"));
    pb.setAvariability(request.getParameter("avariability"));
    pb.setAeffects(request.getParameter("aeffects"));
    pb.setPolicies(request.getParameter("policies"));
    pb.setAssessment(request.getParameter("assessment"));
    pb.setFresh(request.getParameter("fresh"));
    pb.setCoastal(request.getParameter("coastal"));
    pb.setMarine(request.getParameter("marine"));
    pb.setCentral(request.getParameter("central"));
    pb.setHawaii(request.getParameter("hawaii"));
    pb.setBig(request.getParameter("big"));
    pb.setMaui(request.getParameter("maui"));
    pb.setOahu(request.getParameter("oahu"));
    pb.setKauai(request.getParameter("kauai"));
    pb.setHother(request.getParameter("hother"));
    pb.setWestern(request.getParameter("western"));
    pb.setGuam(request.getParameter("guam"));
    pb.setCnmi(request.getParameter("cnmi"));
    pb.setFsm(request.getParameter("fsm"));
    pb.setRmi(request.getParameter("rmi"));
    pb.setPalau(request.getParameter("palau"));
    pb.setWother(request.getParameter("wother"));
    pb.setSouth(request.getParameter("south"));
    pb.setAsam(request.getParameter("asam"));
    pb.setSamoa(request.getParameter("samoa"));
    pb.setTonga(request.getParameter("tonga"));
    pb.setFiji(request.getParameter("fiji"));
    pb.setOz(request.getParameter("oz"));
    pb.setNz(request.getParameter("nz"));
    pb.setFp(request.getParameter("fp"));
    pb.setSother(request.getParameter("sother"));
    pb.setOtherregions(request.getParameter("otherregions"));
    pb.setStatus(request.getParameter("status"));
    pb.setLeadagencies(request.getParameterValues("leadagencies"));
    pb.setPartneragencies(request.getParameterValues("partneragencies"));
    pb.setProjectdescription(request.getParameter("projectdescription"));
    pb.setWorksheetfilename(request.getParameter("worksheetfilename"));
    pb.setTag(request.getParameter("tag"));
    pb.setCode(request.getParameter("code"));

    // separately handle contacts, email until figure out a better more efficient
    // way of passing names, emails as arrays to be picked up by request.getParameterValues...

    String[] contacts = new String[3];
    String[] emails = new String[3];

    contacts[0] = StringUtils.trimToEmpty(request.getParameter("contact1"));
    // System.out.println("AddProjectServlet.setProjectBean contacts[0] set to " + contacts[0] );
    contacts[1] = StringUtils.trimToEmpty(request.getParameter("contact2"));
    // System.out.println("AddProjectServlet.setProjectBean contacts[1] set to " + contacts[1] );
    contacts[2] = StringUtils.trimToEmpty(request.getParameter("contact3"));
    // System.out.println("AddProjectServlet.setProjectBean contacts[2] set to " + contacts[2] );

    emails[0] = StringUtils.trimToEmpty(request.getParameter("email1"));
    // System.out.println("AddProjectServlet.setProjectBean emails[0] set to " + emails[0] );
    emails[1] = StringUtils.trimToEmpty(request.getParameter("email2"));
    // System.out.println("AddProjectServlet.setProjectBean emails[1] set to " + emails[1] );
    emails[2] = StringUtils.trimToEmpty(request.getParameter("email3"));
    // System.out.println("AddProjectServlet.setProjectBean emails[2] set to " + emails[2] );

    pb.setContactName(contacts);
    pb.setEmailsAddress(emails);
    pb.setContactList();
    // System.out.println("Project " + pb.getProjectnumber() + ", " + pb.getProjectname() + "
    // contacts and emails have been set from request parameters " );
    // System.out.println("Contacts = " + pb.getContacts(""));

  }