Search in sources :

Example 16 with MappingDetails

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

the class AssociationController method removeColEditMode.

// Remove column from table
@RequestMapping(value = "/associations/{associationId}", params = { "removeCol" })
public String removeColEditMode(SnpAssociationInteractionForm snpAssociationInteractionForm, HttpServletRequest req, Model model, @PathVariable Long associationId) {
    // Index of value to remove
    final Integer colId = Integer.valueOf(req.getParameter("removeCol"));
    // Remove col
    snpAssociationInteractionForm.getSnpFormColumns().remove(colId.intValue());
    // Pass back updated form
    model.addAttribute("form", snpAssociationInteractionForm);
    // Also passes back study object to view so we can create links back to main study page
    Association currentAssociation = associationRepository.findOne(associationId);
    Study associationStudy = currentAssociation.getStudy();
    Long studyId = associationStudy.getId();
    model.addAttribute("study", studyRepository.findOne(studyId));
    // Determine if association is an OR or BETA type
    String measurementType = associationOperationsService.determineIfAssociationIsOrType(currentAssociation);
    model.addAttribute("measurementType", measurementType);
    // Get mapping details
    MappingDetails mappingDetails = associationOperationsService.createMappingDetails(currentAssociation);
    model.addAttribute("mappingDetails", mappingDetails);
    // Return any association errors
    model.addAttribute("errors", associationValidationReportService.generateAssociationWarningsListView(associationId));
    return "edit_snp_interaction_association";
}
Also used : LastViewedAssociation(uk.ac.ebi.spot.goci.curation.model.LastViewedAssociation) MappingDetails(uk.ac.ebi.spot.goci.curation.model.MappingDetails) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MappingDetails (uk.ac.ebi.spot.goci.curation.model.MappingDetails)16 LastViewedAssociation (uk.ac.ebi.spot.goci.curation.model.LastViewedAssociation)9 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)7 Timestamp (java.sql.Timestamp)5 SimpleDateFormat (java.text.SimpleDateFormat)4 Test (org.junit.Test)4 AssociationValidationView (uk.ac.ebi.spot.goci.curation.model.AssociationValidationView)4 SnpAssociationForm (uk.ac.ebi.spot.goci.curation.model.SnpAssociationForm)4 SnpAssociationInteractionForm (uk.ac.ebi.spot.goci.curation.model.SnpAssociationInteractionForm)4 SnpFormColumn (uk.ac.ebi.spot.goci.curation.model.SnpFormColumn)4 SnpFormRow (uk.ac.ebi.spot.goci.curation.model.SnpFormRow)4 FileNotFoundException (java.io.FileNotFoundException)3 IOException (java.io.IOException)3 DateFormat (java.text.DateFormat)3 java.util (java.util)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)3 Valid (javax.validation.Valid)3 Logger (org.slf4j.Logger)3 LoggerFactory (org.slf4j.LoggerFactory)3