Changeset 654 for trunk/grails-app
- Timestamp:
- Jul 15, 2010, 2:26:48 PM (13 years ago)
- Location:
- trunk/grails-app/domain/dbnp/studycapturing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/AssayType.groovy
r496 r654 12 12 TRANSCRIPTOMICS('Transcriptomics'), 13 13 METABOLOMICS('Metabolomics'), 14 CLINICAL_DATA('Clinical data')14 SIMPLE_ASSAY('Simple Assay') 15 15 16 16 String name … … 21 21 22 22 static list() { 23 [TRANSCRIPTOMICS, METABOLOMICS, CLINICAL_DATA]23 [TRANSCRIPTOMICS, METABOLOMICS, SIMPLE_ASSAY] 24 24 } 25 25 } -
trunk/grails-app/domain/dbnp/studycapturing/Event.groovy
r629 r654 16 16 long startTime 17 17 long endTime 18 19 // TODO: assure the Event has a parent study in validate() 18 20 19 21 /** -
trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy
r652 r654 8 8 */ 9 9 class Sample extends TemplateEntity { 10 static searchable = { [only: ['name']] } 11 10 static searchable = { [only: ['name']] } 11 12 static belongsTo = [ parent : Study] 13 12 14 Subject parentSubject 13 15 SamplingEvent parentEvent … … 17 19 18 20 def getExternalSampleId() { name } 19 20 // TODO: Write a validation method that checks if the externalSampleId (currently defined as name)21 // is really unique within each parent study of this sample.22 // Maybe this could also be a constraint, but we might run into trouble creating new Sample objects in e.g. the create wizard.23 // To be checked.24 21 25 22 /** … … 32 29 name: 'name', 33 30 type: TemplateFieldType.STRING, 34 preferredIdentifier: true 31 preferredIdentifier: true, 32 required: true 35 33 ), 36 34 new TemplateField( … … 42 40 static constraints = { 43 41 parentSubject(nullable:true) 42 material(nullable: true) 43 44 // TODO: Write a validation method that checks if the externalSampleId (currently defined as name) 45 // is really unique within each parent study of this sample. 46 // Maybe this could also be a constraint, but we might run into trouble creating new Sample objects in e.g. the create wizard. 47 // To be checked. 48 // This feature is tested by integration test SampleTests.testSampleUniqueNameConstraint 49 50 /*name(validator: { fields, obj, errors -> 51 def error = false 52 53 if (fields) { 54 // Search through all study 55 if (obj.parent.samples.findAll({ it.name == fields}).size() != 1) { 56 errors.rejectValue( 57 'name', 58 'sample.name.NotUnique', 59 ['name',fields] as Object[], 60 'The sample name is not unique within the study' 61 ) 62 } 63 } 64 else { 65 // If no value for name is specified, the sample should not validate 66 error = true 67 } 68 69 return (!error) 70 })*/ 44 71 } 72 73 /*static def getParentStudies() { 74 Study.findAll { 75 it.samples.findAll { 76 it.name == this.name 77 } 78 } 79 }*/ 45 80 46 81 static getSamplesFor( event ) { -
trunk/grails-app/domain/dbnp/studycapturing/SamplingEvent.groovy
r540 r654 1 1 package dbnp.studycapturing 2 3 /**4 * 888 888 888 888 8888888888 8888888b. 88888888885 * 888 o 888 888 888 888 888 Y88b 8886 * 888 d8b 888 888 888 888 888 888 8887 * 888 d888b 888 8888888888 8888888 888 d88P 88888888 * 888d88888b888 888 888 888 8888888P" 8889 * 88888P Y88888 888 888 888 888 T88b 88810 * 8888P Y8888 888 888 888 888 T88b 88811 * 888P Y888 888 888 8888888888 888 T88b 888888888812 *13 * 8888888 .d8888b. 88888888888 888 888 888888888814 * 888 d88P Y88b 888 888 888 88815 * 888 Y88b. 888 888 888 88816 * 888 "Y888b. 888 8888888888 888888817 * 888 "Y88b. 888 888 888 88818 * 888 "888 888 888 888 88819 * 888 Y88b d88P 888 888 888 88820 * 8888888 "Y8888P" 888 888 888 888888888821 *22 * 888888 d8888 888 888 d8888 8888888b. .d88888b. .d8888b.23 * "88b d88888 888 888 d88888 888 "Y88b d88P" "Y88b d88P Y88b24 * 888 d88P888 888 888 d88P888 888 888 888 888 888 88825 * 888 d88P 888 Y88b d88P d88P 888 888 888 888 888 88826 * 888 d88P 888 Y88b d88P d88P 888 888 888 888 888 88827 * 888 d88P 888 Y88o88P d88P 888 888 888 888 888 888 88828 * 88P d8888888888 Y888P d8888888888 888 .d88P Y88b. .d88P Y88b d88P29 * 888 d88P 888 Y8P d88P 888 8888888P" "Y88888P" "Y8888P"30 * .d88P31 * .d88P"32 * 888P"33 *34 * .d8888b. 888 .d8888b. 888 .d8888b. 88835 * d88P Y88b 888 d88P Y88b 888 d88P Y88b 88836 * .d88P 888 .d88P 888 .d88P 88837 * .d88P" 888 .d88P" 888 .d88P" 88838 * 888" 888 888" 888 888" 88839 * 888 Y8P 888 Y8P 888 Y8P40 * " " "41 * 888 888 888 888 888 88842 *43 *44 * TODO: add PROPER class and method documentation, just like have45 * agreed upon hundreds of times!!!!46 */47 2 48 3 /** … … 59 14 } 60 15 16 /** 17 * Get all samples that have this sampling event as a parent 18 */ 61 19 def getSamples() { 62 20
Note: See TracChangeset
for help on using the changeset viewer.