Ignore:
Timestamp:
Mar 22, 2010, 1:44:00 PM (11 years ago)
Author:
duh
Message:
  • refactored template field handeling in the wizard
  • added escapedName() method to TemplateField? which returns the field name in lowercase format, and all non-alphanumeric characters escaped to underscores (hence: jeroen_s_very_cool_field)
  • (re)moved some template 'note' boxes
Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy

    r290 r296  
    6464                        case TemplateFieldType.ONTOLOGYTERM:
    6565                                return templateTermFields
    66                         default:
     66                    default:
    6767                                throw new NoSuchFieldException("Field type ${fieldType} not recognized")
    6868                }
     
    139139        }
    140140
    141 
    142 
    143141        def Set<TemplateField> giveFields() {
    144142                return this.template.fields;
     
    173171        }
    174172
     173        def validate() {
     174                return super.validate()
     175        }
    175176}
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateField.groovy

    r290 r296  
    3131        }
    3232
     33
     34        /**
     35         * return an escaped name which can be used in business logic
     36         * @return String
     37         */
     38        def String escapedName() {
     39                return name.toLowerCase().replaceAll("([^a-zA-Z0-9])","_")
     40        }
     41
    3342        //TODO: make a convenience setter for a string array
    3443        /*def setListEntries(ArrayList entries) {
Note: See TracChangeset for help on using the changeset viewer.