Examples of Todo


Examples of com.arrgsocal.entities.Todo

        request.getRequestDispatcher("/WEB-INF/ToDo/NewToDo.jsp").forward(request, response);
        return;
      }
    }
   
    Todo t = new Todo();
    t.setName(name);
    t.setDescription(description);
    t.setPriority(priority);
    t.setCreatedDate(new Date());
    todoManager.create(t);
    response.sendRedirect("./");
  }
View Full Code Here

Examples of com.dyuproject.demos.deprecated.todolist.model.Todo

       
        String title = request.getParameter(Constants.TITLE);       
        String content = request.getParameter(Constants.CONTENT);
       
        boolean created = false;       
        Todo todo = null;
       
        if(title!=null && title.length()>0)
        {
            todo = new Todo();
            todo.setTitle(title);
            todo.setContent(content);
            todo.setUser(user);           
            created = _todoDao.create(todo);
        }
       
        if(Constants.XML.equals(mime))
        {                    
View Full Code Here

Examples of com.dyuproject.demos.todolist.model.Todo

   
    @HttpResource(location="/todos/$")
    @Get
    public void getById(RequestContext rc) throws IOException, ServletException
    {
        Todo todo = _todoDao.get(Long.valueOf(rc.getPathElement(1)));
        if(todo==null)
        {
            rc.getResponse().sendError(404);
            return;
        }
View Full Code Here

Examples of com.getit.todoapp.domain.Todo

  @RequestMapping(value = "/{id}", method = RequestMethod.PUT, headers = "Accept=application/json")
    public ResponseEntity<String> updateFromJson(@RequestBody String json, @PathVariable("id") Long id) {
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Type", "application/json");
        Todo todo = Todo.fromJsonToTodo(json.toString());
        if (todoService.updateTodo(todo) == null) {
            return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
        }
        return new ResponseEntity<String>(headers, HttpStatus.OK);
    }
View Full Code Here

Examples of com.getit.todoapp.domain.Todo

    }

  @RequestMapping(value = "/{id}", method = RequestMethod.GET, headers = "Accept=application/json")
    @ResponseBody
    public ResponseEntity<String> showJson(@PathVariable("id") Long id) {
        Todo todo = todoService.findTodo(id);
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Type", "application/json; charset=utf-8");
        if (todo == null) {
            return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
        }
        return new ResponseEntity<String>(todo.toJson(), headers, HttpStatus.OK);
    }
View Full Code Here

Examples of com.getit.todoapp.domain.Todo

        return new ResponseEntity<String>(Todo.toJsonArray(result), headers, HttpStatus.OK);
    }

  @RequestMapping(method = RequestMethod.POST, headers = "Accept=application/json")
    public ResponseEntity<String> createFromJson(@RequestBody String json,Authentication authentication) {
        Todo todo = Todo.fromJsonToTodo(json);
        User user=(User) authentication.getPrincipal();
        Userinfo userinfo=userService.findByUserName(user.getUsername()).get(0);
        todo.setUserName(userinfo);
        todoService.saveTodo(todo);
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Type", "application/json");
        return new ResponseEntity<String>(headers, HttpStatus.CREATED);
    }
View Full Code Here

Examples of com.getit.todoapp.domain.Todo

  @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
    public ResponseEntity<String> deleteFromJson(@PathVariable("id") Long id,Authentication authentication) {
       
        User user=(User) authentication.getPrincipal();
        Todo todo = todoService.findTodoByUserNameAndId(user.getUsername(),id);
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Type", "application/json");
        if (todo == null) {
            return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
        }
        todo.setUserName(null);
        todoService.deleteTodo(todo);
        return new ResponseEntity<String>(headers, HttpStatus.OK);
    }
View Full Code Here

Examples of com.kellerkindt.scs.internals.Todo

       
        if (amount < 0)
            throw new MissingOrIncorrectArgumentException ();

        Messaging.send  (player, next);
        scs.addTodo    (player, new Todo (player, Type.GET_ITEMS, null, amount, null));
       
        return true;
    }
View Full Code Here

Examples of com.stormpath.samples.todos.entity.Todo

    @Path("/{id}")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public TodoResource getTodo(@Context UriInfo info, @PathParam("id") String id) {
        Todo todo = todoService.getById(id);
        if (todo == null) {
            throw new UnknownResourceException();
        }
        return new TodoResource(info, todo);
    }
View Full Code Here

Examples of com.tmm.enterprise.microblog.domain.ToDo

  @Transactional
  public ToDo createToDo(String title, String description, String userName) throws ButterflyException {
    Account acc = accountService.loadAccountByUserName(userName);
    Person currentUser = acc.getUserProfile();
    if (currentUser!=null){
      ToDo todo = new ToDo();
      todo.setTitle(title);
      todo.setDetails(description);
      todo.setRaisedBy(currentUser);
      todo.setAssignedTo(currentUser);
      currentUser.addTodoItem(todo);
      todoDao.persist(todo);
      return todo;
    }
    throw new ButterflyException(ButterflyExceptionCode.USER003_INVALIDUSER, "Unable to create new ToDo - Account does not have associated Person");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.