// get the service
ToDoService toDoService = ToDoObjectFactory.getToDoService();
// get the form
ToDoForm toDoForm = (ToDoForm) form;
// save the todo
if (toDoForm.getPersistanceId() == 0) {
// add
// get the current basicProject from the session
Integer basicProjectPersistanceId = (Integer) request.getSession()
.getAttribute("basicProject.persistanceId");
User user = (User) request.getSession().getAttribute("user");
toDoService.add(toDoForm.getDescription(), toDoForm.getDate(), toDoForm.getDone() ,user.getPersistanceId(), basicProjectPersistanceId);
} else {
// update
toDoService.update(toDoForm.getPersistanceId(), toDoForm.getPersistanceVersion(), toDoForm.getDescription(), toDoForm.getDate(), toDoForm.getDone());
}
// populate the summary
populateListForProjectSummary(request);