/*
 * The MIT License
 *
 * Copyright 2014 Mikko Oksa.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package controllers;

import com.google.inject.Singleton;
import ninja.Result;
import ninja.Results;

@Singleton
public class DogParkController {

	public Result index() {
		return Results.html();
	}

}

@@ -1127,17 +1127,16 @@
 RE.%0A */%0A
-%0A
 package 
@@ -1164,31 +1164,288 @@
 com.
-google.inject.Singleton
+avaje.ebean.EbeanServer;%0Aimport com.avaje.ebean.annotation.Transactional;%0Aimport com.google.common.collect.Lists;%0Aimport com.google.inject.Inject;%0Aimport com.google.inject.Singleton;%0Aimport java.util.List;%0Aimport java.util.logging.Logger;%0Aimport models.City;%0Aimport models.DogPark
 ;%0Aim
@@ -1485,16 +1485,44 @@
 esults;%0A
+import ninja.params.Param;%0A%0A
 %0A@Single
@@ -1565,53 +1565,1228 @@
 %0A%0A%09p
-ublic Result index() %7B%0A%09%09return Results.html(
+rivate final Logger logger;%0A%09private final EbeanServer ebeanServer;%0A%0A%09@Inject%0A%09public DogParkController(Logger logger, EbeanServer ebeanServer) %7B%0A%09%09this.logger = logger;%0A%09%09this.ebeanServer = ebeanServer;%0A%09%7D%0A%0A%09public Result index() %7B%0A%09%09return Results.html();%0A%09%7D%0A%0A%09public Result dogparkList() %7B%0A%09%09List%3CCity%3E cities = ebeanServer.find(City.class).fetch(City.FETCH_DOGPARKS).findList();%0A%09%09return Results.html().render(%22cities%22, cities);%0A%09%7D%0A%0A%09public Result dogpark(@Param(%22id%22) Long dogParkId) %7B%0A%09%09if (dogParkId == null) %7B%0A%09%09%09return Results.html().template(%22views/system/404notFound.ftl.html%22);%0A%09%09%7D%0A%0A%09%09DogPark dogPark = ebeanServer.find(DogPark.class, dogParkId);%0A%09%09if (dogPark != null) %7B%0A%09%09%09return Results.html().render(%22dogPark%22, dogPark);%0A%09%09%7D else %7B%0A%09%09%09return Results.html().template(%22views/system/404notFound.ftl.html%22);%0A%09%09%7D%0A%09%7D%0A%0A%09@Transactional%0A%09public Result setupTables() %7B%0A%09%09City kuopio = new City(%22Kuopio%22);%0A%09%09List%3CDogPark%3E kuopioDogParks = Lists.newArrayList(%0A%09%09%09%09new DogPark(%22Neulam%C3%A4en koirapuisto%22, 62.887032, 27.609753, kuopio),%0A%09%09%09%09new DogPark(%22Rypysuon koirapuisto%22, 62.918761, 27.636628, kuopio)%0A%09%09);%0A%09%09ebeanServer.save(kuopio);%0A%09%09ebeanServer.save(kuopioDogParks);%0A%09%09return Results.text().renderRaw(%22Tables ok%22
 );%0A%09

Add controller method for dogpark listing and details