Ignore:
Timestamp:
Nov 19, 2010, 1:19:00 PM (12 years ago)
Author:
work@…
Message:
  • this change is part of #185
  • moved object instantes out of Config.groovy (this should only contain configuration)
  • moved module specific configuration for SAM and Metabolomics out of BootStrapStudies?.groovy and into Config.groovy
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrapStudies.groovy

    r1163 r1178  
    1515import grails.util.GrailsUtil
    1616import dbnp.rest.common.CommunicationManager
     17import org.codehaus.groovy.grails.commons.*
     18
    1719
    1820class BootStrapStudies {
     
    2123         * Add example studies. This function is meant to be called only in development mode
    2224         */
    23 
    2425        public static void addExampleStudies(dbnp.authentication.SecUser owner, dbnp.authentication.SecUser otherUser ) {
    2526                "inserting initial studies".grom()
     27
     28                // get configuration
     29                def config = ConfigurationHolder.config
    2630
    2731                // Look up the used ontologies which should be in the database by now
     
    463467                .with { if (!validate()) { errors.each { println it} } else save()}
    464468
    465                 // sam urls are in config.groovy, where they belong...
    466                 // if that doesn't work for you, make it work... now you're
    467                 // 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.SAMServerURL
    471 
    472469                // Add SAM assay reference
    473470                def clinicalModule = new AssayModule(
    474471                        name: 'SAM module for clinical data',
    475472                        platform: 'clinical measurements',
    476                         url: samURL
     473                        url: config.modules.sam.url
    477474                ).with { if (!validate()) { errors.each { println it} } else save()}
    478475
     
    481478                        name: 'Metabolomics module',
    482479                        platform: 'GCMS/LCMS',
    483                         url: nmcdspURL
     480                        url: config.modules.metabolomics.url
    484481                ).with { if (!validate()) { errors.each { println it} } else save()}
    485482
Note: See TracChangeset for help on using the changeset viewer.