Mercurial > lada > lada-client
annotate app/model/Messprogramm.js @ 745:df684c3d4a7c
Added Messprogramme Store and Model
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Fri, 24 Apr 2015 11:03:18 +0200 |
parents | |
children | 78e73be45aaa |
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 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 name: 'test' |
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; |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 } |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 name: 'mstId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 name: 'datenbasisId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 name: 'baId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 name: 'gemId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
37 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
38 name: 'ortId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
39 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
40 name: 'mediaDesk' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
41 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 name: 'umwId', |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 serialize: function(value) { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 if (value === '') { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 return null; |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 } |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 return value; |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 } |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
49 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 name: 'probenartId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
51 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
52 name: 'probenintervall' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
53 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 name: 'teilintervallVon' |
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 name: 'teilintervallBis' |
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 name: 'intervallOffset' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
59 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
60 name: 'gueltigVon' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
61 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
62 name: 'gueltigBis' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
63 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 name: 'probeNehmerId' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 name: 'probeKommentar' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 }, { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 name: 'letzteAenderung', |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 type: 'date', |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 convert: function(v) { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 if (!v) { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
72 return v; |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 } |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 return new Date(v); |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 }, |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 defaultValue: new Date() |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 }], |
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 idProperty: 'id', |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
80 |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
81 proxy: { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
82 type: 'rest', |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 //url: 'lada-server/messprogramm', //not yet implemented |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 reader: { |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
85 type: 'json', |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 root: 'data' |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
87 } |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 } |
df684c3d4a7c
Added Messprogramme Store and Model
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
89 } |