Package org.sonatype.mavenbook.weather.model

Examples of org.sonatype.mavenbook.weather.model.Location


    weatherDAO.save( weather );
    System.out.print(new WeatherFormatter().formatWeather(weather));
  }

  public void getHistory() throws Exception {
    Location location = locationDAO.findByZip(zip);
    List<Weather> weathers = weatherDAO.recentForLocation(location);
    System.out.print(new WeatherFormatter().formatHistory(location, weathers));
  }
View Full Code Here


  private WeatherDAO weatherDAO;

  public ModelAndView handleRequest(HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    String zip = request.getParameter("zip");
    Location location = locationDAO.findByZip(zip);
    List<Weather> weathers = weatherDAO.recentForLocation( location );
   
    Map<String,Object> model = new HashMap<String,Object>();
    model.put( "location", location );
    model.put( "weathers", weathers );
View Full Code Here

  log.info( "Creating XML Reader" );
  SAXReader xmlReader = createXmlReader();
  Document doc = xmlReader.read( inputStream );
 
  log.info( "Parsing XML Response" );
  Location location = new Location();
  location.setCity( doc.valueOf("/rss/channel/y:location/@city") );
  location.setRegion( doc.valueOf("/rss/channel/y:location/@region") );
  location.setCountry( doc.valueOf("/rss/channel/y:location/@country") );
  location.setZip( zip );
  weather.setLocation( location );

  Condition condition = new Condition();
  condition.setText( doc.valueOf("/rss/channel/item/y:condition/@text") );
  condition.setTemp( doc.valueOf("/rss/channel/item/y:condition/@temp") );
View Full Code Here

TOP

Related Classes of org.sonatype.mavenbook.weather.model.Location

Copyright © 2018 www.massapicom. 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.