Changeset 2059


Ignore:
Timestamp:
Oct 13, 2011, 5:11:02 PM (6 years ago)
Author:
taco@…
Message:

visualization/VisualizeController.groovy, 'getData' function. If the user is requesting data that concerns only subjects, then make sure those subjects appear only once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/visualization/VisualizeController.groovy

    r2058 r2059  
    320320                def samples = study.samples
    321321
     322        // If the user is requesting data that concerns only subjects, then make sure those subjects appear only once
     323        if(parseFieldId( inputData.columnIds[ 0 ] ).type=='subjects' && parseFieldId( inputData.rowIds[ 0 ] ).type=='subjects'){
     324            samples.unique { it.parentSubject }
     325        }
     326       
    322327                // Retrieve the data for both axes for all samples
    323328                // TODO: handle the case of multiple fields on an axis
     
    343348            returnData = formatData( inputData.visualizationType, groupedData, fields, groupAxisType, valueAxisType ); // Don't indicate axis ordering, standard <"x", "y"> will be used
    344349        }
     350
     351        // Make sure no changes are written to the database
     352        study.discard()
     353        samples*.discard()
     354       
    345355        return sendResults(returnData)
    346356        }
Note: See TracChangeset for help on using the changeset viewer.