annotate app/model/Messprogramm.js @ 1234:390dabbf27ed

Empty string for media descriptor is disallowed. This follows server Rev 1ef08710aaeb.
author Tom Gottfried <tom@intevation.de>
date Fri, 28 Oct 2016 21:23:31 +0200
parents 4270da0f7d3b
children d1f43f1e7e84
rev   line source
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
3 *
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
7 */
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
8
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
9 /**
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
10 * A Messprogramm.
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
11 * This class represents and defines the model of a 'Messprogramm'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
12 **/
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
13 Ext.define('Lada.model.Messprogramm', {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
14 extend: 'Ext.data.Model',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
15
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
16 fields: [{
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
17 name: 'id'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
18 }, {
754
6b0d0e62f7d7 added Probenintervalle to a Messprogramm... there is still a lot of work needed. For instance for the slider element.
Dustin Demuth <dustin@intevation.de>
parents: 749
diff changeset
19 name: 'test',
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
20 type: 'boolean'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
21 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
22 name: 'netzbetreiberId',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
23 serialize: function(value) {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
24 if (value === '') {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
25 return null;
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
26 }
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
27 return value;
1217
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1207
diff changeset
28 },
4270da0f7d3b Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents: 1207
diff changeset
29 persist: false
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
30 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
31 name: 'mstId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
32 }, {
1067
3da8e8b973ad Use the laborMstId to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 999
diff changeset
33 name: 'laborMstId'
3da8e8b973ad Use the laborMstId to generate probe objects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 999
diff changeset
34 }, {
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
35 name: 'datenbasisId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
36 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
37 name: 'baId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
38 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
39 name: 'gemId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
40 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
41 name: 'ortId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
42 }, {
1234
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
43 name: 'mediaDesk',
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
44 serialize: function(value) {
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
45 if (value === '') {
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
46 return null;
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
47 }
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
48 return value;
390dabbf27ed Empty string for media descriptor is disallowed.
Tom Gottfried <tom@intevation.de>
parents: 1217
diff changeset
49 }
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
50 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
51 name: 'umwId',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
52 serialize: function(value) {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
53 if (value === '') {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
54 return null;
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
55 }
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
56 return value;
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
57 }
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
58 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
59 name: 'probenartId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
60 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
61 name: 'probenintervall'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
62 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
63 name: 'teilintervallVon'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
64 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
65 name: 'teilintervallBis'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
66 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
67 name: 'intervallOffset'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
68 }, {
1207
05c8bd380fd5 Align data model with 1-based day of year in server.
Tom Gottfried <tom@intevation.de>
parents: 1199
diff changeset
69 /* day of year is 0-base in ExtJS, but 1-based in Java.
05c8bd380fd5 Align data model with 1-based day of year in server.
Tom Gottfried <tom@intevation.de>
parents: 1199
diff changeset
70 * Thus, we expect 1-based values here. */
1199
0a7f0a09151c Replace date-time picker with appropriate widget to select day of year.
Tom Gottfried <tom@intevation.de>
parents: 1191
diff changeset
71 name: 'gueltigVon'
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
72 }, {
1199
0a7f0a09151c Replace date-time picker with appropriate widget to select day of year.
Tom Gottfried <tom@intevation.de>
parents: 1191
diff changeset
73 name: 'gueltigBis'
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
74 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
75 name: 'probeNehmerId'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
76 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
77 name: 'probeKommentar'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
78 }, {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
79 name: 'letzteAenderung',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
80 type: 'date',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
81 convert: function(v) {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
82 if (!v) {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
83 return v;
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
84 }
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
85 return new Date(v);
970
f4eb53ba63fc Setting Timestamps the correct way. Before this commit the times of the instatiation of the model were used as default values, which led to wrong dates.
Dustin Demuth <dustin@intevation.de>
parents: 793
diff changeset
86 }
1086
61cc583c3649 Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents: 1067
diff changeset
87 }, {
61cc583c3649 Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents: 1067
diff changeset
88 name: 'media',
61cc583c3649 Messprogramm form redesign
Michael Stanko <mstanko@bfs.de>
parents: 1067
diff changeset
89 persist: false
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
90 }],
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
91
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
92 idProperty: 'id',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
93
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
94 proxy: {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
95 type: 'rest',
999
f73ca04d73a7 Refactored Server URL
Dustin Demuth <dustin@intevation.de>
parents: 970
diff changeset
96 url: 'lada-server/rest/messprogramm',
745
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
97 reader: {
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
98 type: 'json',
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
99 root: 'data'
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
100 }
df684c3d4a7c Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff changeset
101 }
754
6b0d0e62f7d7 added Probenintervalle to a Messprogramm... there is still a lot of work needed. For instance for the slider element.
Dustin Demuth <dustin@intevation.de>
parents: 749
diff changeset
102 });

http://lada.wald.intevation.org