throws Exception {
// TODO Faire une m�thode de s�curit� pour v�rifier le user
// get the service
StoryService storyService = AgilePlanningObjectFactory
.getStoryService();
// find the Story... if needed
if (StringUtils.isNotEmpty((String) request
.getParameter("persistanceId"))) {
Story story = storyService.findByPersistanceId(Integer
.parseInt((String) request.getParameter("persistanceId")));
// populate the form
StoryForm storyForm = (StoryForm) form;
storyForm.setDescription(story.getDescription());
storyForm.setDaysEstimated(story.getDaysEstimated());
storyForm.setShortDescription(story.getShortDescription());
storyForm.setPersistanceId(story.getPersistanceId());
storyForm.setPersistanceVersion(story.getPersistanceVersion());
storyForm.setBusinessValueId(story.getBusinessValue().getId());
storyForm.setRiskLevelId(story.getRiskLevel().getId());
storyForm.setDaysCompleted(story.daysCompleted());
storyForm.setDaysRemaining(story.daysRemaining());
storyForm.setPercentCompleted(story.percentCompleted());
storyForm.setDifferenceInPercentBetweenEstimateAndTaskCharge(story.differenceInPercentBetweenEstimateAndTaskCharge());
storyForm.setDifferenceOfDaysBetweenEstimateAndTaskCharge(story.differenceOfDaysBetweenEstimateAndTaskCharge());
storyForm.setDifferenceInPercentBetweenEstimateAndTaskEstimate(story.differenceInPercentBetweenEstimateAndTaskEstimate());
storyForm.setDifferenceOfDaysBetweenEstimateAndTaskEstimate(story.differenceOfDaysBetweenEstimateAndTaskEstimate());
}
// get the list of riskLevel to populate the list box
Set<RiskLevel> riskLevels = storyService.findAllRiskLevel();
// populate a list of views
Set<RiskLevelView> riskLevelsToReturn = new HashSet<RiskLevelView>();
for (RiskLevel riskLevel : riskLevels) {
RiskLevelView riskLevelView = new RiskLevelView();
riskLevelView.populateWithRiskLevel(riskLevel);
riskLevelsToReturn.add(riskLevelView);
}
request.setAttribute("riskLevels", riskLevelsToReturn);
// get the list of businessValue to populate the list box
Set<BusinessValue> businessValues = storyService.findAllBusinessValue();
// populate a list of views
Set<BusinessValueView> businessValuesToReturn = new HashSet<BusinessValueView>();
for (BusinessValue businessvalue : businessValues) {
BusinessValueView businessValueView = new BusinessValueView();
businessValueView.populateWithBusinessValue(businessvalue);