source: trunk/grails-app/domain/dbnp/studycapturing/Assay.groovy @ 962

Last change on this file since 962 was 962, checked in by j.a.m.wesbeek@…, 10 years ago
  • assay page in the wizard did not properly displayed the required fields because the 'required' keyword was lacking in the domainFields
  • Property svn:keywords set to Author Date Rev
File size: 1.7 KB
Line 
1package dbnp.studycapturing
2
3/**
4 * This class describes an Assay, which describes the application of a certain (omics) measurement to multiple samples.
5 * The actual data of these measurements are described in submodules of dbNP. The type property describes in which module
6 * this data can be found.
7 */
8class Assay extends TemplateEntity {
9        // The name of the assay, which should indicate the measurements represented in this assay to the user.
10        String name
11
12        // The dbNP module in which the assay omics data can be found. */
13        AssayModule module
14
15        // The assay ID which is used in the dbNP submodule which contains the actual omics data of this assay.
16        // This ID is generated in GSCF, but is used in the submodules to refer to this particular Assay.
17        String externalAssayID
18
19        /**
20         * return the domain fields for this domain class
21         * @return List
22         */
23        static List<TemplateField> giveDomainFields() { return Assay.domainFields }
24        static List<TemplateField> domainFields = [
25                new TemplateField(
26                        name: 'name',
27                        type: TemplateFieldType.STRING,
28                        preferredIdentifier: true,
29                        required: true
30                ),
31                new TemplateField(
32                        name: 'module',
33                        type: TemplateFieldType.MODULE,
34                        required: true
35                ),
36                new TemplateField(
37                        name: 'externalAssayID',
38                        type: TemplateFieldType.STRING,
39                        required: true
40                )
41        ]
42
43        // An Assay always belongs to one study.
44        static belongsTo = [parent: Study]
45
46        // An Assay can have many samples on which it is performed, but all samples should be within the 'parent' Study.
47        static hasMany = [samples: Sample]
48
49        static constraints = {
50                externalAssayID(nullable:false, blank:false, unique: true)
51        }
52
53        def String toString() {
54                return name;
55        }
56
57    def getToken() {
58                return externalAssayID
59    }
60}
Note: See TracBrowser for help on using the repository browser.