Ejemplo n.º 1
0
  @RequestMapping(
      value = RequestTarget.STORY_CREATE,
      method = {RequestMethod.POST})
  public String create(
      @ModelAttribute(ModelConstants.STORY) @Valid StoryForm form, BindingResult result) {
    if (result.hasErrors()) {
      return RequestTarget.STORY_CREATE;
    }

    Story story = form.asStory();
    projectService.createStory(story);
    return "redirect:" + RequestTarget.PROJECT_SHOW + "/" + story.getProject().getId();
  }
Ejemplo n.º 2
0
 @RequestMapping(RequestTarget.STORY_START + "/" + RequestConstants.ID)
 public String start(@PathVariable String id) {
   Story story = projectService.loadStoryWithProject(id);
   projectService.startStory(story);
   return redirect(RequestTarget.PROJECT_SHOW + "/" + story.getProject().getId());
 }