Changeset 562


Ignore:
Timestamp:
Jun 14, 2010, 1:36:56 PM (13 years ago)
Author:
keesvb
Message:

version 0.3.1: re-enabled saving and deleted >0 subjects requirement in create wizard, disabled test persons/publications in BootStrap?

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/application.properties

    r561 r562  
    99app.name=gscf
    1010app.servlet.version=2.4
    11 app.version=0.3.0
     11app.version=0.3.1
    1212plugins.crypto=2.0
    1313plugins.db-util=0.4
  • trunk/grails-app/conf/BootStrap.groovy

    r561 r562  
    118118                        ).with { if (!validate()) { errors.each { println it} } else save()}
    119119
    120                         // Create a few persons, roles and Affiliations
    121                         println ".adding persons, roles and affiliations"
    122                         def affiliation1 = new PersonAffiliation(
    123                             institute: "Science Institute NYC",
    124                         department: "Department of Mathematics"
    125                         ).save();
    126                         def affiliation2 = new PersonAffiliation(
    127                             institute: "InfoStats GmbH, Hamburg",
    128                         department: "Life Sciences"
    129                         ).save();
    130                         def role1 = new PersonRole(
    131                             name: "Principal Investigator"
    132                         ).save();
    133                         def role2 = new PersonRole(
    134                             name: "Statician"
    135                         ).save();
    136 
    137                         // Create persons
    138                         def person1 = new Person(
    139                             lastName: "Scientist",
    140                             firstName: "John",
    141                             gender: "Male",
    142                             initials: "J.R.",
    143                             email: "john@scienceinstitute.com",
    144                             phone: "1-555-3049",
    145                             address: "First street 2,NYC"
    146                         )
    147                         .addToAffiliations( affiliation1 )
    148                         .addToAffiliations( affiliation2 )
    149                         .save();
    150 
    151                         def person2 = new Person(
    152                             lastName: "Statician",
    153                             firstName: "Jane",
    154                             gender: "Female",
    155                             initials: "W.J.",
    156                             email: "jane@statisticalcompany.de",
    157                             phone: "49-555-8291",
    158                             address: "Dritten strasse 38, Hamburg, Germany"
    159                         )
    160                         .addToAffiliations( affiliation2 )
    161                         .save();
    162 
    163                         // Create 30 persons to test pagination
    164120                        if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) {
    165                                 def personCounter = 1;
    166                                 30.times { new Person( firstName: "Person #${personCounter}", lastName: "Testperson", email: "email${personCounter++}@testdomain.com" ).save() }
    167                         }
    168 
    169                         // Create a few publications
    170                         println ".adding publications"
    171                         def publication1 = new Publication(
    172                         title: "Postnatal development of hypothalamic leptin receptors",
    173                             authorsList: "Cottrell EC, Mercer JG, Ozanne SE.",
    174                             pubMedID: "20472140",
    175                             comments: "Not published yet",
    176                             DOI: "unknown"
    177                         )
    178                         .save();
    179 
    180                         def publication2 = new Publication(
    181                         title: "Induction of regulatory T cells decreases adipose inflammation and alleviates insulin resistance in ob/ob mice",
    182                             authorsList: "Ilan Y, Maron R, Tukpah AM, Maioli TU, Murugaiyan G, Yang K, Wu HY, Weiner HL.",
    183                             pubMedID: "20445103",
    184                             comments: "",
    185                             DOI: ""
    186                         )
    187                         .save();
     121
     122                                // Create a few persons, roles and Affiliations
     123                                println ".adding persons, roles and affiliations"
     124                                def affiliation1 = new PersonAffiliation(
     125                                        institute: "Science Institute NYC",
     126                                        department: "Department of Mathematics"
     127                                ).save();
     128                                def affiliation2 = new PersonAffiliation(
     129                                        institute: "InfoStats GmbH, Hamburg",
     130                                        department: "Life Sciences"
     131                                ).save();
     132                                def role1 = new PersonRole(
     133                                        name: "Principal Investigator"
     134                                ).save();
     135                                def role2 = new PersonRole(
     136                                        name: "Statician"
     137                                ).save();
     138
     139                                // Create persons
     140                                def person1 = new Person(
     141                                        lastName: "Scientist",
     142                                        firstName: "John",
     143                                        gender: "Male",
     144                                        initials: "J.R.",
     145                                        email: "john@scienceinstitute.com",
     146                                        phone: "1-555-3049",
     147                                        address: "First street 2,NYC"
     148                                )
     149                                .addToAffiliations( affiliation1 )
     150                                .addToAffiliations( affiliation2 )
     151                                .save();
     152
     153                                def person2 = new Person(
     154                                        lastName: "Statician",
     155                                        firstName: "Jane",
     156                                        gender: "Female",
     157                                        initials: "W.J.",
     158                                        email: "jane@statisticalcompany.de",
     159                                        phone: "49-555-8291",
     160                                        address: "Dritten strasse 38, Hamburg, Germany"
     161                                )
     162                                .addToAffiliations( affiliation2 )
     163                                .save();
     164
     165                                // Create 30 persons to test pagination
     166                                def personCounter = 1;
     167                                30.times { new Person( firstName: "Person #${personCounter}", lastName: "Testperson", email: "email${personCounter++}@testdomain.com" ).save() }
     168
     169                                // Create a few publications
     170                                println ".adding publications"
     171                                def publication1 = new Publication(
     172                                        title: "Postnatal development of hypothalamic leptin receptors",
     173                                        authorsList: "Cottrell EC, Mercer JG, Ozanne SE.",
     174                                        pubMedID: "20472140",
     175                                        comments: "Not published yet",
     176                                        DOI: "unknown"
     177                                )
     178                                .save();
     179
     180                                def publication2 = new Publication(
     181                                        title: "Induction of regulatory T cells decreases adipose inflammation and alleviates insulin resistance in ob/ob mice",
     182                                        authorsList: "Ilan Y, Maron R, Tukpah AM, Maioli TU, Murugaiyan G, Yang K, Wu HY, Weiner HL.",
     183                                        pubMedID: "20445103",
     184                                        comments: "",
     185                                        DOI: ""
     186                                )
     187                                .save();
     188                        }
    188189
    189190            // Create templates
     
    755756
    756757                        // Add example studies
    757                         if (grails.util.GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) {
     758                        if (grails.util.GrailsUtil.environment != GrailsApplication.ENV_TEST) {
    758759                                println ".adding NuGO PPS3 leptin example study..."
    759760                                def mouseStudy = new Study(
  • trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy

    r557 r562  
    373373                                flash.errors = [:]
    374374
    375                                 // check if we have at least one subject
    376                                 // and check form data
    377                                 if (flow.subjects.size() < 1) {
    378                                         // append error map
    379                                         this.appendErrorMap(['subjects': 'You need at least to create one subject for your study'], flash.errors)
    380                                         error()
    381                                 } else if (!this.handleSubjects(flow, flash, params)) {
     375                                // check form data
     376                                if (!this.handleSubjects(flow, flash, params)) {
    382377                                        error()
    383378                                } else {
     
    388383                                flash.errors = [:]
    389384
    390                                 // check if we have at least one subject
    391                                 // and check form data
    392                                 if (flow.subjects.size() < 1) {
    393                                         // append error map
    394                                         this.appendErrorMap(['subjects': 'You need at least to create one subject for your study'], flash.errors)
    395                                         error()
    396                                 } else if (!this.handleSubjects(flow, flash, params)) {
     385                                // check form data
     386                                if (!this.handleSubjects(flow, flash, params)) {
    397387                                        error()
    398388                                } else {
     
    663653                        on("next") {
    664654                                success()
    665                         }.to "samples"
     655                        }.to "confirm"
    666656                        on("quickSave") {
    667657                                success()
Note: See TracChangeset for help on using the changeset viewer.