comparison pkg/geoserver/boot.go @ 4673:443867b548b5

Fix identifiers in layers generated from SQL views
author Tom Gottfried <tom@intevation.de>
date Tue, 15 Oct 2019 15:59:38 +0200
parents 209b10f7bb2c
children 4a9a1e323e11
comparison
equal deleted inserted replaced
4672:c7dc1a6da93d 4673:443867b548b5
88 Key string `xml:"key,attr"` 88 Key string `xml:"key,attr"`
89 VirtTable ftVirtTable 89 VirtTable ftVirtTable
90 } 90 }
91 91
92 type ftVirtTable struct { 92 type ftVirtTable struct {
93 XMLName xml.Name `xml:"virtualTable"` 93 XMLName xml.Name `xml:"virtualTable"`
94 Name string `xml:"name"` 94 Name string `xml:"name"`
95 SQL string `xml:"sql"` 95 SQL string `xml:"sql"`
96 KeyColumn *string `xml:"keyColumn,omitempty"`
96 } // End code for handling with XML 97 } // End code for handling with XML
97 98
98 func asJSON(req *http.Request) { 99 func asJSON(req *http.Request) {
99 req.Header.Set("Content-Type", "application/json") 100 req.Header.Set("Content-Type", "application/json")
100 } 101 }
333 SRS: tables[i].SRS, 334 SRS: tables[i].SRS,
334 Metadata: ftMetadata{ 335 Metadata: ftMetadata{
335 Entry: ftMetadataEntry{ 336 Entry: ftMetadataEntry{
336 Key: "JDBC_VIRTUAL_TABLE", 337 Key: "JDBC_VIRTUAL_TABLE",
337 VirtTable: ftVirtTable{ 338 VirtTable: ftVirtTable{
338 Name: table, 339 Name: table,
339 SQL: *tables[i].SQL}}}} 340 SQL: *tables[i].SQL,
341 KeyColumn: tables[i].KeyColumn}}}}
340 342
341 req, err = http.NewRequest( 343 req, err = http.NewRequest(
342 http.MethodPost, 344 http.MethodPost,
343 datastoreURL+"/featuretypes", 345 datastoreURL+"/featuretypes",
344 toXMLStream(ft)) 346 toXMLStream(ft))