Changeset 238 for trunk/grails-app/domain
- Timestamp:
- Mar 5, 2010, 3:21:52 PM (13 years ago)
- Location:
- trunk/grails-app/domain/dbnp/studycapturing
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/Template.groovy
r236 r238 12 12 */ 13 13 class Template implements Serializable { 14 15 14 String name 16 15 Class entity … … 21 20 static constraints = { 22 21 name(unique:['entity']) 23 24 22 } 25 23 … … 64 62 def results = [] 65 63 66 // thisshould not work in static context, however it does so I'll keep64 // 'this' should not work in static context, however it does so I'll keep 67 65 // this in for now :) 68 66 this.findAll().each() { -
trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy
r236 r238 4 4 import org.codehaus.groovy.runtime.NullObject 5 5 6 class TemplateEntity { 6 /** 7 * TemplateEntity Domain Class 8 * 9 * Revision information: 10 * $Rev$ 11 * $Author$ 12 * $Date$ 13 */ 14 class TemplateEntity implements Serializable { 7 15 8 16 Template template … … 29 37 30 38 static constraints = { 31 template(nullable: true )39 template(nullable: true, blank: true) 32 40 33 41 } … … 83 91 } 84 92 else { 85 if (templateStringFields .containsKey(fieldName) && value.class == String) {93 if (templateStringFields && templateStringFields.containsKey(fieldName) && value.class == String) { 86 94 this.templateStringFields[fieldName] = value 87 95 } 88 if (templateString ListFields.containsKey(fieldName) && value.class == TemplateFieldListItem) {96 if (templateStringFields && templateStringListFields.containsKey(fieldName) && value.class == TemplateFieldListItem) { 89 97 // TODO: check if item really belongs to the list under fieldName 90 98 this.templateStringListFields[fieldName] = value … … 93 101 this.templateTextFields[fieldName] = value 94 102 } 95 else if (templateIntegerFields .containsKey(fieldName) && value.class == Integer) {103 else if (templateIntegerFields && templateIntegerFields.containsKey(fieldName) && value.class == Integer) { 96 104 this.templateIntegerFields[fieldName] = value 97 105 } 98 else if (templateFloatFields .containsKey(fieldName) && value.class == Float) {106 else if (templateFloatFields && templateFloatFields.containsKey(fieldName) && value.class == Float) { 99 107 this.templateFloatFields[fieldName] = value 100 108 } 101 else if (templateDoubleFields .containsKey(fieldName) && value.class == Double) {109 else if (templateDoubleFields && templateDoubleFields.containsKey(fieldName) && value.class == Double) { 102 110 this.templateDoubleFields[fieldName] = value 103 111 } 104 else if (templateDateFields .containsKey(fieldName) && value.class == Date) {112 else if (templateDateFields && templateDateFields.containsKey(fieldName) && value.class == Date) { 105 113 this.templateDateFields[fieldName] = value 106 114 } 107 else if (templateTermFields .containsKey(fieldName) && value.class == Term) {115 else if (templateTermFields && templateTermFields.containsKey(fieldName) && value.class == Term) { 108 116 this.templateTermFields[fieldName] = value 109 117 } … … 129 137 // TODO: initialize all template fields with the necessary keys and null values 130 138 131 println "Setting template " + newTemplate139 //println "Setting template " + newTemplate 132 140 if (template != null) { 133 141 -
trunk/grails-app/domain/dbnp/studycapturing/TemplateFieldListItem.groovy
r228 r238 1 1 package dbnp.studycapturing 2 2 3 class TemplateFieldListItem { 4 3 /** 4 * TemplateFieldListItem Domain Class 5 * 6 * Revision information: 7 * $Rev$ 8 * $Author$ 9 * $Date$ 10 */ 11 class TemplateFieldListItem implements Serializable { 5 12 String name 6 13 7 8 14 static constraints = { 15 } 9 16 10 17 String toString() { -
trunk/grails-app/domain/dbnp/studycapturing/TemplateFieldType.groovy
r236 r238 8 8 * $Date$ 9 9 */ 10 public enum TemplateFieldType {10 public enum TemplateFieldType implements Serializable { 11 11 STRING('String'), 12 12 TEXT('Long string'),
Note: See TracChangeset
for help on using the changeset viewer.