Skip to content

Commit

Permalink
Create sql view layer use private endpoint reload
Browse files Browse the repository at this point in the history
  • Loading branch information
swainn committed Mar 30, 2023
1 parent 376ffda commit 9d87513
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tethys_dataset_services/engines/geoserver_engine.py
Expand Up @@ -1400,7 +1400,8 @@ def create_layer_from_postgis_store(self, store_id, table, debug=False):
return response_dict

def create_sql_view_layer(self, store_id, layer_name, geometry_type, srid, sql, default_style,
geometry_name='geometry', other_styles=None, parameters=None, debug=False):
geometry_name='geometry', other_styles=None, parameters=None, reload_public=False,
debug=False):
"""
Direct call to GeoServer REST API to create SQL View feature types and layers.
Expand All @@ -1414,6 +1415,7 @@ def create_sql_view_layer(self, store_id, layer_name, geometry_type, srid, sql,
default_style: The name of the default style. Can be a name or a workspace-name combination (e.g.: "name" or "workspace:name").
other_styles: A list of other default style names. Can be a name or a workspace-name combination (e.g.: "name" or "workspace:name").
parameters: A list of parameter dictionaries { name, default_value, regex_validator }.
reload_public: (bool, optional): Reload the catalog using the public endpoint. Defaults to False.
debug (bool, optional): Pretty print the response dictionary to the console for debugging. Defaults to False.
""" # noqa: E501
# Process identifier
Expand Down Expand Up @@ -1476,7 +1478,7 @@ def create_sql_view_layer(self, store_id, layer_name, geometry_type, srid, sql,
raise exception

# Reload before attempting to update styles to avoid issues
self.reload()
self.reload(public=reload_public)

# Add styles to new layer
self.update_layer_styles(
Expand Down

0 comments on commit 9d87513

Please sign in to comment.