Changeset 1985
- Timestamp:
- Sep 1, 2011, 2:38:54 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 12 12 dtd 13 13 *.mp4 14 dump
-
- Property svn:ignore
-
trunk/application.properties
r1976 r1985 1 1 #Grails Metadata file 2 # Fri Jul 01 16:43:44CEST 20112 #Thu Sep 01 11:36:46 CEST 2011 3 3 app.build.display.info=1 4 4 app.build.svn.revision=1079 -
trunk/grails-app/controllers/RestController.groovy
r1974 r1985 366 366 */ 367 367 def getAssays = { 368 def moduleURL, moduleInet, assayModuleURL, assayModuleInet 369 368 370 // Check which user has been logged in 369 371 def user = authenticationService.getRemotelyLoggedInUser( params.consumer, params.token ) … … 381 383 return 382 384 } 383 385 384 386 def assays = [] 385 387 386 388 if( params.studyToken ) { 387 388 389 def study = Study.findByStudyUUID(params.studyToken) 389 390 … … 424 425 425 426 // Create data for all assays 427 moduleURL = new URL(params.moduleURL) 428 moduleInet = InetAddress.getByName(moduleURL.getHost()) 426 429 assays.each{ assay -> 427 if (assay.module?.url && assay.module.url.equals(params.moduleURL)) { 428 if(assay) { 430 /** 431 * assay.module.url does not necessarily have to match the moduleURL 432 * completely (e.g. when using a hosts file vs ip), especially when using 433 * localhost, 127.0.01 or a host name that aliasses localhost. 434 * 435 * Therefore we will resolve the host names and compare the resulting ip 436 * addresses and see if they match 437 * 438 * future improvement: do not use the module URL for matching at all. Perhaps 439 * a module identifier or a 'module token' would be better as this is not 440 * url dependant. 441 */ 442 if (assay.module?.url) { 443 assayModuleURL = new URL(assay.module.url) 444 assayModuleInet = InetAddress.getByName(assayModuleURL.getHost()) 445 446 if ( 447 moduleInet.hostAddress == assayModuleInet.hostAddress && // match ip addresses 448 moduleURL.path == assayModuleURL.path && // match host path 449 assay // got assay? 450 ) { 429 451 def map = [assayToken : assay.giveUUID()] 452 430 453 assay.giveFields().each { field -> 431 454 def name = field.name … … 433 456 map[name] = value 434 457 } 458 435 459 map["parentStudyToken"] = assay.parent.giveUUID() 436 460 returnList.push( map )
Note: See TracChangeset
for help on using the changeset viewer.