From c35dc5b18020db99f44c1f2183f08431762dd045 Mon Sep 17 00:00:00 2001 From: Florian Necas Date: Wed, 8 Jan 2025 16:22:31 +0100 Subject: [PATCH] feat: use header config file fix: header config --- .../main/java/org/fao/geonet/util/XslUtil.java | 17 +++++++++++++++++ web/src/main/webapp/xslt/base-layout.xsl | 2 +- .../main/webapp/xslt/common/base-variables.xsl | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/fao/geonet/util/XslUtil.java b/core/src/main/java/org/fao/geonet/util/XslUtil.java index f48f0a1dcb..5a0ac7a8ca 100644 --- a/core/src/main/java/org/fao/geonet/util/XslUtil.java +++ b/core/src/main/java/org/fao/geonet/util/XslUtil.java @@ -280,6 +280,7 @@ public static MultiPolygon toMultiPolygon(Geometry geometry) { private static String headerScript; private static String logoUrl; private static String georchestraStylesheet; + private static String headerConfigFile; public static String getGeorchestraHeaderUrl(){ @@ -378,6 +379,22 @@ public static String getGeorchestraHeaderStylesheet(){ return XslUtil.georchestraStylesheet; } + public static String getGeorchestraHeaderConfigFile(){ + + if(XslUtil.headerConfigFile == null) { + + // Set default value + XslUtil.headerConfigFile = ""; + + // Load value from datadir + Properties properties = XslUtil.loadDatadirProperties(); + if (properties.containsKey("headerConfigFile")) + XslUtil.headerConfigFile = properties.getProperty("headerConfigFile"); + } + + return XslUtil.headerConfigFile; + } + private static Properties loadProperties(File path, Properties prop) throws IOException { try(FileInputStream fisProp = new FileInputStream(path)) { InputStreamReader isrProp = new InputStreamReader(fisProp, "UTF8"); diff --git a/web/src/main/webapp/xslt/base-layout.xsl b/web/src/main/webapp/xslt/base-layout.xsl index d5018c3951..a5c16e1589 100644 --- a/web/src/main/webapp/xslt/base-layout.xsl +++ b/web/src/main/webapp/xslt/base-layout.xsl @@ -99,7 +99,7 @@ and a facet search to get main site information. --> - +
diff --git a/web/src/main/webapp/xslt/common/base-variables.xsl b/web/src/main/webapp/xslt/common/base-variables.xsl index f0494b372a..3126326fa5 100644 --- a/web/src/main/webapp/xslt/common/base-variables.xsl +++ b/web/src/main/webapp/xslt/common/base-variables.xsl @@ -39,7 +39,7 @@ - +