public static void sendModeration(String name, float point) { Task t = new Task(name, point); t.status = TaskStatus.PENDING; t.suggestedBy = SUser.findByEmail(Auth.connected()); t.save(); thanks(); }
/** Create a task */ public static Task create(Integer project, String folder, String title) { Task task = new Task(); task.project = Project.find.ref(project); task.folder = folder; task.title = title; task.save(); return task; }
public static Result newTask() { User user = loadUser(); Form<Task> filledForm = taskForm.bindFromRequest(); if (filledForm.hasErrors()) { flash("error", "The task could not be saved."); return badRequest(main.render("Tasks", null, tasks.render(user.tasks, filledForm))); } else { Task task = filledForm.get(); task.owner = user; task.save(); return created(main.render("Tasks", null, tasks.render(user.tasks, taskForm))); } }
public static void create(Task task) { task.save(); }
/** * Saves a task * * @param storyId */ public static void save(String storyId, JsonObject body) { Task task = gson.fromJson(body, Task.class); task.story = new Key<Story>(Story.class, Long.valueOf(storyId)); task.save(); renderText(gson.toJson(task)); }
// This is actually performing the update and save the object private static void doUpdate(Task toUpdate, JsonObject body) { if (toUpdate != null) { workUnit.updateObject(toUpdate, body); toUpdate.save(); } }
public static Task create(Task task, Long project, String folder) { task.project = Project.find.ref(project); task.folder = folder; task.save(); return task; }