Ignore:
Timestamp:
May 17, 2010, 3:26:48 PM (9 years ago)
Author:
keesvb
Message:

cleaned up BootStrap? and re-added Samples, updated study/show to also show sampling events in EventGroups?, added description field for Templates

Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
3 edited

Legend:

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

    r408 r421  
    7070
    7171        /**
     72         * Return the unique Event and SamplingEvent templates that are used in this study
     73         */
     74        Set<Template> giveAllEventTemplates() {
     75                // For some reason, giveAllEventTemplates() + giveAllSamplingEventTemplates()
     76                // gives trouble when asking .size() to the result
     77                // So we also use giveTemplates here
     78                TemplateEntity.giveTemplates(events + samplingEvents);
     79        }
     80
     81
     82        /**
    7283         * Return the unique Event templates that are used in this study
    7384         */
    74         def Set<Template> giveEventTemplates() {
     85        Set<Template> giveEventTemplates() {
    7586                TemplateEntity.giveTemplates(events);
    7687        }
     
    7990         * Return the unique SamplingEvent templates that are used in this study
    8091         */
    81         def Set<Template> giveSamplingEventTemplates() {
    82                 TemplateEntity.giveTemplates(events);
     92        Set<Template> giveSamplingEventTemplates() {
     93                TemplateEntity.giveTemplates(samplingEvents);
    8394        }
    8495
     
    8697         * Returns the unique Sample templates that are used in the study
    8798         */
    88         def Template giveSampleTemplates() {
     99        Set<Template> giveSampleTemplates() {
    89100                TemplateEntity.giveTemplates(samples);
    90101        }
     
    92103         * Returns the template of the study
    93104         */
    94         def Template giveStudyTemplate() {
     105        Template giveStudyTemplate() {
    95106                return this.template;
    96107        }
  • trunk/grails-app/domain/dbnp/studycapturing/Template.groovy

    r397 r421  
    1313class Template implements Serializable {
    1414        String name
     15        String description
    1516        Class entity
    1617        //nimble.User owner
     
    1920
    2021        static constraints = {
     22                description(nullable: true, blank: true)
    2123                // outcommented for now due to bug in Grails / Hibernate
    2224                // see http://jira.codehaus.org/browse/GRAILS-6020
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy

    r414 r421  
    440440         * Convenience method. Returns all unique templates used within a collection of TemplateEntities.
    441441         */
    442         static List<Template> giveTemplates(Set<TemplateEntity> entityCollection) {
     442        static Set<Template> giveTemplates(Set<TemplateEntity> entityCollection) {
    443443                return entityCollection*.template.unique();
    444444        }
Note: See TracChangeset for help on using the changeset viewer.