Ignore:
Timestamp:
Mar 5, 2010, 3:21:52 PM (13 years ago)
Author:
duh
Message:

Refectored version of the wizard

  • initial template page has been removed, now is a generic 'start' page where one (in the future) may create a new study, or load and modify an already stored study
  • study page incorporates study template select element, but does not yet incorporate the study template fields
  • subjects page now allows creation of subjects based on a template. This change also implied the study page altogether had to change into a seperate table entity. Now the the page lists as many tables as unique templates have been selected. These tables contain all subjects that were added using that particular template. NOTE: data is not stored yet, due to the fact that templateEntity does not work properly yey (key/value pairs need to be set correctly when calling the setTemplate method)
  • the JavaScript? now handles multiple tables in a page as well, and automatically initializes any underlying slider div if that is required
Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
4 edited

Legend:

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

    r236 r238  
    1212 */
    1313class Template implements Serializable {
    14 
    1514        String name
    1615        Class entity
     
    2120        static constraints = {
    2221                name(unique:['entity'])
    23 
    2422        }
    2523
     
    6462                def results = []
    6563
    66                 // this should not work in static context, however it does so I'll keep
     64                // 'this' should not work in static context, however it does so I'll keep
    6765                // this in for now :)
    6866                this.findAll().each() {
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy

    r236 r238  
    44import org.codehaus.groovy.runtime.NullObject
    55
    6 class TemplateEntity {
     6/**
     7 * TemplateEntity Domain Class
     8 *
     9 * Revision information:
     10 * $Rev$
     11 * $Author$
     12 * $Date$
     13 */
     14class TemplateEntity implements Serializable {
    715
    816        Template template
     
    2937
    3038        static constraints = {
    31                 template(nullable: true)
     39                template(nullable: true, blank: true)
    3240
    3341        }
     
    8391                }
    8492                else {
    85                         if (templateStringFields.containsKey(fieldName) && value.class == String) {
     93                        if (templateStringFields && templateStringFields.containsKey(fieldName) && value.class == String) {
    8694                                this.templateStringFields[fieldName] = value
    8795                        }
    88                         if (templateStringListFields.containsKey(fieldName) && value.class == TemplateFieldListItem) {
     96                        if (templateStringFields && templateStringListFields.containsKey(fieldName) && value.class == TemplateFieldListItem) {
    8997                                // TODO: check if item really belongs to the list under fieldName
    9098                                this.templateStringListFields[fieldName] = value
     
    93101                                this.templateTextFields[fieldName] = value
    94102                        }
    95                         else if (templateIntegerFields.containsKey(fieldName) && value.class == Integer) {
     103                        else if (templateIntegerFields && templateIntegerFields.containsKey(fieldName) && value.class == Integer) {
    96104                                this.templateIntegerFields[fieldName] = value
    97105                        }
    98                         else if (templateFloatFields.containsKey(fieldName) && value.class == Float) {
     106                        else if (templateFloatFields && templateFloatFields.containsKey(fieldName) && value.class == Float) {
    99107                                this.templateFloatFields[fieldName] = value
    100108                        }
    101                         else if (templateDoubleFields.containsKey(fieldName) && value.class == Double) {
     109                        else if (templateDoubleFields && templateDoubleFields.containsKey(fieldName) && value.class == Double) {
    102110                                this.templateDoubleFields[fieldName] = value
    103111                        }
    104                         else if (templateDateFields.containsKey(fieldName) && value.class == Date) {
     112                        else if (templateDateFields && templateDateFields.containsKey(fieldName) && value.class == Date) {
    105113                                this.templateDateFields[fieldName] = value
    106114                        }
    107                         else if (templateTermFields.containsKey(fieldName) && value.class == Term) {
     115                        else if (templateTermFields && templateTermFields.containsKey(fieldName) && value.class == Term) {
    108116                                this.templateTermFields[fieldName] = value
    109117                        }
     
    129137                // TODO: initialize all template fields with the necessary keys and null values
    130138
    131                 println "Setting template " + newTemplate
     139                //println "Setting template " + newTemplate
    132140                if (template != null) {
    133141
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateFieldListItem.groovy

    r228 r238  
    11package dbnp.studycapturing
    22
    3 class TemplateFieldListItem {
    4 
     3/**
     4 * TemplateFieldListItem Domain Class
     5 *
     6 * Revision information:
     7 * $Rev$
     8 * $Author$
     9 * $Date$
     10 */
     11class TemplateFieldListItem implements Serializable {
    512        String name
    613
    7         static constraints = {
    8         }
     14        static constraints = {
     15        }
    916
    1017        String toString() {
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateFieldType.groovy

    r236 r238  
    88 * $Date$
    99 */
    10 public enum TemplateFieldType {
     10public enum TemplateFieldType implements Serializable  {
    1111        STRING('String'),
    1212        TEXT('Long string'),
Note: See TracChangeset for help on using the changeset viewer.