Package ch.bsgroup.scrumit.utils

Examples of ch.bsgroup.scrumit.utils.ResourceNotFoundException


  @RequestMapping(value="{projectid}/", method=RequestMethod.GET)
  public @ResponseBody SerializableProject getProjectById(@PathVariable int projectid) {
    Project p = this.projectService.findProjectById(projectid);
    if (p == null) {
      throw new ResourceNotFoundException(projectid);
    }
    return new SerializableProject(p.getId(), p.getName(), p.getDescription(), p.getCreationDate());
  }
View Full Code Here


 
  @RequestMapping(value="person/{personid}/", method=RequestMethod.GET)
  public @ResponseBody SerializablePerson getPersonById(@PathVariable int personid) {
    Person p = this.personService.findPersonById(personid);
    if (p == null) {
      throw new ResourceNotFoundException(personid);
    }
    return new SerializablePerson(p.getId(), p.getFirstName(), p.getLastName(), p.getEmail());
  }
View Full Code Here

  @RequestMapping(value="{projectid}/", method=RequestMethod.GET)
  public String getSprintUserstory(@PathVariable("projectid") int id, Model model) {
    Project p = this.projectService.findProjectById(id);
    if (p == null) {
      throw new ResourceNotFoundException(id);
    }
    model.addAttribute("projectid", id);
    model.addAttribute("projectname", p.getName());
    return "sprint/sprint-userstory";
  }
View Full Code Here

  @RequestMapping(value="sprint/{sprintid}/", method=RequestMethod.GET)
  public @ResponseBody SerializableSprint getSprint(@PathVariable int sprintid) {
    Sprint s = this.sprintService.findSprintById(sprintid);
    if (s == null) {
      throw new ResourceNotFoundException(sprintid);
    }
    return new SerializableSprint(s.getId(), s.getSlogan(), s.getStartDate(), s.getEndDate());
  }
View Full Code Here

  @RequestMapping(value="userstory/{userstoryid}/", method=RequestMethod.GET)
  public @ResponseBody SerializableUserStory getUserstory(@PathVariable int userstoryid) {
    UserStory u = this.userStoryService.findUserStoryById(userstoryid);
    if (u == null) {
      throw new ResourceNotFoundException(userstoryid);
    }
    return new SerializableUserStory(u.getId(), u.getName(), u.getPriority(), u.getCreationDate(),
        u.getEstimatedSize(), u.getAcceptanceTest());
  }
View Full Code Here

  @RequestMapping(value="add/{projectid}/", method=RequestMethod.POST)
  public @ResponseBody Map<String, ? extends Object> addSprint(@RequestBody Sprint s, @PathVariable int projectid, HttpServletResponse response) throws ParseException {
    Project p = this.projectService.findProjectById(projectid);
    if (p == null) {
      throw new ResourceNotFoundException(projectid);
    }
    s.setProject(p);
    Set<ConstraintViolation<Sprint>> failures = validator.validate(s);
    if (!failures.isEmpty()) {
      response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
View Full Code Here

  @RequestMapping(value="add/userstory/{sprintid}/", method=RequestMethod.POST)
  public @ResponseBody Map<String, ? extends Object> addUserstory(@PathVariable int sprintid, @RequestBody UserStory u, HttpServletResponse response) {
    Sprint sprint = this.sprintService.findSprintById(sprintid);
    if (sprint == null) {
      throw new ResourceNotFoundException(sprintid);
    }
    u.setName(u.getName().trim());
    u.setAcceptanceTest(u.getAcceptanceTest().trim());
    u.setCreationDate(new Date());
    Set<ConstraintViolation<UserStory>> failures = validator.validate(u);
View Full Code Here

  public String getBoard(@PathVariable("projectid") int pid, @PathVariable("sprintid") int sid, Model model) {
    model.addAttribute("projectid", pid);
    model.addAttribute("sprintid", sid);
    Project p = this.projectService.findProjectById(pid);
    if (p == null) {
      throw new ResourceNotFoundException(pid);
    }
    model.addAttribute("projectname", p.getName());
    Sprint s = this.sprintService.findSprintById(sid);
    if (s == null) {
      throw new ResourceNotFoundException(sid);
    }
    model.addAttribute("sprintslogan", s.getSlogan());
    return "board/board";
  }
View Full Code Here

  @RequestMapping(value="add/task/{userstoryid}/{sprintid}/", method=RequestMethod.POST)
  public @ResponseBody SerializableTask addTask(@PathVariable Integer userstoryid, @PathVariable int sprintid, @RequestBody Task t) {
    UserStory u = this.userStoryService.findUserStoryById(userstoryid);
    if (u == null) {
      throw new ResourceNotFoundException(userstoryid);
    }
    t.setUserStory(u);
    t.setCreationDate(new Date());
    Task task = this.taskService.addTask(t);
    this.burnDownChartService.updateBurnDown(task.getDuration(), 0, sprintid);
View Full Code Here

  @RequestMapping(value="task/updatecoord/{sprintid}/", method=RequestMethod.POST)
  public @ResponseBody void updateTaskCoord(@PathVariable int sprintid, @RequestBody Task t) {
    Task task = this.taskService.findTaskById(t.getId());
    if (task == null) {
      throw new ResourceNotFoundException(t.getId());
    }
    task.setxCoord(t.getxCoord());
    task.setyCoord(t.getyCoord());
    if (task.getStatus() != t.getStatus()) {
      // status change
View Full Code Here

TOP

Related Classes of ch.bsgroup.scrumit.utils.ResourceNotFoundException

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.