Changeset 2195


Ignore:
Timestamp:
Mar 30, 2012, 11:57:20 AM (5 years ago)
Author:
work@…
Message:
  • added getAssayData api call
Location:
trunk/grails-app
Files:
3 edited

Legend:

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

    r2194 r2195  
    185185        } else {
    186186            def assays = apiService.flattenDomainData( study.assays )
    187            
     187
    188188            // define result
    189189            def result = [
     
    223223            response.sendError(401, 'Unauthorized')
    224224        } else {
    225             def serviceURL = "${assay.module.url}/rest/getMeasurements"
    226             def serviceArguments = "assayToken=${assayToken}"
    227             def measurements = moduleCommunicationService.callModuleMethod(
    228                     assay.module.url,
    229                     serviceURL,
    230                     serviceArguments,
    231                     "POST",
    232                     user
    233             );
     225//            def serviceURL = "${assay.module.url}/rest/getMeasurements"
     226//            def serviceArguments = "assayToken=${assayToken}"
     227//            def measurements = moduleCommunicationService.callModuleMethod(
     228//                    assay.module.url,
     229//                    serviceURL,
     230//                    serviceArguments,
     231//                    "POST",
     232//                    user
     233//            );
    234234
    235235            // define result
    236236            def result = [
    237                     'measurements'  : measurements
     237                    'measurements'  : apiService.getMeasurements(assay, user)
    238238//                'measurements'  : ApiService.getMeasurements(assay, user),
    239239//                'data'          : ApiService.getMeasurementData(assay, user),
  • trunk/grails-app/services/api/ApiService.groovy

    r2193 r2195  
    2222    // the shared secret used to validate api calls
    2323    static final String API_SECRET = "th!s_sH0uld^Pr0bab7y_m0v3_t%_th3_uSeR_d0Ma!n_ins7ead!"
    24     static transactional = true
     24    static transactional = false
    2525    def moduleCommunicationService
    2626
     
    6262     */
    6363    def flattenDomainData(List elements) {
    64         println elements.class
    6564        def items = []
    6665
  • trunk/grails-app/views/api/index.gsp

    r2188 r2195  
    6363    <li><a href="#getSubjectsForStudy">getSubjectsForStudy</a> - fetch all subjects in a given study</li>
    6464    <li><a href="#getAssaysForStudy">getAssaysForStudy</a> - fetch all assays in a given study</li>
     65    <li><a href="#getAssayData">getAssayData</a> - fetch all measurement data for a given assay</li>
    6566
    6667<a name="authenticate"></a>
     
    277278    </blockquote>
    278279</p>
     280
     281<a name="getAssayData"></a>
     282<h1>getAssaysData</h1>
     283<h3>url: <g:createLink controller="api" action="getAssaysData" absolute="true" /></h3>
     284<p>
     285    Returns the measurement data for a particular assay
     286
     287<h2>Request parameters</h2>
     288<table>
     289    <thead>
     290    <th>argument</th>
     291    <th>type</th>
     292    <th>length</th>
     293    <th>description</th>
     294    <th>example</th>
     295    <th>required</th>
     296    </thead>
     297    <tr>
     298        <td>deviceID</td>
     299        <td>string</td>
     300        <td>36 (max)</td>
     301        <td>a unique ID of the client device / application performing the call</td>
     302        <td>9ae87836-d38d-4b86-be6a-eff93f2b049a</td>
     303        <td>yes</td>
     304    </tr>
     305    <tr>
     306        <td>validation</td>
     307        <td>string</td>
     308        <td>-</td>
     309        <td><a href="http://www.miraclesalad.com/webtools/md5.php" target="_new">md5sum</a>( token + sequence + shared secret )</td>
     310        <td>9ae87836d38d4b86be6aeff93f2b049a</td>
     311        <td>yes</td>
     312    </tr>
     313    <tr>
     314        <td>assayToken</td>
     315        <td>string</td>
     316        <td>255</td>
     317        <td>assay token (see getAssays)</td>
     318        <td>b6e0c6f4-d8db-4a43-91fa-a157d2d492f0</td>
     319        <td>yes</td>
     320    </tr>
     321</table>
     322
     323<h2>example reply</h2>
     324<blockquote>
     325...todo...
     326</blockquote>
     327</p>
     328
    279329</div>
    280330</body>
Note: See TracChangeset for help on using the changeset viewer.