Changeset 313


Ignore:
Timestamp:
Mar 24, 2010, 5:30:33 PM (9 years ago)
Author:
keesvb
Message:

added giveDomainFields to TemplateEntity?

File:
1 edited

Legend:

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

    r299 r313  
    1111 * $Date$
    1212 */
    13 class TemplateEntity implements Serializable {
     13abstract class TemplateEntity implements Serializable {
    1414
    1515        Template template
     
    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        /**
     143        * Return all templated fields defined in the underlying template of this entity
     144        */
    141145        def Set<TemplateField> giveFields() {
    142146                return this.template.fields;
    143147        }
    144148
     149        /**
     150         * Return all relevant 'built-in' domain fields of the super class
     151         * @return key-value pairs describing the built-in fields, with the names as keys and type (as TemplateFieldType) as values
     152         */
     153        def giveDomainFields() {
     154                def fieldSet = [:];
     155                if (super.hasProperty('name')) {
     156                        fieldSet['name'] = TemplateFieldType.STRING;
     157                }
     158                return fieldSet;
     159        }
    145160
    146161        // See revision 237 for ideas about initializing the different templateField Maps
Note: See TracChangeset for help on using the changeset viewer.