Changeset 2214


Ignore:
Timestamp:
Apr 5, 2012, 7:58:16 PM (5 years ago)
Author:
work@…
Message:

removed 'count' from getMeasurementDataForAssay as the JSON parser sometimes seems to break with a strange error 'misplaced key' when more than just the 'measurements' is returned. Weird, but it's not really necessary altogether, so better to get it out...

Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/api/ApiController.groovy

    r2213 r2214  
    275275            // define sample measurement data matrix
    276276            def matrix = [:]
    277             def measurementData = apiService.getMeasurementData(assay, user)
     277            def measurementData = apiService.getMeasurementData(assay, user).toArray()
    278278            //def measurementMetaData = apiService.getMeasurementData(assay, user)
    279279
    280280            // iterate through measurementData and build data matrix
    281 //            try {
     281            try {
    282282                measurementData.each { data ->
    283283                    if (!matrix.containsKey(data.sampleToken)) matrix[data.sampleToken] = [:]
     
    286286
    287287                // define result
    288                 def result = [
    289                         'count'         : matrix.size(),
     288                def result = [:]
     289                result = [
    290290                        'measurements'  : matrix
    291291                ]
     
    300300                    render result as JSON
    301301                }
    302 //            } catch (Exception e) {
    303 //                println "getMeasurementDataForAssay exception: ${e.getMessage()}"
    304 //                response.sendError(500, "module '${assay.module}' does not properly implement getMeasurementData REST specification (${e.getMessage()})")
    305 //            }
     302            } catch (Exception e) {
     303                println "getMeasurementDataForAssay exception: ${e.getMessage()}"
     304                response.sendError(500, "module '${assay.module}' does not properly implement getMeasurementData REST specification (${e.getMessage()})")
     305            }
    306306        })
    307307    }
  • trunk/grails-app/views/api/index.gsp

    r2202 r2214  
    533533<blockquote>
    534534    {
    535     "count":
    536     14,
    537535    "measurements":
    538536    {
Note: See TracChangeset for help on using the changeset viewer.