annotate app/model/Probe.js @ 694:a0df1a8dff24

added setReadOnly()
author Dustin Demuth <dustin@intevation.de>
date Thu, 26 Mar 2015 16:02:38 +0100
parents c31644b3d445
children 9635f4e60b13
rev   line source
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 *
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 */
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 /**
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 * A Probe.
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 * This class represents and defines the model of a 'Probe'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 **/
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 Ext.define('Lada.model.Probe', {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 extend: 'Ext.data.Model',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 fields: [{
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 name: 'id'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 }, {
692
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
19 name: 'owner',
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
20 type: 'boolean',
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
21 persist: false
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
22 }, {
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 name: 'probeIdAlt'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 name: 'hauptprobenNr'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 name: 'test'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 }, {
677
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
29 name: 'netzbetreiberId',
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
30 serialize: function(value) {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
31 if (value === '') {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
32 return null;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
33 }
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
34 return value;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
35 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 name: 'mstId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 name: 'datenbasisId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 name: 'baId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 name: 'probenartId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 name: 'mediaDesk'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 name: 'media'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 }, {
677
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
49 name: 'umwId',
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
50 serialize: function(value) {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
51 if (value === '') {
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
52 return null;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
53 }
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
54 return value;
394c12b7bb21 Updated probe model to serialize empty strings to a null-value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 548
diff changeset
55 }
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 name: 'probeentnahmeBeginn',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 return new Date(v);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 defaultValue: new Date()
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 name: 'probeentnahmeEnde',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 return new Date(v);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 defaultValue: new Date()
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 name: 'mittelungsdauer'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 name: 'letzteAenderung',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85 return new Date(v);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87 defaultValue: new Date()
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 name: 'erzeugerId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91 name: 'probeNehmerId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 name: 'mpKat'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 name: 'mplId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 name: 'mprId'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 name: 'solldatumBeginn',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 return new Date(v);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 defaultValue: new Date()
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 name: 'solldatumEnde',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 type: 'date',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 convert: function(v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 if (!v) {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 return v;
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 return new Date(v);
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 },
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117 defaultValue: new Date()
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 }, {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 name: 'readonly',
692
c31644b3d445 added owner-field
Dustin Demuth <dustin@intevation.de>
parents: 689
diff changeset
120 type: 'boolean',
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121 persist: false
689
c07419f07a0c Added field treeModified to models.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 677
diff changeset
122 }, {
c07419f07a0c Added field treeModified to models.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 677
diff changeset
123 name: 'treeModified'
548
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 }],
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 idProperty: 'id',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128 proxy: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129 type: 'rest',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 url: 'lada-server/probe',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131 reader: {
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
132 type: 'json',
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133 root: 'data'
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
134 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 }
d47ee7439f44 Added new js files.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 });

http://lada.wald.intevation.org