goci-interfaces/goci-curation/src/main/java/uk/ac/ebi/spot/goci/curation/controller/StudyController.java
// Update page with housekeeping/curator information linked to a study
Update page with housekeeping/curator information linked to a study
Update page with housekeeping / curator information linked to a study
@RequestMapping(value = "/{studyId}/housekeeping",
                    produces = MediaType.TEXT_HTML_VALUE,
                    method = RequestMethod.POST)
    public String updateStudyHousekeeping(@ModelAttribute Housekeeping housekeeping,
                                          @PathVariable Long studyId,
                                          RedirectAttributes redirectAttributes, HttpServletRequest request) {
        Study study = studyRepository.findOne(studyId);
        String message = studyOperationsService.updateHousekeeping(housekeeping,
                                                                   study,
                                                                   currentUserDetailsService.getUserFromRequest(request));
        if (message == null) {
            message = "Changes saved successfully";
            redirectAttributes.addFlashAttribute("changesSaved", message);
        }
        else{
            redirectAttributes.addFlashAttribute("publishError", message);
        }
        return "redirect:/studies/" + study.getId() + "/housekeeping";
    }
@ RequestMapping ( value = "/{studyId}/housekeeping" , produces = MediaType . TEXT_HTML_VALUE , method = RequestMethod . POST ) public String updateStudyHousekeeping ( @ ModelAttribute Housekeeping housekeeping , @ PathVariable Long studyId , RedirectAttributes redirectAttributes , HttpServletRequest request ) { Study study = studyRepository . findOne ( studyId ) ; String message = studyOperationsService . updateHousekeeping ( housekeeping , study , currentUserDetailsService . getUserFromRequest ( request ) ) ; if ( message == null ) { message = "Changes saved successfully" ; redirectAttributes . addFlashAttribute ( "changesSaved" , message ) ; } else { redirectAttributes . addFlashAttribute ( "publishError" , message ) ; } return "redirect:/studies/" + study . getId ( ) + "/housekeeping" ; }
Update page with housekeeping/curator information linked to a study
Update page with housekeeping / curator information linked to a study
// Establish linked study // Update housekeeping // Add save message //        redirectAttributes.addFlashAttribute("changesSaved", message);