- Timestamp:
- Feb 10, 2010, 5:35:11 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r188 r189 31 31 ).with { if (!validate()) { errors.each { println it} } else save()} 32 32 33 34 33 def humanBodyOntology = new Ontology( 35 34 name: 'Foundational Model of Anatomy', … … 67 66 accession: 'P-MDMXGE-264' 68 67 ).with { if (!validate()) { errors.each { println it} } else save()} 69 70 71 68 72 69 def treatmentProtocol = new Protocol( … … 158 155 .addToSubjectFields(new TemplateSubjectField( 159 156 name: 'Cage',type: TemplateFieldType.INTEGER)) 157 .addToSubjectFields(new TemplateSubjectField( 158 name: 'Some float', type: TemplateFieldType.FLOAT)) 159 .addToSubjectFields(new TemplateSubjectField( 160 name: 'Some ontology', type: TemplateFieldType.ONTOLOGYTERM)) 160 161 .with { if (!validate()) { errors.each { println it} } else save()} 161 162 … … 238 239 } 239 240 240 241 /* 241 242 println 'Adding PPSH study...' 242 243 243 244 def humanStudy = new Study( 244 245 title:"NuGO PPS human study", 245 246 code:"PPSH", … … 355 356 humanStudy.addToAssays(lipidAssayRef); 356 357 humanStudy.save() 357 358 */ 358 359 } 359 360 360 } 361 361 -
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r183 r189 67 67 } 68 68 69 // render the study page and handle study logic69 // render and handle the study page 70 70 study { 71 71 render(view: "_study") … … 100 100 } 101 101 102 // render page two102 // render and handle subjects page 103 103 subjects { 104 104 render(view: "_subjects") … … 146 146 } 147 147 148 // render and handle group page 148 149 groups { 149 150 render(view: "_groups") … … 190 191 return false 191 192 } else { 193 def names = new LinkedHashMap(); 192 194 def errors = false; 193 195 def id = 0; 196 197 // iterate through subjects 194 198 flow.subjects.each() { 195 199 // store subject properties 200 def name = params.get('subject_' + id + '_name') 196 201 it.name = params.get('subject_' + id + '_name') 197 202 it.species = Term.findByName(params.get('subject_' + id + '_species')) 198 203 204 // remember name and check for duplicates 205 if (!names[ it.name ]) { 206 names[ it.name ] = [count: 1, first: 'subject_' + id + '_name'] 207 } else { 208 // duplicate name found, set error flag 209 names[ it.name ]['count']++ 210 211 // second occurence? 212 if (names[ it.name ]['count'] == 2) { 213 // yeah, also mention the first 214 // occurrence in the error message 215 this.appendErrorMap([[names[ it.name ]['first']]: 'The subject name needs to be unique!'], flash.errors) 216 } 217 218 // add to error map 219 this.appendErrorMap([['subject_' + id + '_name']: 'The subject name needs to be unique!'], flash.errors) 220 errors = true 221 } 222 199 223 // clear lists 200 def stringList = new LinkedHashMap(); 201 def intList = new LinkedHashMap(); 224 def stringList = new LinkedHashMap(); 225 def intList = new LinkedHashMap(); 226 def floatList = new LinkedHashMap(); 227 def termList = new LinkedHashMap(); 202 228 203 229 // get all template fields 204 230 flow.study.template.subjectFields.each() { 231 // valid type? 232 if (!it.type) throw new NoSuchFieldException("Field name ${fieldName} not recognized") 233 205 234 // get value 206 235 def value = params.get('subject_' + id + '_' + it.name); 207 208 236 if (value) { 209 237 // add to template parameters 210 238 switch (it.type) { 211 239 case 'STRINGLIST': 212 stringList[it.name] 240 stringList[it.name] = value 213 241 break; 214 242 case 'INTEGER': 215 intList[it.name] = value 243 intList[it.name] = value 244 break; 245 case 'FLOAT': 246 floatList[it.name] = value 216 247 break; 217 248 default: 218 249 // unsupported type? 219 println "ERROR: unsupported type: " + it.type250 throw new NoSuchFieldException("Field type ${it.type} not recognized") 220 251 break; 221 252 } … … 224 255 225 256 // set field data 226 it.templateStringFields = stringList 227 it.templateIntegerFields = intList 257 it.templateStringFields = stringList 258 it.templateIntegerFields = intList 259 it.templateFloatFields = floatList 260 it.templateTermFields = termList 228 261 229 262 // validate subject -
trunk/grails-app/domain/dbnp/clinicaldata/ClinicalAssay.groovy
r186 r189 1 1 package dbnp.clinicaldata 2 2 /** 3 * class description 4 * 5 * Revision information: 6 * $Rev$ 7 * $Author$ 8 * $Date$ 9 */ 3 10 class ClinicalAssay { 4 11 -
trunk/grails-app/domain/dbnp/studycapturing/EventDescription.groovy
r186 r189 7 7 * For the moment, EventDescription is not linked to a specific study or user. 8 8 * This means that the user can add events of all possible event types as defined by the (global) EventDescription collection. 9 * 10 * Revision information: 11 * $Rev$ 12 * $Author$ 13 * $Date$ 9 14 */ 10 class EventDescription { 11 15 class EventDescription implements Serializable { 12 16 String name 13 17 String description … … 17 21 18 22 static constraints = { 19 classification(nullable: true )23 classification(nullable: true, blank: true) 20 24 } 21 22 25 } -
trunk/grails-app/domain/dbnp/studycapturing/Protocol.groovy
r186 r189 8 8 * For the moment, there is one global Protocol store. From user experience, it should become clear if this store 9 9 * has to remain global or should be bound to specific templates, users, user groups or even studies. 10 * 11 * Revision information: 12 * $Rev$ 13 * $Author$ 14 * $Date$ 10 15 */ 11 class Protocol { 12 16 class Protocol implements Serializable { 13 17 String name 14 18 Term reference … … 16 20 static hasMany = [parameters : ProtocolParameter, compounds: Compound] 17 21 static constraints = { 18 reference(nullable: true )22 reference(nullable: true, blank: true) 19 23 } 20 21 22 24 } -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r188 r189 29 29 samplingEvents: SamplingEvent, 30 30 assays: Assay, 31 32 31 persons: StudyPerson, 32 publications: Publication 33 33 ] 34 34 -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r180 r189 42 42 * @see http://www.grails.org/Tag+-+submitToRemote 43 43 * @todo perhaps some methods should be moved to a more generic 44 * 'webflow' taglib 44 * 'webflow' taglib or plugin 45 45 * @param Map attributes 46 46 * @param Closure body … … 357 357 def intFields = subject.templateIntegerFields 358 358 def stringFields = subject.templateStringFields 359 def floatFields = subject.templateFloatFields 360 def termFields = subject.templateTermFields 359 361 360 362 // output columns for these subjectFields … … 383 385 ) 384 386 break; 387 case 'FLOAT': 388 // render float subjectfield 389 out << textField( 390 name: attrs.name + '_' + it.name, 391 value: (floatFields) ? floatFields.get(it.name) : '' 392 ) 393 break; 385 394 default: 386 395 // unsupported field type 387 out << '<span class="error"> unsuported type'+it.type+'</span>'396 out << '<span class="error">!'+it.type+'</span>' 388 397 break; 389 398 } -
trunk/web-app/js/grouping.js
r180 r189 14 14 function Grouping() { 15 15 } 16 /*17 16 Grouping.prototype = { 18 17 itemsIdentifier: null, … … 33 32 34 33 initItems: function() { 35 $(this.itemsIdentifier).34 //$(this.itemsIdentifier). 36 35 } 37 36 } 38 */ 37 /* 39 38 40 39 Grouping.prototype = { … … 156 155 } 157 156 } 158 157 */ -
trunk/web-app/js/wizard.js
r178 r189 32 32 // @see _wizard.gsp, _navigation.gsp, _subjects.gsp 33 33 function onWizardPage() { 34 // GENERAL 34 35 attachHelpTooltips(); 35 36 attachDatePickers(); 36 37 37 // SUBJECT S38 // SUBJECT PAGE 38 39 attachTableEvents(); 39 40 resizeWizardTable(); … … 41 42 new TableEditor().init('div.table','div.row','div.column'); 42 43 43 // GROUPING 44 // GROUPING PAGE 44 45 new Grouping().init('div.subjects', 'div.subject', 'div.groups', 'div.group'); 45 46 }
Note: See TracChangeset
for help on using the changeset viewer.