@Test public void applyStudyEFOtraitToSnps() throws Exception { }
@RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) public String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId, @RequestParam(value = "e", required = false, defaultValue = "false") boolean existing, @RequestParam(value = "o", required = false, defaultValue = "true") boolean overwrite) throws IOException { Collection<Association> associations = new ArrayList<>(); associations.addAll(associationRepository.findByStudyId(studyId)); Study study = studyRepository.findOne((studyId)); Collection<EfoTrait> efoTraits = study.getEfoTraits(); if (associations.size() == 0 || efoTraits.size() == 0) { model.addAttribute("study", study); return "no_association_efo_trait_warning"; } else { if (!existing) { for (Association association : associations) { if (association.getEfoTraits().size() != 0) { model.addAttribute("study", study); return "existing_efo_traits_warning"; } } } Collection<EfoTrait> associationTraits = new ArrayList<EfoTrait>(); for (EfoTrait efoTrait : efoTraits) { associationTraits.add(efoTrait); } for (Association association : associations) { if (association.getEfoTraits().size() != 0 && !overwrite) { for (EfoTrait trait : associationTraits) { if (!association.getEfoTraits().contains(trait)) { association.addEfoTrait(trait); } } } else { association.setEfoTraits(associationTraits); } association.setLastUpdateDate(new Date()); associationRepository.save(association); } return "redirect:/studies/" + studyId + "/associations"; } }
AssociationController { @RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) public String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId, @RequestParam(value = "e", required = false, defaultValue = "false") boolean existing, @RequestParam(value = "o", required = false, defaultValue = "true") boolean overwrite) throws IOException { Collection<Association> associations = new ArrayList<>(); associations.addAll(associationRepository.findByStudyId(studyId)); Study study = studyRepository.findOne((studyId)); Collection<EfoTrait> efoTraits = study.getEfoTraits(); if (associations.size() == 0 || efoTraits.size() == 0) { model.addAttribute("study", study); return "no_association_efo_trait_warning"; } else { if (!existing) { for (Association association : associations) { if (association.getEfoTraits().size() != 0) { model.addAttribute("study", study); return "existing_efo_traits_warning"; } } } Collection<EfoTrait> associationTraits = new ArrayList<EfoTrait>(); for (EfoTrait efoTrait : efoTraits) { associationTraits.add(efoTrait); } for (Association association : associations) { if (association.getEfoTraits().size() != 0 && !overwrite) { for (EfoTrait trait : associationTraits) { if (!association.getEfoTraits().contains(trait)) { association.addEfoTrait(trait); } } } else { association.setEfoTraits(associationTraits); } association.setLastUpdateDate(new Date()); associationRepository.save(association); } return "redirect:/studies/" + studyId + "/associations"; } } }
AssociationController { @RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) public String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId, @RequestParam(value = "e", required = false, defaultValue = "false") boolean existing, @RequestParam(value = "o", required = false, defaultValue = "true") boolean overwrite) throws IOException { Collection<Association> associations = new ArrayList<>(); associations.addAll(associationRepository.findByStudyId(studyId)); Study study = studyRepository.findOne((studyId)); Collection<EfoTrait> efoTraits = study.getEfoTraits(); if (associations.size() == 0 || efoTraits.size() == 0) { model.addAttribute("study", study); return "no_association_efo_trait_warning"; } else { if (!existing) { for (Association association : associations) { if (association.getEfoTraits().size() != 0) { model.addAttribute("study", study); return "existing_efo_traits_warning"; } } } Collection<EfoTrait> associationTraits = new ArrayList<EfoTrait>(); for (EfoTrait efoTrait : efoTraits) { associationTraits.add(efoTrait); } for (Association association : associations) { if (association.getEfoTraits().size() != 0 && !overwrite) { for (EfoTrait trait : associationTraits) { if (!association.getEfoTraits().contains(trait)) { association.addEfoTrait(trait); } } } else { association.setEfoTraits(associationTraits); } association.setLastUpdateDate(new Date()); associationRepository.save(association); } return "redirect:/studies/" + studyId + "/associations"; } } @Autowired  AssociationController(AssociationRepository associationRepository,
                                 StudyRepository studyRepository,
                                 EfoTraitRepository efoTraitRepository,
                                 AssociationDownloadService associationDownloadService,
                                 SnpAssociationTableViewService snpAssociationTableViewService,
                                 SingleSnpMultiSnpAssociationService singleSnpMultiSnpAssociationService,
                                 SnpInteractionAssociationService snpInteractionAssociationService,
                                 CheckEfoTermAssignmentService checkEfoTermAssignmentService,
                                 AssociationOperationsService associationOperationsService,
                                 AssociationUploadService associationUploadService,
                                 CurrentUserDetailsService currentUserDetailsService,
                                 AssociationValidationReportService associationValidationReportService,
                                 AssociationDeletionService associationDeletionService,
                                 @Qualifier("associationEventsViewService") EventsViewService eventsViewService,
                                 StudyAssociationBatchDeletionEventService studyAssociationBatchDeletionEventService,
                                 EnsemblRestTemplateService ensemblRestTemplateService,
                                 CheckMappingService checkMappingService,
                                 MapCatalogService mapCatalogService,
                                 AssociationService associationService); }
