package controllers;

import play.mvc.Controller;
import play.mvc.Result;
import models.Task;
import models.UserStory;
import models.UserStoryHandler;
import play.libs.Json;
import play.mvc.BodyParser;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

import java.util.*;

public class Application extends Controller {
    
	public static Result addDataPoint(String i) {
		return ok(views.html.index.render("Hello my framwork"+i));
	}
	@BodyParser.Of(BodyParser.Json.class)
	public static Result index() {
		//JsonNode json = request().body().asJson();
		//ObjectNode result = Json.newObject();
    	//List<UserStory> userStories = UserStoryHandler.loadAllUserStories();
    	//for (UserStory userStory : userStorys) {
    //		System.out.println(userStory);
	//	}
    	return ok(views.html.index.render("Hello my framwork"));
    	//List<Task> tasks = Task.find.all();
     // 	return ok(views.html.index.render("Hello my framwork"));

    }
    public static Result getUserStories() {
    	String userStories = UserStoryHandler.loadAllUserStories();
    	return ok(userStories);
    }
    public static Result getTests(String userStoryName) {
    	//List<Task> tasks = Task.find.all();
    	UserStory userStory = UserStoryHandler.getTests(userStoryName);
    	return ok(Json.toJson(userStory));
    }
}

@@ -1130,24 +1130,29 @@
 ies);%0A    %7D%0A
+    %0A
     public s
@@ -1245,16 +1245,18 @@
 );%0A    %09
+//
 UserStor
@@ -1330,30 +1330,8 @@
  ok(
-Json.toJson(userStory)
 );%0A 

fix compiling error on app