Ignore:
Timestamp:
May 21, 2010, 10:04:49 AM (10 years ago)
Author:
roberth
Message:

Improved study list to be able to handle one or more studies. Also improved performance issues with Subject and Sample classes. I have set the domainFields property to a static property, filled it in the class description and attached an ontology to it in the bootstrap (because it can't be done in the class description). It might not be the prettiest solution, it does improve the performance of the study detail page and study comparison with 90%.

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

Legend:

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

    r408 r454  
    1919         * @return List
    2020         */
    21         List<TemplateField> giveDomainFields() {
     21        List<TemplateField> giveDomainFields() { return Sample.domainFields }
     22        static List<TemplateField> domainFields =
    2223                [
    2324                        new TemplateField(
     
    2728                        new TemplateField(
    2829                                name: 'material',
    29                                 type: TemplateFieldType.ONTOLOGYTERM,
    30                                 ontologies: [Ontology.findByNcboId(1005)])
     30                                type: TemplateFieldType.ONTOLOGYTERM )
    3131                ]
    32         }
    3332
    3433        static constraints = {
  • trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy

    r408 r454  
    2121         * @return List
    2222         */
    23         List<TemplateField> giveDomainFields() {
     23        List<TemplateField> giveDomainFields() { return Subject.domainFields }
     24        static List<TemplateField> domainFields =
    2425                [
    2526                        new TemplateField(
     
    2930                        new TemplateField(
    3031                                name: 'species',
    31                                 type: TemplateFieldType.ONTOLOGYTERM,
    32                                 ontologies: [Ontology.findByNcboId(1132)])
     32                                type: TemplateFieldType.ONTOLOGYTERM)
    3333                ]
    34         }
    3534}
Note: See TracChangeset for help on using the changeset viewer.