Show
Ignore:
Timestamp:
19-07-10 16:28:10 (4 years ago)
Author:
keesvb
Message:

restructured BootStrap?, it should now run faster because there are no BioPortal? connections, and it adds sample studies in development mode (outcomment the addExampleStudies call in the BootStrap? if you don't want that). Renamed TemplateEntity?.getFieldType to giveFieldType and added tests to SampleTests? for the method.

Files:
1 modified

Legend:

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

    r639 r662  
    2222                System.setProperty('user.timezone', 'CET') 
    2323 
     24                // If there are no templates yet in the database 
    2425                if (Template.count() == 0) { 
    2526                        println "No templates in the current database."; 
     27 
     28                        // If in development or test mode, add the ontologies manually to the database 
     29                        // without contacting the BioPortal website, to avoid annoying hiccups when the server is busy 
     30                        if (grails.util.GrailsUtil.environment != GrailsApplication.ENV_PRODUCTION) { 
     31                                println "Adding ontology descriptors" 
     32                                BootStrapTemplates.initTemplateOntologies() 
     33                        } 
     34 
    2635                        // Add example study, subject, event etc. templates 
    2736                        BootStrapTemplates.initTemplates() 
    2837 
    29                         // Add example studies 
     38                        // If in development mode and no studies are present, add example studies 
    3039                        if (Study.count() == 0 && grails.util.GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) { 
    31  
    32                                 // When the code is properly refactored, BootStrapStudies.addExampleStudies() may be called here 
     40                                BootStrapStudies.addExampleStudies() 
    3341                        } 
    3442                } 
     
    4553                // register methods for accessing SAM's Rest services  
    4654                CommunicationManager.SAMServerURL = 'nbx5.nugo.org/sam' 
    47         CommunicationManager.registerRestWrapperMethodsSAMtoGSCF() 
     55                CommunicationManager.registerRestWrapperMethodsSAMtoGSCF() 
    4856        } 
    4957