@Override protected void populateObject(HttpServletRequest request, Object object, ActionForm form) throws IOException { ImportStoriesForm importStoriesForm = (ImportStoriesForm) form; SpreadsheetHeaderConfiguration headerConfiguration = new SpreadsheetHeaderConfiguration(); populateHeaderConfiguration(headerConfiguration, importStoriesForm); importStoriesForm.setResults( importer.importStories( (Iteration) object, headerConfiguration, importStoriesForm.getFormFile().getInputStream(), importStoriesForm.isOnlyIncomplete())); }
@Override protected void populateForm( AbstractEditorForm actionForm, ActionMapping actionMapping, HttpServletRequest request) { ImportStoriesForm form = (ImportStoriesForm) actionForm; form.setWorksheetName(getValueFromCookieOrProperties(WORKSHEET_NAME_PROPERTY_KEY, request)); form.setTitleColumn(getValueFromCookieOrProperties(STORY_TITLE_PROPERTY_KEY, request)); form.setEndDateColumn(getValueFromCookieOrProperties(ITERATION_END_DATE_PROPERTY_KEY, request)); form.setPriorityColumn(getValueFromCookieOrProperties(STORY_PRIORITY_PROPERTY_KEY, request)); form.setEstimateColumn(getValueFromCookieOrProperties(STORY_ESTIMATE_PROPERTY_KEY, request)); form.setStatusColumn(getValueFromCookieOrProperties(STORY_STATUS_PROPERTY_KEY, request)); form.setOnlyIncomplete( Boolean.valueOf(getValueFromCookieOrProperties(ONLY_INCOMPLETE_COOKIE_NAME, request)) .booleanValue()); form.setCompletedStatus(getValueFromCookieOrProperties(COMPLETED_STORY_STATUS_KEY, request)); }
@Override protected void setCookies( AbstractEditorForm form, ActionMapping mapping, HttpServletRequest request, HttpServletResponse response) { ImportStoriesForm importForm = (ImportStoriesForm) form; addCookie(WORKSHEET_NAME_PROPERTY_KEY, importForm.getWorksheetName(), response); addCookie(STORY_TITLE_PROPERTY_KEY, importForm.getTitleColumn(), response); addCookie(ITERATION_END_DATE_PROPERTY_KEY, importForm.getEndDateColumn(), response); addCookie(STORY_ESTIMATE_PROPERTY_KEY, importForm.getEstimateColumn(), response); addCookie(STORY_PRIORITY_PROPERTY_KEY, importForm.getPriorityColumn(), response); addCookie(STORY_STATUS_PROPERTY_KEY, importForm.getStatusColumn(), response); addCookie(ONLY_INCOMPLETE_COOKIE_NAME, "" + importForm.isOnlyIncomplete(), response); addCookie(COMPLETED_STORY_STATUS_KEY, importForm.getCompletedStatus(), response); }
private void populateHeaderConfiguration( SpreadsheetHeaderConfiguration headerConfiguration, ImportStoriesForm form) { headerConfiguration.setWorksheetName(form.getWorksheetName()); headerConfiguration.setTitleHeader(form.getTitleColumn()); headerConfiguration.setEndDateHeader(form.getEndDateColumn()); headerConfiguration.setEstimateHeader(form.getEstimateColumn()); headerConfiguration.setPriorityHeader(form.getPriorityColumn()); headerConfiguration.setStatusHeader(form.getStatusColumn()); }