public static final String MOVED = "moved";
public static final String OPERATION_PARAM_KEY = "operation";
public void beforeObjectCommit(Object object, Session session, ActionMapping actionMapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse reply) throws Exception {
UserStoryEditorForm storyForm = (UserStoryEditorForm)actionForm;
UserStory story = (UserStory)object;
String operation = request.getParameter(OPERATION_PARAM_KEY);
try {
if (StringUtils.equals(operation, "continue")) {
continueStory(request, session, story, storyForm.getTargetIterationId());
HistorySupport.saveEvent(session, story, CONTINUED, null,
SecurityHelper.getRemoteUserId(request), new Date());
} else if (StringUtils.equals(operation, "move")) {
story.setIterationId(storyForm.getTargetIterationId());
HistorySupport.saveEvent(session, story, MOVED, null,
SecurityHelper.getRemoteUserId(request), new Date());
}
} catch (Exception e) {
throw new ServletException(e);