Repository: gisaia/ARLAS-server (language: python)

Issue:
Remove ARLAS_OGC_SERVER_URI env variable
According to our [doc](http://docs.arlas.io/arlas-tech/current/arlas-server-configuration/), `ARLAS_OGC_SERVER_URI` is deprecated since v10.6.1.

We're replacing it by `ARLAS_BASE_URI`


Discussion / hints:

Fix patch:
diff --git a/arlas-core/src/main/java/io/arlas/server/core/app/OGCConfiguration.java b/arlas-core/src/main/java/io/arlas/server/core/app/OGCConfiguration.java
index c82618d2c..cf778ac0f 100644
--- a/arlas-core/src/main/java/io/arlas/server/core/app/OGCConfiguration.java
+++ b/arlas-core/src/main/java/io/arlas/server/core/app/OGCConfiguration.java
@@ -23,9 +23,6 @@
 
 public class OGCConfiguration {
 
-    @JsonProperty("serverUri")
-    public String serverUri;
-
     @JsonProperty("serviceProviderName")
     public String serviceProviderName;
 
@@ -53,10 +50,6 @@ public class OGCConfiguration {
     @JsonProperty("queryMaxFeature")
     public Number queryMaxFeature;
 
-    public String getServerUri() {
-        return serverUri;
-    }
-
     public String getServiceProviderName() {
         return serviceProviderName;
     }
diff --git a/conf/configuration.yaml b/conf/configuration.yaml
index 934e0076e..5c06ba040 100644
--- a/conf/configuration.yaml
+++ b/conf/configuration.yaml
@@ -124,7 +124,6 @@ arlas-wfs:
   featureNamespace: ${ARLAS_WFS_FEATURE_NAMESPACE:-arlas}
 
 arlas-ogc:
-  serverUri: ${ARLAS_OGC_SERVER_URI:-http://localhost:9999/arlas/}
   serviceProviderName: ${ARLAS_OGC_SERVICE_PROVIDER_NAME:-ARLAS}
   serviceProviderSite: ${ARLAS_OGC_SERVICE_PROVIDER_SITE:-www.gisaia.com}
   serviceProviderRole: ${ARLAS_OGC_SERVICE_PROVIDER_ROLE:-Developer}
diff --git a/docs/arlas-server-configuration.md b/docs/arlas-server-configuration.md
index 0daa1efa1..429069e11 100644
--- a/docs/arlas-server-configuration.md
+++ b/docs/arlas-server-configuration.md
@@ -150,7 +150,6 @@ docker run -ti -d \
 
 | Environment variable | ARLAS OGC Server configuration variable | Default | Description |
 | --- | --- | --- | --- |
-| ARLAS_OGC_SERVER_URI | arlas-ogc.serverUri | http://localhost:9999/arlas/ | Base URI to ARLAS Server |
 | ARLAS_OGC_SERVICE_PROVIDER_NAME | arlas-ogc.serviceProviderName | OrganisationName | Name of the organization responsible for the establishment, management, maintenance and distribution of the WFS & CSW services |
 | ARLAS_OGC_SERVICE_PROVIDER_SITE | arlas-ogc.serviceProviderSite | OrganisationWebSite | A link to the site of the WFS & CSW service provider |
 | ARLAS_OGC_SERVICE_PROVIDER_ROLE | arlas-ogc.serviceProviderRole | pointOfContact | Function performed by the party responsible for the WFS & CSW services |
@@ -161,9 +160,6 @@ docker run -ti -d \
 | ARLAS_OGC_SERVICE_CONTACT_COUNTRY | arlas-ogc.serviceContactAdressCountry | France | Country of the organization responsible for WFS & CSW services |
 | ARLAS_OGC_QUERYMAXFEATURE | arlas-ogc.queryMaxFeature | 1000 | Maximum number of features returned by OGC queries |
 
-!!! info "Important"
-    `ARLAS_OGC_SERVER_URI` is deprecated starting from v10.6.1. It's recommended to use `ARLAS_BASE_URI` instead. `ARLAS_OGC_SERVER_URI` is taken into account only if `ARLAS_BASE_URI` is not specified. 
-
 ### WFS
 
 | Environment variable | ARLAS WFS Server configuration variable | Default | Description |
diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWHandler.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWHandler.java
index 6639d0daa..568bb8351 100644
--- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWHandler.java
+++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWHandler.java
@@ -26,7 +26,6 @@
 import io.arlas.server.ogc.csw.operation.getrecordbyid.GetRecordsByIdHandler;
 import io.arlas.server.ogc.csw.operation.getrecords.GetRecordsHandler;
 import io.arlas.server.ogc.csw.operation.opensearch.OpenSearchHandler;
-import io.arlas.server.core.utils.StringUtil;
 import net.opengis.cat.csw._3.ObjectFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,12 +54,7 @@ public CSWHandler(OGCConfiguration ogcConfiguration, CSWConfiguration cswConfigu
         this.ogcConfiguration = ogcConfiguration;
         this.cswConfiguration = cswConfiguration;
         this.inspireConfiguration = inspireConfiguration;
-        if (StringUtil.isNullOrEmpty(baseUri)) {
-            this.baseUri = ogcConfiguration.serverUri;
-            LOGGER.warn("[arlas-ogc.serverUri] is deprecated. Use [arlas-base-uri] instead.");
-        } else {
-            this.baseUri = baseUri;
-        }
+        this.baseUri = baseUri;
         getCapabilitiesHandler = new GetCapabilitiesHandler(this);
         getRecordsHandler = new GetRecordsHandler(this);
         getRecordsByIdHandler = new GetRecordsByIdHandler(this);
diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java
index d018cc18f..13fa266cb 100644
--- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java
+++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java
@@ -24,7 +24,6 @@
 import io.arlas.server.core.ns.ATOM;
 import io.arlas.server.ogc.csw.CSWRESTService;
 import io.arlas.server.ogc.csw.utils.AtomBuilder;
-import io.arlas.server.core.utils.StringUtil;
 import net.opengis.cat.csw._3.GetRecordsResponseType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -103,14 +102,7 @@ public void writeTo(GetRecordsResponseType getRecordsResponseType, Class<?> aCla
         }
         LinkType linkType = new LinkType();
         linkType.setType(CSWRESTService.MIME_TYPE__OPENSEARCH_XML);
-        String baseUri;
-        if (StringUtil.isNullOrEmpty(arlasServerConfiguration.arlasBaseUri)) {
-            baseUri = arlasServerConfiguration.ogcConfiguration.serverUri;
-            LOGGER.warn("[arlas-ogc.serverUri] is deprecated. Use [arlas-base-uri] instead.");
-        } else {
-            baseUri = arlasServerConfiguration.arlasBaseUri;
-        }
-        linkType.setHref(baseUri + "ogc/opensearch/{collection}");
+        linkType.setHref(arlasServerConfiguration.arlasBaseUri + "ogc/opensearch/{collection}");
         linkType.setRel("search");
         feedType.getLink().add(linkType);
         com.a9.opensearch.ObjectFactory openSearchFactory = new com.a9.opensearch.ObjectFactory();
diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSHandler.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSHandler.java
index dc0643d59..69093fb5a 100644
--- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSHandler.java
+++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSHandler.java
@@ -23,13 +23,12 @@
 import io.arlas.server.core.app.InspireConfiguration;
 import io.arlas.server.core.app.OGCConfiguration;
 import io.arlas.server.core.app.WFSConfiguration;
+import io.arlas.server.ogc.common.utils.XmlUtils;
 import io.arlas.server.ogc.wfs.operation.describefeaturetype.DescribeFeatureTypeHandler;
 import io.arlas.server.ogc.wfs.operation.getcapabilities.GetCapabilitiesHandler;
 import io.arlas.server.ogc.wfs.operation.getfeature.GetFeatureHandler;
 import io.arlas.server.ogc.wfs.operation.storedquery.ListStoredQueriesHandler;
 import io.arlas.server.ogc.wfs.operation.storedquery.StoredQueryManager;
-import io.arlas.server.ogc.common.utils.XmlUtils;
-import io.arlas.server.core.utils.StringUtil;
 import net.opengis.wfs._2.ObjectFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -58,12 +57,7 @@ public WFSHandler(WFSConfiguration wfsconfiguration, OGCConfiguration ogcConfigu
         this.wfsConfiguration = wfsconfiguration;
         this.ogcConfiguration = ogcConfiguration;
         this.inspireConfiguration = inspireConfiguration;
-        if (StringUtil.isNullOrEmpty(baseUri)) {
-            this.baseUri = ogcConfiguration.serverUri;
-            LOGGER.warn("[arlas-ogc.serverUri] is deprecated. Use [arlas-base-uri] instead.");
-        } else {
-            this.baseUri = baseUri;
-        }
+        this.baseUri = baseUri;
         getCapabilitiesHandler = new GetCapabilitiesHandler(this);
         describeFeatureTypeHandler = new DescribeFeatureTypeHandler(this);
         listStoredQueriesHandler = new ListStoredQueriesHandler(this);


Test patch:
diff --git a/scripts/start-test-docker-stack.sh b/scripts/start-test-docker-stack.sh
index c00103190..6f4286663 100755
--- a/scripts/start-test-docker-stack.sh
+++ b/scripts/start-test-docker-stack.sh
@@ -14,7 +14,6 @@ cd ${SCRIPT_PATH}/..
 # CLEAR ENV VAR
 unset ARLAS_PREFIX
 unset ARLAS_APP_PATH
-unset ARLAS_OGC_SERVER_URI
 unset ARLAS_SERVICE_RASTER_TILES_ENABLE
 
 # STOP PREVIOUS STACK