Changeset 145 for trunk/grails-app/domain
- Timestamp:
- Jan 28, 2010, 5:34:50 PM (13 years ago)
- Location:
- trunk/grails-app/domain/dbnp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/data/Term.groovy
r139 r145 7 7 * The Term object should point to an existing term in an online ontology, therefore instances of this class can also 8 8 * be seen as a cache of elements of the external ontology. 9 * 10 * Revision information: 11 * $Rev$ 12 * $Author$ 13 * $Date$ 9 14 */ 10 class Term {11 12 13 14 15 class Term implements Serializable { 16 static searchable = true 17 String name 18 Ontology ontology 19 String accession 15 20 16 17 21 static constraints = { 22 } 18 23 19 def String toString() { 20 return name 21 } 22 23 24 def String toString() { 25 return name 26 } 24 27 } -
trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy
r139 r145 5 5 /** 6 6 * This domain class describes the subjects in a study. 7 * 8 * Revision information: 9 * $Rev$ 10 * $Author$ 11 * $Date$ 7 12 */ 8 class Subject {13 class Subject implements Serializable { 9 14 static searchable = true 10 15 String name … … 16 21 17 22 static hasMany = [ 18 templateStringFields: String, // stores both STRING and STRINGLIST items (latter should be checked against the list)19 templateIntegerFields 20 templateFloatFields 21 templateTermFields 23 templateStringFields: String, // stores both STRING and STRINGLIST items (latter should be checked against the list) 24 templateIntegerFields: int, 25 templateFloatFields: float, 26 templateTermFields: Term 22 27 ] 23 28 24 29 static constraints = { 25 30 } -
trunk/grails-app/domain/dbnp/studycapturing/TemplateField.groovy
r136 r145 3 3 /** 4 4 * This is the superclass for template fields. Normally, this class will not be instantiated. 5 * 6 * Revision information: 7 * $Rev$ 8 * $Author$ 9 * $Date$ 5 10 */ 6 abstract class TemplateField {7 8 9 11 abstract class TemplateField implements Serializable { 12 String name 13 TemplateFieldType type 14 String unit 10 15 11 12 name(unique:true)13 unit(nullable:true, blank:true)14 16 static constraints = { 17 name(unique: true) 18 unit(nullable: true, blank: true) 19 } 15 20 16 21 def String toString() { -
trunk/grails-app/domain/dbnp/studycapturing/TemplateFieldType.groovy
r139 r145 3 3 /** 4 4 * Enum describing the type of a templated field. 5 * Revision information: 6 * $Rev$ 7 * $Author$ 8 * $Date$ 5 9 */ 6 10 public enum TemplateFieldType { 7 8 9 10 11 11 STRING('String'), 12 INTEGER('Integer number'), 13 FLOAT('Decimal number'), 14 STRINGLIST('List of items'), 15 ONTOLOGYTERM('Ontology Reference') 12 16 13 17 String name 14 18 15 16 17 19 TemplateFieldType(String name) { 20 this.name = name 21 } 18 22 19 20 21 23 static list() { 24 [STRING, INTEGER, FLOAT, STRINGLIST, ONTOLOGYTERM] 25 } 22 26 23 // It would be nice to see the description string in the scaffolding, 24 // and the following works, but then the item cannot be saved properly. 25 // TODO: find a way to display the enum description but save the enum value in the scaffolding 26 /*def String toString() { 27 return this.name 28 }*/ 29 27 // It would be nice to see the description string in the scaffolding, 28 // and the following works, but then the item cannot be saved properly. 29 // TODO: find a way to display the enum description but save the enum value in the scaffolding 30 /* 31 def String toString() { 32 return this.name 33 } 34 */ 30 35 } -
trunk/grails-app/domain/dbnp/studycapturing/TemplateSubjectField.groovy
r131 r145 3 3 /** 4 4 * Instances of this class describe an extra (template) field for the Subject entity. 5 * 6 * Revision information: 7 * $Rev$ 8 * $Author$ 9 * $Date$ 5 10 */ 6 11 class TemplateSubjectField extends TemplateField {
Note: See TracChangeset
for help on using the changeset viewer.