public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// get the service
IterationService iterationService = AgilePlanningObjectFactory.getIterationService();
// get the form
IterationForm iterationform = (IterationForm) form;
// TODO faire une seul m�thode iterationService.save ?
Errors errors = null;
// get the current basicProject from the session
Integer basicProjectPersistanceId = (Integer) request.getSession().getAttribute("basicProject.persistanceId");
// save the iteration
if (iterationform.getPersistanceId() == 0) {
// add
errors = iterationService.add(basicProjectPersistanceId.intValue(), iterationform.getStartDate(), iterationform.getEndDate());
} else {
// update
errors = iterationService.update(iterationform.getStartDate(), iterationform.getEndDate(), iterationform.getPersistanceId(), iterationform.getPersistanceVersion());
}
// Convert into struts action errors
ActionMessages actionMessages = new ActionMessages();