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