Changeset 1178 for trunk/grails-app/conf
- Timestamp:
- Nov 19, 2010, 1:19:00 PM (12 years ago)
- Location:
- trunk/grails-app/conf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r1127 r1178 9 9 import dbnp.studycapturing.Sample 10 10 import dbnp.rest.common.CommunicationManager 11 import org.codehaus.groovy.grails.commons.* 11 12 12 13 /** … … 28 29 "bootstrapping application".grom() 29 30 31 // get configuration 32 def config = ConfigurationHolder.config 33 30 34 // define timezone 31 35 System.setProperty('user.timezone', 'CET') … … 33 37 // set up authentication (if required) 34 38 if (!SecRole.count() || !SecUser.count()) BootStrapAuthentication.initDefaultAuthentication(springSecurityService) 39 40 // set up the SAM communication manager 41 // this should probably more dynamic and put into the modules 42 // section instead of the bootstrap as not all instances will 43 // probably run WITH sam. GSCF should be able to run independently 44 // from other modules. Part of gscf ticket #185 45 if (config.modules?.sam) { 46 // register SAM REST methods 47 "Registering SAM REST methods".grom() 48 CommunicationManager.SAMServerURL = config.modules.sam.url 49 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 50 } 35 51 36 52 // developmental bootstrapping: … … 57 73 TemplateEntity.getField(Subject.domainFields, 'species').ontologies = [Ontology.getOrCreateOntologyByNcboId(1132)] 58 74 TemplateEntity.getField(Sample.domainFields, 'material').ontologies = [Ontology.getOrCreateOntologyByNcboId(1005)] 59 60 // register SAM REST methods61 "Registering SAM REST methods".grom()62 CommunicationManager.registerRestWrapperMethodsSAMtoGSCF()63 75 } 64 76 -
trunk/grails-app/conf/BootStrapStudies.groovy
r1163 r1178 15 15 import grails.util.GrailsUtil 16 16 import dbnp.rest.common.CommunicationManager 17 import org.codehaus.groovy.grails.commons.* 18 17 19 18 20 class BootStrapStudies { … … 21 23 * Add example studies. This function is meant to be called only in development mode 22 24 */ 23 24 25 public static void addExampleStudies(dbnp.authentication.SecUser owner, dbnp.authentication.SecUser otherUser ) { 25 26 "inserting initial studies".grom() 27 28 // get configuration 29 def config = ConfigurationHolder.config 26 30 27 31 // Look up the used ontologies which should be in the database by now … … 463 467 .with { if (!validate()) { errors.each { println it} } else save()} 464 468 465 // sam urls are in config.groovy, where they belong...466 // if that doesn't work for you, make it work... now you're467 // breaking the other environments....468 //def samURL = GrailsUtil.environment == GrailsApplication.ENV_PRODUCTION ? 'http://sam.nmcdsp.org' : 'http://localhost:8182/sam'469 def nmcdspURL = GrailsUtil.environment == GrailsApplication.ENV_PRODUCTION ? 'http://metabolomics.nmcdsp.org' : 'http://localhost:8183/nmcdsp'470 def samURL = CommunicationManager.SAMServerURL471 472 469 // Add SAM assay reference 473 470 def clinicalModule = new AssayModule( 474 471 name: 'SAM module for clinical data', 475 472 platform: 'clinical measurements', 476 url: samURL473 url: config.modules.sam.url 477 474 ).with { if (!validate()) { errors.each { println it} } else save()} 478 475 … … 481 478 name: 'Metabolomics module', 482 479 platform: 'GCMS/LCMS', 483 url: nmcdspURL480 url: config.modules.metabolomics.url 484 481 ).with { if (!validate()) { errors.each { println it} } else save()} 485 482 -
trunk/grails-app/conf/Config.groovy
r1171 r1178 51 51 development { 52 52 grails.serverURL = "http://localhost:8080/${appName}" 53 54 CommunicationManager.SAMServerURL = 'http://localhost:8182/sam' 55 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 53 modules { 54 sam { 55 url = "http://localhost:8182/sam" 56 } 57 metabolomics { 58 url = "http://localhost:8183/nmcdsp" 59 } 60 } 56 61 } 57 62 ci { 58 63 // used by build script 59 64 grails.serverURL = "http://ci.gscf.nmcdsp.org" 60 61 CommunicationManager.SAMServerURL = 'http://ci.sam.nmcdsp.org' 62 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 65 modules { 66 sam { 67 url = "http://ci.sam.nmcdsp.org" 68 } 69 metabolomics { 70 url = "http://ci.metabolomics.nmcdsp.org" 71 } 72 } 63 73 } 64 74 test { 65 75 // used by build script 66 76 grails.serverURL = "http://test.gscf.nmcdsp.org" 67 68 CommunicationManager.SAMServerURL = 'http://test.sam.nmcdsp.org' 69 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 77 modules { 78 sam { 79 url = "http://test.sam.nmcdsp.org" 80 } 81 metabolomics { 82 url = "http://test.metabolomics.nmcdsp.org" 83 } 84 } 70 85 } 71 86 dbnptest { 72 87 // used by build script 73 88 grails.serverURL = "http://test.dbnp.org" 74 75 CommunicationManager.SAMServerURL = 'http://test.sam.dbnp.org' 76 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 89 modules { 90 sam { 91 url = "http://test.sam.dbnp.org" 92 } 93 metabolomics { 94 url = "http://test.metabolomics.dbnp.org" 95 } 96 } 77 97 } 78 98 dbnpdemo { 79 99 // used by build script 80 100 grails.serverURL = "http://demo.dbnp.org" 81 82 CommunicationManager.SAMServerURL = 'http://demo.sam.dbnp.org' 83 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 101 modules { 102 sam { 103 url = "http://demo.sam.dbnp.org" 104 } 105 metabolomics { 106 url = "http://demo.metabolomics.dbnp.org" 107 } 108 } 84 109 } 85 110 production { 86 111 grails.serverURL = "http://www.nmcdsp.org" 87 88 CommunicationManager.SAMServerURL = 'http://sam.nmcdsp.org' 89 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 112 modules { 113 sam { 114 url = "http://sam.nmcdsp.org" 115 } 116 metabolomics { 117 url = "http://metabolomics.nmcdsp.org" 118 } 119 } 90 120 } 91 121 www { 92 122 // used by build script 93 123 grails.serverURL = "http://www.nmcdsp.org" 94 95 CommunicationManager.SAMServerURL = 'http://sam.nmcdsp.org' 96 CommunicationManager.registerRestWrapperMethodsGSCFtoSAM() 124 modules { 125 sam { 126 url = "http://sam.nmcdsp.org" 127 } 128 metabolomics { 129 url = "http://metabolomics.nmcdsp.org" 130 } 131 } 97 132 } 98 133 }
Note: See TracChangeset
for help on using the changeset viewer.