Examples of StudyRegion


Examples of org.worldbank.transport.tamt.shared.StudyRegion

                gpsTrace.setId("TEMP");
                gpsTrace.setName(nameValue);
                gpsTrace.setDescription(descriptionValue);
               
                // add a study region with an id
                StudyRegion studyRegion = new StudyRegion();
                studyRegion.setId(studyRegionId);
                gpsTrace.setRegion(studyRegion);
                gpsTraceAPI.saveGPSTrace(gpsTrace, uploadedFile);
               
                // if it doesn't get thrown, then return 200
                resp.setStatus(HttpServletResponse.SC_OK);
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

   
    if ( region == null ) // possible on initial load
    {
      ArrayList<StudyRegion> regions = regionDAO.getStudyRegions();
      for (Iterator iterator = regions.iterator(); iterator.hasNext();) {
        StudyRegion studyRegion = (StudyRegion) iterator.next();
        if(studyRegion.isCurrentRegion())
        {
          region = studyRegion;
          break;
        }
      }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

    ArrayList<ZoneDetails> zoneDetails = new ArrayList<ZoneDetails>();
    if ( region == null )
    {
      ArrayList<StudyRegion> regions = regionDAO.getStudyRegions();
      for (Iterator iterator = regions.iterator(); iterator.hasNext();) {
        StudyRegion studyRegion = (StudyRegion) iterator.next();
        if(studyRegion.isCurrentRegion())
        {
          region = studyRegion;
          break;
        }
      }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

     
      // cleans up analysis tables and supporting tables
      dao.deleteAnalysisAndSupportRecords(studyRegionId);
     
      // create a StudyRegion to be used in deleting other entities
      StudyRegion region = new StudyRegion();
      region.setId(studyRegionId);
     
      // delete gps traces (including gpsfiles and gpspoints)
      ArrayList<GPSTrace> gpsTraces = gpsTraceDAO.getGPSTraces(region);
      ArrayList<String> gpsTraceIds = new ArrayList<String>();
      for (Iterator iterator = gpsTraces.iterator(); iterator.hasNext();) {
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

    return dao.getStudyRegions();
  }
 
  public StudyRegion getCurrentStudyRegion() throws Exception {
    ArrayList<StudyRegion> regions = getStudyRegions();
    StudyRegion currentStudyRegion = null;
    for (Iterator iterator = regions.iterator(); iterator.hasNext();) {
      StudyRegion studyRegion = (StudyRegion) iterator.next();
      if( studyRegion.isCurrentRegion())
      {
        currentStudyRegion = studyRegion;
        break;
      }
    }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

    Vertex mapCenterVertex = studyRegion.getMapCenter();
    logger.debug("mapCenter=" + studyRegion.getMapCenter());
    Coordinate mapCenterCoord = new Coordinate(mapCenterVertex.getLng(), mapCenterVertex.getLat());
    Geometry mapCenter = new GeometryFactory().createPoint(mapCenterCoord);
   
    StudyRegion savedStudyRegion = null;
   
    try {
      if( studyRegion.getId().indexOf("TEMP") != -1 )
      {
        // create an id, and save it
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

  }
 
  @Test
  public void validateStudyRegion()
  {
    StudyRegion r = new StudyRegion();
    r.setName("stuartmoffatt");
    logger.debug(r.getName().indexOf(","));
    assertEquals(-1, r.getName().indexOf(","));
  }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

  }
 
  @Test
  public void validateMinimumSoakIntervalEmpty()
  {
    StudyRegion studyRegion = new StudyRegion();
    studyRegion.setMinimumSoakInterval("1");
    if( !studyRegion.getMinimumSoakInterval().matches("[0-9]*") )
    {
      try {
        throw new Exception("Minimum soak interval must be an integer (in seconds)");
      } catch (Exception e) {
        logger.error(e.getMessage());
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

 
 
  @Test
  public void validateUTCOffset()
  {
    StudyRegion studyRegion = new StudyRegion();
    studyRegion.setUtcOffset("12");
    if( !studyRegion.getUtcOffset().matches("^-{0,1}[0-9]*") )
    {
        try {
          throw new Exception("UTC offset must be an integer (in hours)");
        } catch (Exception e) {
          logger.error(e.getMessage());
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.StudyRegion

  }

  @Test
  public void validateStudyRegionBO()
  {
    StudyRegion r = new StudyRegion();
    r.setName("accra, ghana");
    try {
      regionBO.validateStudyRegion(r);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.