// get the service
StoryService storyService = AgilePlanningObjectFactory
.getStoryService();
// get the form
StoryForm storyform = (StoryForm) form;
// TODO faire une seul m�thode storyService.save ?
Errors errors = null;
// save the story
if (storyform.getPersistanceId() == 0) {
// add
// get the current basicProject from the session
Integer basicProjectPersistanceId = (Integer) request.getSession()
.getAttribute("basicProject.persistanceId");
errors = storyService.add(basicProjectPersistanceId.intValue(),
storyform.getShortDescription(),
storyform.getDescription(), storyform.getDaysEstimated(),
storyform.getBusinessValueId(), storyform.getRiskLevelId());
} else {
// update
errors = storyService.update(storyform.getShortDescription(),
storyform.getDescription(), storyform.getDaysEstimated(),
storyform.getBusinessValueId(), storyform.getRiskLevelId(),
storyform.getPersistanceId(), storyform.getPersistanceVersion());
}
// Convert into struts action errors
ActionMessages actionMessages = new ActionMessages();