From f4d08d8a2e5aa0b29bf00f128b99e56c9ea90e56 Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Fri, 5 Jan 2024 12:26:33 +0100 Subject: [PATCH] Extracting JNDI datastore, too --- serverscripts/geoserver.py | 16 +++++----- .../u0106_3Dzeeland/u0106/datastore.xml | 32 ++++++------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/serverscripts/geoserver.py b/serverscripts/geoserver.py index d9d44ff..7210095 100644 --- a/serverscripts/geoserver.py +++ b/serverscripts/geoserver.py @@ -165,9 +165,9 @@ def extract_datastore_info(datastore_file): connection, "./entry[@key='database']" ) result["database_user"] = get_text_or_none(connection, "./entry[@key='user']") - # result["database_namespace"] = get_text_or_none( - # connection, "./entry[@key='namespace']" - # ) + jndi_connection = get_text_or_none(connection, "./entry[@key='jndiReferenceName']") + if jndi_connection: + result["database_name"] = jndi_connection return result @@ -196,11 +196,11 @@ def extract_from_dirs(data_dir): for workspace_datastore_file in workspace_datastore_files ] for key in [ - "enabled", - "type", - "database_server", - "database_user", - "database_name", + "enabled", + "type", + "database_server", + "database_user", + "database_name", ]: workspace[key] = _combine_with_comma(datastores, key) result[workspace_name] = workspace diff --git a/serverscripts/tests/example_geoserver_data/workspaces/u0106_3Dzeeland/u0106/datastore.xml b/serverscripts/tests/example_geoserver_data/workspaces/u0106_3Dzeeland/u0106/datastore.xml index f8b147d..f30c7df 100755 --- a/serverscripts/tests/example_geoserver_data/workspaces/u0106_3Dzeeland/u0106/datastore.xml +++ b/serverscripts/tests/example_geoserver_data/workspaces/u0106_3Dzeeland/u0106/datastore.xml @@ -2,38 +2,24 @@ DataStoreInfoImpl-52b81a0d:16feab49b5d:-7afd u0106 Kloosterzande assets - PostGIS + PostGIS (JNDI) true WorkspaceInfoImpl-52b81a0d:16feab49b5d:-7b01 - public - 300 - 50 - false + true 1 false - staging-project-geoserver - s-project-db-d1.nens - true - true - 1000 + FAST + 5000 + true + java:comp/env/jdbc/klimaatatlas_geoserver false - true true - 20 - false - 5432 - crypt2:VKqOzz9nVJencJVUIrUQfXje7SdCdTryWkFfP2ilzN0= - 1 postgis - u0106_3Dzeeland - 10 - 3 - true - staging-project-geoserver - 300 + hhnk + true <__default>false - \ No newline at end of file +