/**
   * Method declaration
   *
   * @param id
   * @throws TodoException
   * @see
   */
  public void closeToDo(String id) throws TodoException {
    SilverTrace.info("todo", "ToDoSessionController.closeToDo()", "root.MSG_GEN_ENTER_METHOD");
    ToDoHeader todo = getToDoHeader(id);

    todo.setCompletedDate(new java.util.Date());
    try {
      calendarBm.updateToDo(todo);
    } catch (Exception e) {
      throw new TodoException(
          "ToDoSessionController.closeToDo()",
          SilverpeasException.ERROR,
          "todo.MSG_CANT_UPDATE_TODO_DETAIL",
          e);
    }

    notifyAttendees(
        id,
        "Cloture de la tache '" + todo.getName() + "'",
        "La tache intitulé '" + todo.getName() + "' a été cloturée.\n");
    SilverTrace.info("todo", "ToDoSessionController.closeToDo()", "root.MSG_GEN_EXIT_METHOD");
  }
 private static TodoDetail todoHeaderToDetail(final ToDoHeader header) {
   TodoDetail detail = new TodoDetail();
   detail.setName(header.getName());
   detail.setId(header.getId());
   detail.setDescription(header.getDescription());
   detail.setDelegatorId(header.getDelegatorId());
   // detail.setPriority(header.getPriority());
   detail.setStartDate(header.getStartDate());
   detail.setEndDate(header.getEndDate());
   detail.setDuration(header.getDuration());
   detail.setPercentCompleted(header.getPercentCompleted());
   detail.setComponentId(header.getComponentId());
   detail.setSpaceId(header.getSpaceId());
   detail.setExternalId(header.getExternalId());
   return detail;
 }