goci-interfaces/goci-curation/src/main/java/uk/ac/ebi/spot/goci/curation/controller/StudyController.java
// Redirects from landing page and main page
Redirects from landing page and main page
Redirects from landing page and main page
@RequestMapping(produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST)
    public String searchForStudyByFilter(@ModelAttribute StudySearchFilter studySearchFilter) {
        Long status = studySearchFilter.getStatusSearchFilterId();
        Long curator = studySearchFilter.getCuratorSearchFilterId();
        String pubmedId = studySearchFilter.getPubmedId();
        String author = studySearchFilter.getAuthor();
        String studyType = studySearchFilter.getStudyType();
        Long efoTraitId = studySearchFilter.getEfoTraitSearchFilterId();
        String notesQuery = studySearchFilter.getNotesQuery();
        Long diseaseTraitId = studySearchFilter.getDiseaseTraitSearchFilterId();
        String gcstId = studySearchFilter.getGcstId();
        String studyId = studySearchFilter.getStudyId();
        if (pubmedId != null && !pubmedId.isEmpty()) {
            return "redirect:/studies?page=1&pubmed=" + pubmedId;
        }
        else if (author != null && !author.isEmpty()) {
            return "redirect:/studies?page=1&author=" + author;
        }
        else if (studyType != null && !studyType.isEmpty()) {
            return "redirect:/studies?page=1&studytype=" + studyType;
        }
        else if (efoTraitId != null) {
            return "redirect:/studies?page=1&efotraitid=" + efoTraitId;
        }
        else if (diseaseTraitId != null) {
            return "redirect:/studies?page=1&diseasetraitid=" + diseaseTraitId;
        }
        else if (notesQuery != null && !notesQuery.isEmpty()) {
            return "redirect:/studies?page=1&notesquery=" + notesQuery;
        }
        else if (status != null) {
            if (curator != null) {
                return "redirect:/studies?page=1&status=" + status + "&curator=" + curator;
            }
            else {
                return "redirect:/studies?page=1&status=" + status;
            }
        }
        else if (curator != null) {
            return "redirect:/studies?page=1&curator=" + curator;
        }
        else if(gcstId != null){
            return "redirect:/studies?page=1&gcstId=" + gcstId;
        }
        else if(studyId != null){
            return "redirect:/studies?page=1&studyId=" + studyId;
        }
        else {
            return "redirect:/studies?page=1";
        }
    }
@ RequestMapping ( produces = MediaType . TEXT_HTML_VALUE , method = RequestMethod . POST ) public String searchForStudyByFilter ( @ ModelAttribute StudySearchFilter studySearchFilter ) { Long status = studySearchFilter . getStatusSearchFilterId ( ) ; Long curator = studySearchFilter . getCuratorSearchFilterId ( ) ; String pubmedId = studySearchFilter . getPubmedId ( ) ; String author = studySearchFilter . getAuthor ( ) ; String studyType = studySearchFilter . getStudyType ( ) ; Long efoTraitId = studySearchFilter . getEfoTraitSearchFilterId ( ) ; String notesQuery = studySearchFilter . getNotesQuery ( ) ; Long diseaseTraitId = studySearchFilter . getDiseaseTraitSearchFilterId ( ) ; String gcstId = studySearchFilter . getGcstId ( ) ; String studyId = studySearchFilter . getStudyId ( ) ; if ( pubmedId != null && ! pubmedId . isEmpty ( ) ) { return "redirect:/studies?page=1&pubmed=" + pubmedId ; } else if ( author != null && ! author . isEmpty ( ) ) { return "redirect:/studies?page=1&author=" + author ; } else if ( studyType != null && ! studyType . isEmpty ( ) ) { return "redirect:/studies?page=1&studytype=" + studyType ; } else if ( efoTraitId != null ) { return "redirect:/studies?page=1&efotraitid=" + efoTraitId ; } else if ( diseaseTraitId != null ) { return "redirect:/studies?page=1&diseasetraitid=" + diseaseTraitId ; } else if ( notesQuery != null && ! notesQuery . isEmpty ( ) ) { return "redirect:/studies?page=1&notesquery=" + notesQuery ; } else if ( status != null ) { if ( curator != null ) { return "redirect:/studies?page=1&status=" + status + "&curator=" + curator ; } else { return "redirect:/studies?page=1&status=" + status ; } } else if ( curator != null ) { return "redirect:/studies?page=1&curator=" + curator ; } else if ( gcstId != null ) { return "redirect:/studies?page=1&gcstId=" + gcstId ; } else if ( studyId != null ) { return "redirect:/studies?page=1&studyId=" + studyId ; } else { return "redirect:/studies?page=1" ; } }
Redirects from landing page and main page
Redirects from landing page and main page
// Get ids of objects searched for // Search by pubmed ID option available from landing page // Search by author option available from landing page // Search by study type // Search by efo trait // Search by disease trait // Search by string in notes // If user entered a status // If we have curator and status find by both // If user entered curator // If all else fails return all studies // Find all studies ordered by study date and only display first page