raimund@548: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
raimund@548:  * Software engineering by Intevation GmbH
raimund@548:  *
raimund@548:  * This file is Free Software under the GNU GPL (v>=3)
raimund@548:  * and comes with ABSOLUTELY NO WARRANTY! Check out
raimund@548:  * the documentation coming with IMIS-Labordaten-Application for details.
raimund@548:  */
raimund@548: 
raimund@548: /**
raimund@548:  * Model class for Ort Stammdaten
raimund@548:  */
dustin@1004: Ext.define('Lada.model.Ort', {
raimund@548:     extend: 'Ext.data.Model',
raimund@548: 
raimund@548:     fields: [{
raimund@548:         name: 'id'
raimund@548:     }, {
dustin@1004:         name: 'aktiv'
dustin@1004:     }, {
mkrambach@1309:         name: 'ortId',
mkrambach@1309:         convert: function(v) {
mkrambach@1309:             if (v === '') {
mkrambach@1309:                 return null;
mkrambach@1309:             }
mkrambach@1309:             return v;
mkrambach@1309:         }
dustin@1004:     }, {
dustin@1004:         name: 'nutsCode'
dustin@1004:     }, {
dustin@1004:         name: 'anlageId'
dustin@1004:     }, {
dustin@1004:         name: 'netzbetreiberId'
dustin@1004:     }, {
mkrambach@1289:         name: 'gemId',
mkrambach@1289:         convert: function(v) {
mkrambach@1289:             if (v === '') {
mkrambach@1289:                 return null;
mkrambach@1289:             }
mkrambach@1289:             return v;
mkrambach@1289:         }
dustin@1004:     }, {
mkrambach@1289:         name: 'staatId',
mkrambach@1289:         convert: function(v) {
mkrambach@1289:             if (v === '') {
mkrambach@1289:                 return null;
mkrambach@1289:             }
mkrambach@1289:             return v;
mkrambach@1289:         }
dustin@1004:     }, {
mkrambach@1284:         name: 'kdaId',
mkrambach@1284:         convert: function(v) {
mkrambach@1284:             if (v === '') {
mkrambach@1284:                 return null;
mkrambach@1284:             }
mkrambach@1284:             return v;
mkrambach@1284:         }
dustin@1004:     }, {
tom@1253:         name: 'ozId',
tom@1253:         serialize: function(v) {
tom@1253:             if (v === '') {
tom@1253:                 return null;
tom@1253:             }
tom@1253:             return v;
tom@1253:         }
dustin@1004:     }, {
dustin@1004:         name: 'ortTyp'
dustin@1004:     }, {
dustin@1004:         name: 'mpArt'
dustin@1004:     }, {
dustin@1004:         name: 'zone'
dustin@1004:     }, {
dustin@1004:         name: 'sektor'
dustin@1004:     }, {
dustin@1004:         name: 'zustaendigkeit'
dustin@1004:     }, {
dustin@1004:         name: 'berichtstext'
dustin@1004:     }, {
dustin@1004:         name: 'kurztext'
dustin@1004:     }, {
dustin@1004:         name: 'langtext'
raimund@548:     }, {
raimund@548:         name: 'unscharf'
raimund@548:     }, {
dustin@1004:         name: 'hoeheLand'
raimund@548:     }, {
mkrambach@1284:         name: 'koordXExtern',
mkrambach@1284:         convert: function(v) {
mkrambach@1284:             if (v === '') {
mkrambach@1284:                 return null;
mkrambach@1284:             }
mkrambach@1284:             return v;
mkrambach@1284:         }
raimund@548:     }, {
mkrambach@1284:         name: 'koordYExtern',
mkrambach@1284:         convert: function(v) {
mkrambach@1284:             if (v === '') {
mkrambach@1284:                 return null;
mkrambach@1284:             }
mkrambach@1284:             return v;
mkrambach@1284:         }
raimund@548:     }, {
dustin@1004:         name: 'longitude',
dustin@1004:         type: 'float'
dustin@1004:     }, {
dustin@1004:         name: 'latitude',
dustin@1004:         type: 'float'
raimund@548:     }, {
raimund@548:         name: 'letzteAenderung',
raimund@548:         type: 'date',
raimund@548:         convert: function(v) {
raimund@548:             if (!v) {
raimund@548:                 return v;
raimund@548:             }
raimund@548:             return new Date(v);
dustin@970:         }
raimund@1139:     }, {
raimund@1139:         name: 'readonly',
raimund@1139:         type: 'boolean'
raimund@548:     }],
raimund@548: 
raimund@548:     idProperty: 'id',
raimund@548: 
raimund@548:     proxy: {
raimund@548:         type: 'rest',
dustin@1004:         url: 'lada-server/rest/ort',
raimund@548:         reader: {
raimund@548:             type: 'json',
dustin@1021:             totalProperty: 'totalCount',
raimund@548:             root: 'data'
raimund@548:         }
raimund@548:     }
raimund@548: });