Changeset 2195
- Timestamp:
- Mar 30, 2012, 11:57:20 AM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/api/ApiController.groovy
r2194 r2195 185 185 } else { 186 186 def assays = apiService.flattenDomainData( study.assays ) 187 187 188 188 // define result 189 189 def result = [ … … 223 223 response.sendError(401, 'Unauthorized') 224 224 } 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 user233 );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 // ); 234 234 235 235 // define result 236 236 def result = [ 237 'measurements' : measurements237 'measurements' : apiService.getMeasurements(assay, user) 238 238 // 'measurements' : ApiService.getMeasurements(assay, user), 239 239 // 'data' : ApiService.getMeasurementData(assay, user), -
trunk/grails-app/services/api/ApiService.groovy
r2193 r2195 22 22 // the shared secret used to validate api calls 23 23 static final String API_SECRET = "th!s_sH0uld^Pr0bab7y_m0v3_t%_th3_uSeR_d0Ma!n_ins7ead!" 24 static transactional = true24 static transactional = false 25 25 def moduleCommunicationService 26 26 … … 62 62 */ 63 63 def flattenDomainData(List elements) { 64 println elements.class65 64 def items = [] 66 65 -
trunk/grails-app/views/api/index.gsp
r2188 r2195 63 63 <li><a href="#getSubjectsForStudy">getSubjectsForStudy</a> - fetch all subjects in a given study</li> 64 64 <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> 65 66 66 67 <a name="authenticate"></a> … … 277 278 </blockquote> 278 279 </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 279 329 </div> 280 330 </body>
Note: See TracChangeset
for help on using the changeset viewer.