goci-interfaces/goci-curation/src/main/java/uk/ac/ebi/spot/goci/curation/controller/StudyController.java
// Assign a curator to a study
Assign a curator to a study
Assign a curator to a study
@RequestMapping(value = "/{studyId}/assign", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST)
    public String assignStudyCurator(@PathVariable Long studyId,
                                     @ModelAttribute Assignee assignee,
                                     RedirectAttributes redirectAttributes, HttpServletRequest request) {
        Study study = studyRepository.findOne(studyId);
        if (assignee.getCuratorId() == null) {
            String blankAssignee =
                    "Cannot assign a blank value as a curator for study: " + study.getPublicationId().getFirstAuthor().getFullnameShort(30) + ", " + " pubmed = " +
                            study.getPublicationId().getPubmedId();
            redirectAttributes.addFlashAttribute("blankAssignee", blankAssignee);
        }
        else {
            studyOperationsService.assignStudyCurator(study,
                                                      assignee,
                                                      currentUserDetailsService.getUserFromRequest(request));
        }
        return "redirect:" + assignee.getUri();
    }
@ RequestMapping ( value = "/{studyId}/assign" , produces = MediaType . TEXT_HTML_VALUE , method = RequestMethod . POST ) public String assignStudyCurator ( @ PathVariable Long studyId , @ ModelAttribute Assignee assignee , RedirectAttributes redirectAttributes , HttpServletRequest request ) { Study study = studyRepository . findOne ( studyId ) ; if ( assignee . getCuratorId ( ) == null ) { String blankAssignee = "Cannot assign a blank value as a curator for study: " + study . getPublicationId ( ) . getFirstAuthor ( ) . getFullnameShort ( 30 ) + ", " + " pubmed = " + study . getPublicationId ( ) . getPubmedId ( ) ; redirectAttributes . addFlashAttribute ( "blankAssignee" , blankAssignee ) ; } else { studyOperationsService . assignStudyCurator ( study , assignee , currentUserDetailsService . getUserFromRequest ( request ) ) ; } return "redirect:" + assignee . getUri ( ) ; }
Assign a curator to a study
Assign a curator to a study
// Find the study and the curator user wishes to assign