AssociationController { @RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) public String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId, @RequestParam(value = "e", required = false, defaultValue = "false") boolean existing, @RequestParam(value = "o", required = false, defaultValue = "true") boolean overwrite) throws IOException { Collection<Association> associations = new ArrayList<>(); associations.addAll(associationRepository.findByStudyId(studyId)); Study study = studyRepository.findOne((studyId)); Collection<EfoTrait> efoTraits = study.getEfoTraits(); if (associations.size() == 0 || efoTraits.size() == 0) { model.addAttribute("study", study); return "no_association_efo_trait_warning"; } else { if (!existing) { for (Association association : associations) { if (association.getEfoTraits().size() != 0) { model.addAttribute("study", study); return "existing_efo_traits_warning"; } } } Collection<EfoTrait> associationTraits = new ArrayList<EfoTrait>(); for (EfoTrait efoTrait : efoTraits) { associationTraits.add(efoTrait); } for (Association association : associations) { if (association.getEfoTraits().size() != 0 && !overwrite) { for (EfoTrait trait : associationTraits) { if (!association.getEfoTraits().contains(trait)) { association.addEfoTrait(trait); } } } else { association.setEfoTraits(associationTraits); } association.setLastUpdateDate(new Date()); associationRepository.save(association); } return "redirect:/studies/" + studyId + "/associations"; } } @Autowired  AssociationController(AssociationRepository associationRepository,
                                 StudyRepository studyRepository,
                                 EfoTraitRepository efoTraitRepository,
                                 AssociationDownloadService associationDownloadService,
                                 SnpAssociationTableViewService snpAssociationTableViewService,
                                 SingleSnpMultiSnpAssociationService singleSnpMultiSnpAssociationService,
                                 SnpInteractionAssociationService snpInteractionAssociationService,
                                 CheckEfoTermAssignmentService checkEfoTermAssignmentService,
                                 AssociationOperationsService associationOperationsService,
                                 AssociationUploadService associationUploadService,
                                 CurrentUserDetailsService currentUserDetailsService,
                                 AssociationValidationReportService associationValidationReportService,
                                 AssociationDeletionService associationDeletionService,
                                 @Qualifier("associationEventsViewService") EventsViewService eventsViewService,
                                 StudyAssociationBatchDeletionEventService studyAssociationBatchDeletionEventService,
                                 EnsemblRestTemplateService ensemblRestTemplateService,
                                 CheckMappingService checkMappingService,
                                 MapCatalogService mapCatalogService,
                                 AssociationService associationService); @InitBinder(value={"snpAssociationStandardMultiForm", "snpAssociationInteractionForm"}) void initBinder(WebDataBinder dataBinder); @RequestMapping(value = "/studies/{studyId}/associations", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String viewStudySnps(Model model,
                                @PathVariable Long studyId,
                                @RequestParam(required = false) Long associationId,
                                @RequestParam(defaultValue = "1", required = false) Integer page); @RequestMapping(value = "studies/{studyId}/association_tracking", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String getAssociationEvents(Model model, @PathVariable Long studyId); @RequestMapping(value = "/studies/{studyId}/associations/upload", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) Callable<String> uploadStudySnps(@RequestParam("file") MultipartFile file,
                                    @PathVariable Long studyId,
                                    Model model,
                                    HttpServletRequest request,
                                    HttpSession session); @RequestMapping(value = "/studies/{studyId}/associations/add_standard", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String addStandardSnpsView(Model model,
                                      @PathVariable Long studyId,
                                      @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String addMultiSnpsView(Model model,
                                   @PathVariable Long studyId,
                                   @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String addSnpInteractionView(Model model,
                                        @PathVariable Long studyId,
                                        @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", params = {"addRows"}) String addRows(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                          Model model,
                          @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = {"addCols"}) String addRows(SnpAssociationInteractionForm snpAssociationInteractionForm,
                          Model model,
                          @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", params = {"addRow"}) String addRow(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                         Model model,
                         @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = {"addCol"}) String addCol(SnpAssociationInteractionForm snpAssociationInteractionForm,
                         Model model,
                         @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", params = {"removeRow"}) String removeRow(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                            HttpServletRequest req,
                            Model model,
                            @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = {"removeCol"}) String removeCol(SnpAssociationInteractionForm snpAssociationInteractionForm,
                            HttpServletRequest req,
                            Model model,
                            @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_standard", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) String addStandardSnps(@ModelAttribute("form") @Valid SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                  BindingResult bindingResult,
                                  @PathVariable Long studyId,
                                  Model model,
                                  @RequestParam(required = true) String measurementType,
                                  HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) String addMultiSnps(@ModelAttribute("form") @Valid SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                               BindingResult bindingResult,
                               @PathVariable Long studyId,
                               Model model,
                               @RequestParam(required = true) String measurementType,
                               HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) String addSnpInteraction(@ModelAttribute("form") @Valid SnpAssociationInteractionForm snpAssociationInteractionForm,
                                    BindingResult bindingResult,
                                    @PathVariable Long studyId,
                                    Model model,
                                    @RequestParam(required = true) String measurementType, HttpServletRequest request); @RequestMapping(value = "/associations/{associationId}", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String viewAssociation(Model model, @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) // TODO COULD REFACTOR TO JUST USE SUPERCLASS AS METHOD PARAMETER String editAssociation(@ModelAttribute SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                  @ModelAttribute SnpAssociationInteractionForm snpAssociationInteractionForm,
                                  @PathVariable Long associationId,
                                  @RequestParam(value = "associationtype", required = true) String associationType,
                                  Model model, HttpServletRequest request,
                                  RedirectAttributes redirectAttributes); @RequestMapping(value = "/associations/{associationId}", params = {"addRow"}) String addRowEditMode(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                 Model model,
                                 @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", params = {"addCol"}) String addColEditMode(SnpAssociationInteractionForm snpAssociationInteractionForm,
                                 Model model,
                                 @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", params = {"removeRow"}) String removeRowEditMode(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                    HttpServletRequest req,
                                    Model model,
                                    @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", params = {"removeCol"}) String removeColEditMode(SnpAssociationInteractionForm snpAssociationInteractionForm,
                                    HttpServletRequest req,
                                    Model model,
                                    @PathVariable Long associationId); @RequestMapping(value = "/studies/{studyId}/associations/delete_all", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String deleteAllAssociations(@PathVariable Long studyId, HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/delete_checked", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody Map<String, String> deleteChecked(@RequestParam(value = "associationIds[]") String[] associationsIds,
                                      HttpServletRequest request); @RequestMapping(value = "associations/{associationId}/approve", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String approveSnpAssociation(@PathVariable Long associationId,
                                        RedirectAttributes redirectAttributes,
                                        HttpServletRequest request); @RequestMapping(value = "associations/{associationId}/unapprove", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String unapproveSnpAssociation(@PathVariable Long associationId, HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/approve_checked", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody Map<String, String> approveChecked(@RequestParam(value = "associationIds[]") String[] associationsIds,
                                       HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/unapprove_checked", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody Map<String, String> unapproveChecked(@RequestParam(value = "associationIds[]") String[] associationsIds,
                                         HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/approve_all", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String approveAll(@PathVariable Long studyId,
                             RedirectAttributes redirectAttributes,
                             HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/validate_unapproved", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) Callable<String> validateUnapproved(@PathVariable Long studyId,
                                         RedirectAttributes redirectAttributes,
                                         Model model,
                                         HttpServletRequest request,
                                         HttpSession session); @RequestMapping(value = "/studies/{studyId}/associations/download", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) void downloadStudySnps(HttpServletResponse response, @PathVariable Long studyId); @RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId,
                                           @RequestParam(value = "e",
                                                   required = false,
                                                   defaultValue = "false") boolean existing,
                                           @RequestParam(value = "o",
                                                   required = false,
                                                   defaultValue = "true") boolean overwrite); @RequestMapping(value = "/associations/{associationId}/force_mapping", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String forceMapping(@PathVariable Long associationId, RedirectAttributes redirectAttributes,
                               HttpServletRequest request); @ExceptionHandler(DataIntegrityException.class) String handleDataIntegrityException(DataIntegrityException dataIntegrityException); @ExceptionHandler({SheetProcessingException.class}) String handleInvalidFormatExceptionAndInvalidOperationException(); @ExceptionHandler({IOException.class}) String handleIOException(); @ExceptionHandler({FileUploadException.class}) String handleFileUploadException(); @ExceptionHandler({FileNotFoundException.class}) String handleFileNotFound(); @ModelAttribute("efoTraits") List<EfoTrait> populateEfoTraits(); @PreDestroy void destroy(); @RequestMapping(value = "/studies/{studyId}/associations/status", method = RequestMethod.GET) @ResponseBody boolean checkUploadStatus(HttpSession session); @RequestMapping(value = "/studies/{studyId}/associations/getUploadResults", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String getUploadResult(@PathVariable Long studyId, HttpSession session, Model model); @RequestMapping(value = "/studies/{studyId}/associations/getValidationResults", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String getValidationResult(@PathVariable Long studyId, HttpSession session, Model model, RedirectAttributes redirectAttributes); }
AssociationController { @RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) public String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId, @RequestParam(value = "e", required = false, defaultValue = "false") boolean existing, @RequestParam(value = "o", required = false, defaultValue = "true") boolean overwrite) throws IOException { Collection<Association> associations = new ArrayList<>(); associations.addAll(associationRepository.findByStudyId(studyId)); Study study = studyRepository.findOne((studyId)); Collection<EfoTrait> efoTraits = study.getEfoTraits(); if (associations.size() == 0 || efoTraits.size() == 0) { model.addAttribute("study", study); return "no_association_efo_trait_warning"; } else { if (!existing) { for (Association association : associations) { if (association.getEfoTraits().size() != 0) { model.addAttribute("study", study); return "existing_efo_traits_warning"; } } } Collection<EfoTrait> associationTraits = new ArrayList<EfoTrait>(); for (EfoTrait efoTrait : efoTraits) { associationTraits.add(efoTrait); } for (Association association : associations) { if (association.getEfoTraits().size() != 0 && !overwrite) { for (EfoTrait trait : associationTraits) { if (!association.getEfoTraits().contains(trait)) { association.addEfoTrait(trait); } } } else { association.setEfoTraits(associationTraits); } association.setLastUpdateDate(new Date()); associationRepository.save(association); } return "redirect:/studies/" + studyId + "/associations"; } } @Autowired  AssociationController(AssociationRepository associationRepository,
                                 StudyRepository studyRepository,
                                 EfoTraitRepository efoTraitRepository,
                                 AssociationDownloadService associationDownloadService,
                                 SnpAssociationTableViewService snpAssociationTableViewService,
                                 SingleSnpMultiSnpAssociationService singleSnpMultiSnpAssociationService,
                                 SnpInteractionAssociationService snpInteractionAssociationService,
                                 CheckEfoTermAssignmentService checkEfoTermAssignmentService,
                                 AssociationOperationsService associationOperationsService,
                                 AssociationUploadService associationUploadService,
                                 CurrentUserDetailsService currentUserDetailsService,
                                 AssociationValidationReportService associationValidationReportService,
                                 AssociationDeletionService associationDeletionService,
                                 @Qualifier("associationEventsViewService") EventsViewService eventsViewService,
                                 StudyAssociationBatchDeletionEventService studyAssociationBatchDeletionEventService,
                                 EnsemblRestTemplateService ensemblRestTemplateService,
                                 CheckMappingService checkMappingService,
                                 MapCatalogService mapCatalogService,
                                 AssociationService associationService); @InitBinder(value={"snpAssociationStandardMultiForm", "snpAssociationInteractionForm"}) void initBinder(WebDataBinder dataBinder); @RequestMapping(value = "/studies/{studyId}/associations", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String viewStudySnps(Model model,
                                @PathVariable Long studyId,
                                @RequestParam(required = false) Long associationId,
                                @RequestParam(defaultValue = "1", required = false) Integer page); @RequestMapping(value = "studies/{studyId}/association_tracking", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String getAssociationEvents(Model model, @PathVariable Long studyId); @RequestMapping(value = "/studies/{studyId}/associations/upload", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) Callable<String> uploadStudySnps(@RequestParam("file") MultipartFile file,
                                    @PathVariable Long studyId,
                                    Model model,
                                    HttpServletRequest request,
                                    HttpSession session); @RequestMapping(value = "/studies/{studyId}/associations/add_standard", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String addStandardSnpsView(Model model,
                                      @PathVariable Long studyId,
                                      @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String addMultiSnpsView(Model model,
                                   @PathVariable Long studyId,
                                   @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String addSnpInteractionView(Model model,
                                        @PathVariable Long studyId,
                                        @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", params = {"addRows"}) String addRows(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                          Model model,
                          @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = {"addCols"}) String addRows(SnpAssociationInteractionForm snpAssociationInteractionForm,
                          Model model,
                          @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", params = {"addRow"}) String addRow(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                         Model model,
                         @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = {"addCol"}) String addCol(SnpAssociationInteractionForm snpAssociationInteractionForm,
                         Model model,
                         @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", params = {"removeRow"}) String removeRow(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                            HttpServletRequest req,
                            Model model,
                            @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = {"removeCol"}) String removeCol(SnpAssociationInteractionForm snpAssociationInteractionForm,
                            HttpServletRequest req,
                            Model model,
                            @PathVariable Long studyId, @RequestParam(required = true) String measurementType); @RequestMapping(value = "/studies/{studyId}/associations/add_standard", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) String addStandardSnps(@ModelAttribute("form") @Valid SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                  BindingResult bindingResult,
                                  @PathVariable Long studyId,
                                  Model model,
                                  @RequestParam(required = true) String measurementType,
                                  HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/add_multi", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) String addMultiSnps(@ModelAttribute("form") @Valid SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                               BindingResult bindingResult,
                               @PathVariable Long studyId,
                               Model model,
                               @RequestParam(required = true) String measurementType,
                               HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/add_interaction", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) String addSnpInteraction(@ModelAttribute("form") @Valid SnpAssociationInteractionForm snpAssociationInteractionForm,
                                    BindingResult bindingResult,
                                    @PathVariable Long studyId,
                                    Model model,
                                    @RequestParam(required = true) String measurementType, HttpServletRequest request); @RequestMapping(value = "/associations/{associationId}", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String viewAssociation(Model model, @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.POST) // TODO COULD REFACTOR TO JUST USE SUPERCLASS AS METHOD PARAMETER String editAssociation(@ModelAttribute SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                  @ModelAttribute SnpAssociationInteractionForm snpAssociationInteractionForm,
                                  @PathVariable Long associationId,
                                  @RequestParam(value = "associationtype", required = true) String associationType,
                                  Model model, HttpServletRequest request,
                                  RedirectAttributes redirectAttributes); @RequestMapping(value = "/associations/{associationId}", params = {"addRow"}) String addRowEditMode(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                 Model model,
                                 @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", params = {"addCol"}) String addColEditMode(SnpAssociationInteractionForm snpAssociationInteractionForm,
                                 Model model,
                                 @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", params = {"removeRow"}) String removeRowEditMode(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm,
                                    HttpServletRequest req,
                                    Model model,
                                    @PathVariable Long associationId); @RequestMapping(value = "/associations/{associationId}", params = {"removeCol"}) String removeColEditMode(SnpAssociationInteractionForm snpAssociationInteractionForm,
                                    HttpServletRequest req,
                                    Model model,
                                    @PathVariable Long associationId); @RequestMapping(value = "/studies/{studyId}/associations/delete_all", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String deleteAllAssociations(@PathVariable Long studyId, HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/delete_checked", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody Map<String, String> deleteChecked(@RequestParam(value = "associationIds[]") String[] associationsIds,
                                      HttpServletRequest request); @RequestMapping(value = "associations/{associationId}/approve", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String approveSnpAssociation(@PathVariable Long associationId,
                                        RedirectAttributes redirectAttributes,
                                        HttpServletRequest request); @RequestMapping(value = "associations/{associationId}/unapprove", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String unapproveSnpAssociation(@PathVariable Long associationId, HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/approve_checked", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody Map<String, String> approveChecked(@RequestParam(value = "associationIds[]") String[] associationsIds,
                                       HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/unapprove_checked", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseBody Map<String, String> unapproveChecked(@RequestParam(value = "associationIds[]") String[] associationsIds,
                                         HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/approve_all", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String approveAll(@PathVariable Long studyId,
                             RedirectAttributes redirectAttributes,
                             HttpServletRequest request); @RequestMapping(value = "/studies/{studyId}/associations/validate_unapproved", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) Callable<String> validateUnapproved(@PathVariable Long studyId,
                                         RedirectAttributes redirectAttributes,
                                         Model model,
                                         HttpServletRequest request,
                                         HttpSession session); @RequestMapping(value = "/studies/{studyId}/associations/download", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) void downloadStudySnps(HttpServletResponse response, @PathVariable Long studyId); @RequestMapping(value = "/studies/{studyId}/associations/applyefotraits", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String applyStudyEFOtraitToSnps(Model model, @PathVariable Long studyId,
                                           @RequestParam(value = "e",
                                                   required = false,
                                                   defaultValue = "false") boolean existing,
                                           @RequestParam(value = "o",
                                                   required = false,
                                                   defaultValue = "true") boolean overwrite); @RequestMapping(value = "/associations/{associationId}/force_mapping", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String forceMapping(@PathVariable Long associationId, RedirectAttributes redirectAttributes,
                               HttpServletRequest request); @ExceptionHandler(DataIntegrityException.class) String handleDataIntegrityException(DataIntegrityException dataIntegrityException); @ExceptionHandler({SheetProcessingException.class}) String handleInvalidFormatExceptionAndInvalidOperationException(); @ExceptionHandler({IOException.class}) String handleIOException(); @ExceptionHandler({FileUploadException.class}) String handleFileUploadException(); @ExceptionHandler({FileNotFoundException.class}) String handleFileNotFound(); @ModelAttribute("efoTraits") List<EfoTrait> populateEfoTraits(); @PreDestroy void destroy(); @RequestMapping(value = "/studies/{studyId}/associations/status", method = RequestMethod.GET) @ResponseBody boolean checkUploadStatus(HttpSession session); @RequestMapping(value = "/studies/{studyId}/associations/getUploadResults", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String getUploadResult(@PathVariable Long studyId, HttpSession session, Model model); @RequestMapping(value = "/studies/{studyId}/associations/getValidationResults", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) String getValidationResult(@PathVariable Long studyId, HttpSession session, Model model, RedirectAttributes redirectAttributes);  }