- Timestamp:
- Jan 26, 2010, 10:48:51 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r135 r136 24 24 // ontologies 25 25 def speciesOntology = new Ontology( 26 name: ' Species',27 shortName: ' Species',26 name: 'NCBI Taxonomy', 27 shortName: 'Taxon', 28 28 url: 'http://www.obofoundry.org/cgi-bin/detail.cgi?id=ncbi_taxonomy' 29 29 ).save() … … 51 51 */ 52 52 53 // define template fields54 def genotypeTemplateField = new TemplateSubjectField(55 name: 'Genotype',56 type: TemplateFieldType.STRINGLIST57 ).save()58 59 53 // Mouse template 60 54 def mouseTemplate = new Template( 61 55 name: 'Mouse' 62 ).addToSubjectFields(genotypeTemplateField).save() 56 ).addToSubjectFields(new TemplateSubjectField( 57 name: 'Genotype',type: TemplateFieldType.STRINGLIST)) 58 .addToSubjectFields(new TemplateSubjectField( 59 name: 'Age',type: TemplateFieldType.NUMBER) 60 ).save() 63 61 64 62 // studies 65 new Study(title:"test",code:"code",researchQuestion:"Rquestion",description:"description",ecCode:"ecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save() 63 def exampleStudy = new Study( 64 title:"NuGO PPS3 mouse study leptin module", 65 code:"PPS3_leptin_module", 66 researchQuestion:"Leptin etc.", 67 description:"C57Bl/6 mice were fed a high fat (45 en%) or low fat (10 en%) diet after a four week run-in on low fat diet. After 1 week 10 mice that received a low fat diet were given an IP leptin challenge and 10 mice of the low-fat group received placebo injections. The same procedure was performed with mice that were fed the high-fat diet. After 4 weeks the procedure was repeated. In total 80 mice were culled.", 68 ecCode:"2007117.c", 69 startDate: Date.parse('yyyy-MM-dd','2007-12-11')) 70 def x=1 71 12.times { 72 exampleStudy.addToSubjects(new Subject( 73 name: "A" + x++, 74 species: mouseTerm, 75 templateStringFields: ["Genotype" : "C57/Bl6j"], 76 templateNumberFields: ["Age" : 17F] 77 ))} 78 exampleStudy.save() 79 66 80 new Study(title:"example",code:"Excode",researchQuestion:"ExRquestion",description:"Exdescription",ecCode:"ExecCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save() 67 81 new Study(title:"testAgain",code:"testcode",researchQuestion:"testRquestion",description:"testdescription",ecCode:"testCode",dateCreated:new Date(),lastUpdated:new Date(),startDate:new Date()).save() -
trunk/grails-app/controllers/dbnp/studycapturing/SubjectController.groovy
r92 r136 4 4 5 5 //def index = { } 6 def scaffold = true6 def scaffold = dbnp.studycapturing.Subject 7 7 } -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r106 r136 9 9 * $Date$ 10 10 */ 11 class Study implements Serializable{11 class Study { 12 12 nimble.User owner 13 13 String title … … 38 38 researchQuestion type: 'text' 39 39 description type: 'text' 40 autoTimestamp true 40 41 } 41 42 -
trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy
r106 r136 8 8 class Subject { 9 9 10 String name 11 Term species 10 String name 11 Term species 12 Map templateStringFields 13 Map templateNumberFields 14 Map templateStringListFields 15 Map templateTermFields 12 16 13 static constraints = { 14 } 17 static hasMany = [ 18 templateStringFields : String, 19 templateNumberFields : float, 20 templateStringListFields : String, 21 templateTermFields : Term 22 ] 23 24 static constraints = { 25 } 15 26 } -
trunk/grails-app/domain/dbnp/studycapturing/TemplateField.groovy
r92 r136 7 7 String name 8 8 TemplateFieldType type 9 String unit 9 10 10 11 static constraints = { 12 name(unique:true) 13 unit(nullable:true, blank:true) 11 14 } 12 15
Note: See TracChangeset
for help on using the changeset viewer.