Mercurial > gemma
annotate pkg/imports/modelconvert.go @ 4940:b3b2ba09a450 fairway-marks-import
Add missing fairway mark types
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 17 Feb 2020 18:38:45 +0100 |
parents | 9bd6a0ca63ea |
children | b0dbc0f2c748 |
rev | line source |
---|---|
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 // This is Free Software under GNU Affero General Public License v >= 3.0 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 // without warranty, see README.md and license for details. |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 // |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 // SPDX-License-Identifier: AGPL-3.0-or-later |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 // License-Filename: LICENSES/AGPL-3.0.txt |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 // |
4894
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
7 // Copyright (C) 2018, 2020 by via donau |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 // – Österreichische Wasserstraßen-Gesellschaft mbH |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 // Software engineering by Intevation GmbH |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 // |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 // Author(s): |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 // * Sascha L. Teichmann <sascha.teichmann@intevation.de> |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 package imports |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import ( |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 "gemma.intevation.de/gemma/pkg/models" |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 ) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
2040
f1e32babb587
Imports: Moved constructor functions for import models to a table in the import package to be re-used by the configure/scheduled import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2038
diff
changeset
|
20 var kindToImportModel = map[JobKind]func() interface{}{ |
4911
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
21 BNJobKind: func() interface{} { return new(models.BottleneckImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
22 GMJobKind: func() interface{} { return new(models.GaugeMeasurementImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
23 FAJobKind: func() interface{} { return new(models.FairwayAvailabilityImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
24 WXJobKind: func() interface{} { return new(models.WaterwayAxisImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
25 WAJobKind: func() interface{} { return new(models.WaterwayAreaImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
26 WGJobKind: func() interface{} { return new(models.WaterwayGaugeImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
27 DMVJobKind: func() interface{} { return new(models.DistanceMarksVirtualImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
28 FDJobKind: func() interface{} { return new(models.FairwayDimensionImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
29 DMAJobKind: func() interface{} { return new(models.DistanceMarksAshoreImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
30 BCNLATJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
4913
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
31 BOYCARJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
4922
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
32 BOYLATJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
4940
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
33 BOYSAWJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
34 BOYSPPJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
35 DAYMARJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
36 LIGHTSJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
37 RTPBCNJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
38 TOPMARJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
39 NOTMRKJobKind: func() interface{} { return new(models.FairwayMarksImport) }, |
4911
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
40 STJobKind: func() interface{} { return new(models.StretchImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
41 SECJobKind: func() interface{} { return new(models.SectionImport) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
42 DSECJobKind: func() interface{} { return new(models.SectionDelete) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
43 DSTJobKind: func() interface{} { return new(models.StretchDelete) }, |
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
44 DSRJobKind: func() interface{} { return new(models.SoundingResultDelete) }, |
2040
f1e32babb587
Imports: Moved constructor functions for import models to a table in the import package to be re-used by the configure/scheduled import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2038
diff
changeset
|
45 } |
f1e32babb587
Imports: Moved constructor functions for import models to a table in the import package to be re-used by the configure/scheduled import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2038
diff
changeset
|
46 |
4178
51e90370eced
A few more doc strings to make 'golint' a little bit more happy with the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3171
diff
changeset
|
47 // ImportModelForJobKind returns the constructor function to |
51e90370eced
A few more doc strings to make 'golint' a little bit more happy with the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3171
diff
changeset
|
48 // de-serialize an incoming JSON REST represention of an import. |
2042
d29ac997eb34
This breaks this branch!!!! Starting to remove the old persistent layer for configured imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2040
diff
changeset
|
49 func ImportModelForJobKind(kind JobKind) func() interface{} { |
d29ac997eb34
This breaks this branch!!!! Starting to remove the old persistent layer for configured imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2040
diff
changeset
|
50 return kindToImportModel[kind] |
d29ac997eb34
This breaks this branch!!!! Starting to remove the old persistent layer for configured imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2040
diff
changeset
|
51 } |
d29ac997eb34
This breaks this branch!!!! Starting to remove the old persistent layer for configured imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2040
diff
changeset
|
52 |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 var convertModel = map[JobKind]func(interface{}) interface{}{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 BNJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 bi := input.(*models.BottleneckImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 return &Bottleneck{ |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2058
diff
changeset
|
58 URL: bi.URL, |
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2058
diff
changeset
|
59 Tolerance: bi.Tolerance, |
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2058
diff
changeset
|
60 Insecure: bi.Insecure, |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 GMJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 gi := input.(*models.GaugeMeasurementImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 return &GaugeMeasurement{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 URL: gi.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 Insecure: gi.Insecure, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 FAJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 fai := input.(*models.FairwayAvailabilityImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 return &FairwayAvailability{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 URL: fai.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 Insecure: fai.Insecure, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 WXJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 wxi := input.(*models.WaterwayAxisImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 return &WaterwayAxis{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 URL: wxi.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 FeatureType: wxi.FeatureType, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 SortBy: nilString(wxi.SortBy), |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
86 User: nilString(wxi.User), |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
87 Password: nilString(wxi.Password), |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 WAJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 wai := input.(*models.WaterwayAreaImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 return &WaterwayArea{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 URL: wai.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 FeatureType: wai.FeatureType, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 SortBy: nilString(wai.SortBy), |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
97 User: nilString(wai.User), |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
98 Password: nilString(wai.Password), |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 WGJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 wgi := input.(*models.WaterwayGaugeImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 return &WaterwayGauge{ |
2056
0a401d81c6a6
Waterway gauge import: Fixed model converter (missed URL).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2042
diff
changeset
|
105 URL: wgi.URL, |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 Username: nilString(wgi.User), |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 Password: nilString(wgi.Password), |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 Insecure: wgi.Insecure, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 DMVJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 dmvi := input.(*models.DistanceMarksVirtualImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 return &DistanceMarksVirtual{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 URL: dmvi.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 Username: nilString(dmvi.User), |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 Password: nilString(dmvi.Password), |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 Insecure: dmvi.Insecure, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 FDJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 fdi := input.(*models.FairwayDimensionImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 return &FairwayDimension{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 URL: fdi.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 FeatureType: fdi.FeatureType, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 SortBy: nilString(fdi.SortBy), |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 LOS: fdi.LOS, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 MinWidth: fdi.MinWidth, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 MaxWidth: fdi.MaxWidth, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 Depth: fdi.Depth, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 SourceOrganization: fdi.SourceOrganization, |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
133 User: nilString(fdi.User), |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
134 Password: nilString(fdi.Password), |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
136 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
138 DMAJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
139 dmai := input.(*models.DistanceMarksAshoreImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
140 return &DistanceMarksAshore{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 URL: dmai.URL, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 FeatureType: dmai.FeatureType, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 SortBy: nilString(dmai.SortBy), |
2723
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
144 User: nilString(dmai.User), |
a10022399e24
WFS downloads: Fetch user and password from config.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
145 Password: nilString(dmai.Password), |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 }, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 |
4911
bcb8b69e4358
Type specific names for fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4894
diff
changeset
|
149 BCNLATJobKind: func(input interface{}) interface{} { |
4894
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
150 fmi := input.(*models.FairwayMarksImport) |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
151 return &FairwayMarks{ |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
152 URL: fmi.URL, |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
153 FeatureType: fmi.FeatureType, |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
154 SortBy: nilString(fmi.SortBy), |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
155 User: nilString(fmi.User), |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
156 Password: nilString(fmi.Password), |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
157 } |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
158 }, |
8eb36d0d5bdf
Draft implementation of fairway marks import
Tom Gottfried <tom@intevation.de>
parents:
4852
diff
changeset
|
159 |
4913
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
160 BOYCARJobKind: func(input interface{}) interface{} { |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
161 fmi := input.(*models.FairwayMarksImport) |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
162 return &FairwayMarks{ |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
163 URL: fmi.URL, |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
164 FeatureType: fmi.FeatureType, |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
165 SortBy: nilString(fmi.SortBy), |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
166 User: nilString(fmi.User), |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
167 Password: nilString(fmi.Password), |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
168 } |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
169 }, |
8c1a3d5e3962
Add import for fairway marks of type BOYCAR
Tom Gottfried <tom@intevation.de>
parents:
4911
diff
changeset
|
170 |
4922
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
171 BOYLATJobKind: func(input interface{}) interface{} { |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
172 fmi := input.(*models.FairwayMarksImport) |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
173 return &FairwayMarks{ |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
174 URL: fmi.URL, |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
175 FeatureType: fmi.FeatureType, |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
176 SortBy: nilString(fmi.SortBy), |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
177 User: nilString(fmi.User), |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
178 Password: nilString(fmi.Password), |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
179 } |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
180 }, |
9bd6a0ca63ea
Add import for fairway marks of type BOYLAT
Tom Gottfried <tom@intevation.de>
parents:
4913
diff
changeset
|
181 |
4940
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
182 BOYSAWJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
183 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
184 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
185 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
186 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
187 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
188 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
189 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
190 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
191 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
192 |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
193 BOYSPPJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
194 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
195 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
196 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
197 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
198 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
199 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
200 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
201 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
202 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
203 |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
204 DAYMARJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
205 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
206 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
207 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
208 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
209 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
210 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
211 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
212 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
213 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
214 |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
215 LIGHTSJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
216 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
217 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
218 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
219 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
220 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
221 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
222 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
223 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
224 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
225 |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
226 RTPBCNJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
227 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
228 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
229 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
230 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
231 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
232 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
233 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
234 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
235 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
236 |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
237 TOPMARJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
238 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
239 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
240 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
241 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
242 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
243 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
244 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
245 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
246 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
247 |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
248 NOTMRKJobKind: func(input interface{}) interface{} { |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
249 fmi := input.(*models.FairwayMarksImport) |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
250 return &FairwayMarks{ |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
251 URL: fmi.URL, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
252 FeatureType: fmi.FeatureType, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
253 SortBy: nilString(fmi.SortBy), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
254 User: nilString(fmi.User), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
255 Password: nilString(fmi.Password), |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
256 } |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
257 }, |
b3b2ba09a450
Add missing fairway mark types
Tom Gottfried <tom@intevation.de>
parents:
4922
diff
changeset
|
258 |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
259 STJobKind: func(input interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
260 sti := input.(*models.StretchImport) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
261 return &Stretch{ |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
262 Name: sti.Name, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
263 From: sti.From, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
264 To: sti.To, |
2563
dc4fae4bdb8f
Expose axis snapping tolerance to users
Tom Gottfried <tom@intevation.de>
parents:
2058
diff
changeset
|
265 Tolerance: sti.Tolerance, |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
266 ObjNam: sti.ObjNam, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
267 NObjNam: sti.NObjNam, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
268 Source: sti.Source, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
269 Date: sti.Date, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
270 Countries: sti.Countries, |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
271 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
272 }, |
3171
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
273 |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
274 SECJobKind: func(input interface{}) interface{} { |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
275 seci := input.(*models.SectionImport) |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
276 return &Section{ |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
277 Name: seci.Name, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
278 From: seci.From, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
279 To: seci.To, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
280 Tolerance: seci.Tolerance, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
281 ObjNam: seci.ObjNam, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
282 NObjNam: seci.NObjNam, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
283 Source: seci.Source, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
284 Date: seci.Date, |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
285 } |
c8ded555c2a8
Sections import: Added a sections import. Derived from the stretches import w/o the countries.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2723
diff
changeset
|
286 }, |
4189
2ac52d89619e
Exposed the import to delete sections under POST /api/imports/dsec with a JSON input as '{ "id": 42 }'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4178
diff
changeset
|
287 |
2ac52d89619e
Exposed the import to delete sections under POST /api/imports/dsec with a JSON input as '{ "id": 42 }'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4178
diff
changeset
|
288 DSECJobKind: func(input interface{}) interface{} { |
4392
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
289 dsec := input.(*models.SectionDelete) |
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
290 return &DeleteSection{ID: dsec.ID} |
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
291 }, |
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
292 |
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
293 DSTJobKind: func(input interface{}) interface{} { |
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
294 dst := input.(*models.StretchDelete) |
024b16a1c253
Implemented deletion of stretches.
Sascha Wilde <wilde@intevation.de>
parents:
4189
diff
changeset
|
295 return &DeleteStretch{ID: dst.ID} |
4189
2ac52d89619e
Exposed the import to delete sections under POST /api/imports/dsec with a JSON input as '{ "id": 42 }'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4178
diff
changeset
|
296 }, |
4400
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
297 |
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
298 DSRJobKind: func(input interface{}) interface{} { |
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
299 dsr := input.(*models.SoundingResultDelete) |
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
300 return &DeleteSoundingResult{ |
4852
046a07a33b19
Fixed the golint issues of the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
4400
diff
changeset
|
301 BottleneckID: dsr.BottleneckId, |
4400
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
302 Date: dsr.Date, |
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
303 } |
3b36c4d810b0
Added back end for deletion of sounding results.
Sascha Wilde <wilde@intevation.de>
parents:
4392
diff
changeset
|
304 }, |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
305 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
306 |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
307 func nilString(s *string) string { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
308 if s != nil { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
309 return *s |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
310 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
311 return "" |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
312 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
313 |
4178
51e90370eced
A few more doc strings to make 'golint' a little bit more happy with the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3171
diff
changeset
|
314 // ConvertToInternal converts an external JSON REST represention |
51e90370eced
A few more doc strings to make 'golint' a little bit more happy with the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3171
diff
changeset
|
315 // of an import into the internal one store in the import queue. |
2038
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
316 func ConvertToInternal(kind JobKind, src interface{}) interface{} { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
317 fn := convertModel[kind] |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
318 if fn == nil { |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
319 return nil |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
320 } |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
321 return fn(src) |
42a33f9e1f95
Imports: Moved model conversion into a table in the imports package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
322 } |