Mercurial > gemma
changeset 449:a74b8c2a4e75
Removed the command line option to publish tables with GeoServer.
This is now done with configuration from the database.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Tue, 21 Aug 2018 20:43:42 +0200 |
parents | 25dd96101aeb |
children | 1ebc174a1c53 |
files | cmd/gemma/geoserver.go pkg/config/config.go schema/gemma.sql |
diffstat | 3 files changed, 6 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/cmd/gemma/geoserver.go Tue Aug 21 20:05:45 2018 +0200 +++ b/cmd/gemma/geoserver.go Tue Aug 21 20:43:42 2018 +0200 @@ -180,9 +180,9 @@ user = config.GeoServerUser() password = config.GeoServerPassword() auth = basicAuth(user, password) - tables = config.GeoServerTables() ) + tables := models.PublishedServices.Filter(models.PublishedWFS) if len(tables) == 0 { log.Println("info: no tables to publish") return nil @@ -234,9 +234,8 @@ hasFeature = func(string) bool { return false } } - npe := models.PublishedServices.Filter(models.PublishedWFS) - for i := range npe { - table := npe[i].Name + for i := range tables { + table := tables[i].Name if hasFeature(table) { log.Printf("info: featuretype %s already exists.\n", table)
--- a/pkg/config/config.go Tue Aug 21 20:05:45 2018 +0200 +++ b/pkg/config/config.go Tue Aug 21 20:43:42 2018 +0200 @@ -44,7 +44,6 @@ func GeoServerURL() string { return viper.GetString("geoserver-url") } func GeoServerUser() string { return viper.GetString("geoserver-user") } func GeoServerPassword() string { return viper.GetString("geoserver-password") } -func GeoServerTables() []string { return viper.GetStringSlice("geoserver-tables") } var ( proxyKeyOnce sync.Once @@ -89,10 +88,6 @@ // TODO: Fill me! } -var geoTables = []string{ - "fairway_dimensions", -} - func init() { cobra.OnInitialize(initConfig) fl := RootCmd.PersistentFlags() @@ -144,7 +139,6 @@ str("geoserver-url", "http://localhost:8080/geoserver", "URL to GeoServer") str("geoserver-user", "admin", "GeoServer user") str("geoserver-password", "geoserver", "GeoServer password") - strSl("geoserver-tables", geoTables, "tables to publish with GeoServer") str("metamorph-db-user", "", "Metamorphic database user") str("metamorph-db-password", "", "Metamorphic database user password")
--- a/schema/gemma.sql Tue Aug 21 20:05:45 2018 +0200 +++ b/schema/gemma.sql Tue Aug 21 20:43:42 2018 +0200 @@ -70,6 +70,9 @@ ) ; +-- Tables with geo data to be published with GeoServer. +INSERT INTO sys_admin.published_services (name) VALUES ('fairway_dimensions'); + -- -- Look-up tables with data that are static in a running system --