// get the service
StoryService storyService = AgilePlanningObjectFactory.getStoryService();
// get the form
ChargeForm chargeForm = (ChargeForm) form;
// TODO faire une seul m�thode taskService.save ?
// save the story
if (chargeForm.getPersistanceId() == 0) {
// add
storyService.addCharge(chargeForm.getStoryPersistanceId(),
chargeForm.getTaskPersistanceId(),
((User) request.getSession().getAttribute("user")).getPersistanceId(),
chargeForm.getDay(),
chargeForm.getTimeUsedToday(),
chargeForm.getDaysNeededToFinish());
} else {
// update
storyService.updateCharge(chargeForm.getDay(),
chargeForm.getTimeUsedToday(),
chargeForm.getDaysNeededToFinish(),
chargeForm.getStoryPersistanceId(),
chargeForm.getTaskPersistanceId(),
chargeForm.getPersistanceId(),
chargeForm.getPersistanceVersion());
}
// set the storyPersistanceId in request
request.setAttribute("storyPersistanceId", String.valueOf(chargeForm.getStoryPersistanceId()));
return this.list(mapping, form, request, response);
}