Search in sources :

Example 1 with SnpAssociationForm

use of uk.ac.ebi.spot.goci.curation.model.SnpAssociationForm in project goci by EBISPOT.

the class AssociationController method viewAssociation.

/* Existing association information */
// View association information
@RequestMapping(value = "/associations/{associationId}", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET)
public String viewAssociation(Model model, @PathVariable Long associationId) {
    // Return association with that ID
    Association associationToView = associationRepository.findOne(associationId);
    // Get mapping details
    MappingDetails mappingDetails = associationOperationsService.createMappingDetails(associationToView);
    model.addAttribute("mappingDetails", mappingDetails);
    // Return any association errors
    model.addAttribute("errors", associationValidationReportService.generateAssociationWarningsListView(associationId));
    // Establish study
    Long studyId = associationToView.getStudy().getId();
    // Also passes back study object to view so we can create links back to main study page
    model.addAttribute("study", studyRepository.findOne(studyId));
    // Determine if association is an OR or BETA type
    String measurementType = associationOperationsService.determineIfAssociationIsOrType(associationToView);
    model.addAttribute("measurementType", measurementType);
    // Determine form to return
    SnpAssociationForm form = associationOperationsService.generateForm(associationToView);
    model.addAttribute("form", form);
    // Determine page to return
    if (associationToView.getSnpInteraction() != null && associationToView.getSnpInteraction()) {
        return "edit_snp_interaction_association";
    } else if (associationToView.getMultiSnpHaplotype() != null && associationToView.getMultiSnpHaplotype()) {
        return "edit_multi_snp_association";
    } else {
        return "edit_standard_snp_association";
    }
}
Also used : LastViewedAssociation(uk.ac.ebi.spot.goci.curation.model.LastViewedAssociation) SnpAssociationForm(uk.ac.ebi.spot.goci.curation.model.SnpAssociationForm) MappingDetails(uk.ac.ebi.spot.goci.curation.model.MappingDetails) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 LastViewedAssociation (uk.ac.ebi.spot.goci.curation.model.LastViewedAssociation)1 MappingDetails (uk.ac.ebi.spot.goci.curation.model.MappingDetails)1 SnpAssociationForm (uk.ac.ebi.spot.goci.curation.model.SnpAssociationForm)1