From 4cf6cb72e3a1ad088096bc57e4bdae47ea40eac9 Mon Sep 17 00:00:00 2001 From: Sukh <6563909+sukhpalp@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:16:48 -0700 Subject: [PATCH] Use variable for service6 URL (#1827) --- .../layers/closed-recreation-sites.config.ts | 2 +- .../layers/fire-perimeters.config.ts | 2 +- .../layers/fsr-safety.config.ts | 2 +- .../services/map-config.service/layers/index.ts | 4 +++- .../layers/prescribed-fire.config.ts | 2 +- .../main/angular/src/assets/data/appConfig.json | 15 ++++++++------- client/wfnews-war/src/main/webapp/config.jsp | 12 +++++++++--- .../src/main/resources/application.properties | 2 +- .../src/test/resources/test.properties | 2 +- 9 files changed, 26 insertions(+), 17 deletions(-) diff --git a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/closed-recreation-sites.config.ts b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/closed-recreation-sites.config.ts index 6f8038df03..f803add01f 100644 --- a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/closed-recreation-sites.config.ts +++ b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/closed-recreation-sites.config.ts @@ -49,7 +49,7 @@ export function ClosedRecreationSitesLayerConfig(ls: layerSettings) { }, ], serviceUrl: - 'https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/RecSitesReservesInterpForests_DetailsClosures_publicView/FeatureServer/0', + ls.services6BaseUrl + '/ubm4tcTYICKBpist/ArcGIS/rest/services/RecSitesReservesInterpForests_DetailsClosures_publicView/FeatureServer/0', where: 'CLOSURE_IND = \'Y\'', titleAttribute: 'PROJECT_NAME', drawingInfo: { diff --git a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fire-perimeters.config.ts b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fire-perimeters.config.ts index 77910e92b9..6a28ddb31c 100644 --- a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fire-perimeters.config.ts +++ b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fire-perimeters.config.ts @@ -8,7 +8,7 @@ export function FirePerimetersLayerConfig(ls: layerSettings) { title: 'BC Wildfire Fire Perimeters', attribution: 'Copyright 117 DataBC, Government of British Columbia', serviceUrl: - 'https://services6.arcgis.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0', + ls.services6BaseUrl + '/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0', where: 'FIRE_STATUS <> \'Out\'', opacity: 1, attributes: [ diff --git a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fsr-safety.config.ts b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fsr-safety.config.ts index e81ef46fdb..cffea767d0 100644 --- a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fsr-safety.config.ts +++ b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/fsr-safety.config.ts @@ -9,7 +9,7 @@ export function ForestServiceRoadsLayerConfig(ls: layerSettings) { isQueryable: true, attribution: 'Copyright 117 DataBC, Government of British Columbia', serviceUrl: - 'https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/FSR_Safety_Information_View/FeatureServer/0', + ls.services6BaseUrl + '/ubm4tcTYICKBpist/ArcGIS/rest/services/FSR_Safety_Information_View/FeatureServer/0', opacity: 1, titleAttribute: 'LOCATION', popupTemplate: diff --git a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/index.ts b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/index.ts index 62d4fe970e..674fbf5eaa 100644 --- a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/index.ts +++ b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/index.ts @@ -6,6 +6,7 @@ import { ActiveWildfiresLayerConfig } from './active-wildfires.config'; import { ActiveWildfiresHeatmapLayerConfig } from './active-wildfires.heatmap.config'; import { AreaRestrictionsLayerConfig } from './area-restrictions.config'; import { BansAndProhibitionsLayerConfig } from './bans-and-prohibitions.config'; +import { BasemapLayerConfig } from './basemap.config'; import { FireCentresLayerConfig } from './bc-fire-centres.config'; import { ProtectedLandsAccessRestrictionsLayerConfig } from './bc-parks-closures.config'; import { WildfiresInactiveLayerConfig } from './bcws-activefires-publicview-inactive.config'; @@ -21,12 +22,12 @@ import { SmokeForecastLayerConfig } from './hourly-currentforecast-firesmoke.con import { PrecipitationLayerConfig } from './precipitation.config'; import { WeatherStationsLayerConfig } from './weather-stations.config'; import { WeatherLayerConfig } from './weather.config'; -import { BasemapLayerConfig } from './basemap.config'; //import { FuelTreatmentLayerConfig } from './fuel-treatment'; //import { PrescribedFireLayerConfig } from './prescribed-fire.config'; export interface layerSettings { openmapsBaseUrl: string; + services6BaseUrl: string; drivebcBaseUrl: string; wfnewsUrl: string; evacOrdersURL: string; @@ -39,6 +40,7 @@ export function LayerConfig( const ls: layerSettings = { openmapsBaseUrl: mapServices['openmapsBaseUrl'], drivebcBaseUrl: mapServices['drivebcBaseUrl'], + services6BaseUrl: mapServices['services6BaseUrl'], wfnewsUrl: mapServices['wfnews'], evacOrdersURL: appConfigService.getConfig().externalAppConfig['AGOLevacOrders'].toString() }; diff --git a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/prescribed-fire.config.ts b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/prescribed-fire.config.ts index 879119638f..8e295bf6c0 100644 --- a/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/prescribed-fire.config.ts +++ b/client/wfnews-war/src/main/angular/src/app/services/map-config.service/layers/prescribed-fire.config.ts @@ -9,7 +9,7 @@ export function PrescribedFireLayerConfig(ls: layerSettings) { isQueryable: true, attribution: 'Copyright 117 DataBC, Government of British Columbia', serviceUrl: - 'https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Prescribed_Fire_-_View/FeatureServer/4', + ls.services6BaseUrl + '/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Prescribed_Fire_-_View/FeatureServer/4', titleAttribute: 'Fire_Zone', attributes: [ { diff --git a/client/wfnews-war/src/main/angular/src/assets/data/appConfig.json b/client/wfnews-war/src/main/angular/src/assets/data/appConfig.json index 9c87f75bb0..1bddf521ab 100644 --- a/client/wfnews-war/src/main/angular/src/assets/data/appConfig.json +++ b/client/wfnews-war/src/main/angular/src/assets/data/appConfig.json @@ -59,13 +59,13 @@ "bcWildFireSupportPage": "https://intranet.gov.bc.ca/bcws/provincial-programs/strategic-initiatives-and-innovation/wildfire-one/wildfire-one-training", "appStoreUrl": "https://apps.apple.com/ca/app/bc-wildfire-service/id1477675008", "googlePlayUrl": "https://play.google.com/store/apps/details?id=ca.bc.gov.WildfireInformation&hl=en_CA&gl=US", - "AGOLfireCentres": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=", - "AGOLevacOrders": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_Emrg_Orders_and_Alerts/FeatureServer/0", - "AGOLareaRestrictions": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Area_Restrictions/FeatureServer/0", - "AGOLBansAndProhibitions": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Bans_and_Prohibition_Areas/FeatureServer/0/", - "AGOLDangerRatings": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Danger_Rating/FeatureServer/0/", - "AGOLperimetres": "https://services6.arcgis.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/", - "AGOLactiveFirest": "https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/", + "AGOLfireCentres": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=", + "AGOLevacOrders": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_Emrg_Orders_and_Alerts/FeatureServer/0", + "AGOLareaRestrictions": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Area_Restrictions/FeatureServer/0", + "AGOLBansAndProhibitions": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Bans_and_Prohibition_Areas/FeatureServer/0/", + "AGOLDangerRatings": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/test_British_Columbia_Danger_Rating/FeatureServer/0/", + "AGOLperimetres": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/", + "AGOLactiveFirest": "https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/", "evacDefaultUrl": "https://www.emergencyinfobc.gov.bc.ca/current-wildfire-information-2023", "evacDefaultBulletin": "https://www.emergencyinfobc.gov.bc.ca", "contactInformation": { @@ -126,6 +126,7 @@ "mapServices": { "openmapsBaseUrl": "https://maps.dev.bcwildfireservices.com/geo/pub/ows", + "services6BaseUrl": "https://services6.dev.bcwildfireservices.com", "#openmapsBaseUrl": "https://openmaps.gov.bc.ca/geo/pub/ows", "drivebcBaseUrl": "https://dev-maps.th.gov.bc.ca/geoV05/ows", "#wfnews": "http://localhost:1338", diff --git a/client/wfnews-war/src/main/webapp/config.jsp b/client/wfnews-war/src/main/webapp/config.jsp index 9be8cd8022..a6836aa11a 100644 --- a/client/wfnews-war/src/main/webapp/config.jsp +++ b/client/wfnews-war/src/main/webapp/config.jsp @@ -66,13 +66,13 @@ json.append("\"bcWildfireResponsePage\":\"").append("https://www2.gov.bc.ca/gov/content/safety/wildfire-status/wildfire-response/wildfire-personnel-and-response-tools").append("\","); json.append("\"appStoreUrl\":\"").append(properties.getProperty("appStoreUrl", "")).append("\","); json.append("\"googlePlayUrl\":\"").append(properties.getProperty("googlePlayUrl", "")).append("\","); - json.append("\"AGOLfireCentres\":\"").append("https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=").append("\","); + json.append("\"AGOLfireCentres\":\"").append(services6).append("/ubm4tcTYICKBpist/ArcGIS/rest/services/British_Columbia_Fire_Centre_Boundaries/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&relationParam=&returnGeodetic=false&outFields=*&returnGeometry=false&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&defaultSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token=").append("\","); json.append("\"AGOLevacOrders\":\"").append(agolEvacOrders).append("\","); json.append("\"AGOLareaRestrictions\":\"").append(agolAreaRestrictions).append("\","); json.append("\"AGOLBansAndProhibitions\":\"").append(agolBansAndProhibitions).append("\","); json.append("\"AGOLDangerRatings\":\"").append(agolDangerRatings).append("\","); - json.append("\"AGOLperimetres\":\"").append("https://services6.arcgis.com/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/").append("\","); - json.append("\"AGOLactiveFirest\":\"").append("https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/").append("\","); + json.append("\"AGOLperimetres\":\"").append(services6).append("/ubm4tcTYICKBpist/arcgis/rest/services/BCWS_FirePerimeters_PublicView/FeatureServer/0/").append("\","); + json.append("\"AGOLactiveFirest\":\"").append(services6).append("/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/").append("\","); json.append("\"evacDefaultUrl\":\"").append("https://www.emergencyinfobc.gov.bc.ca/current-wildfire-information-2023").append("\","); json.append("\"evacDefaultBulletin\":\"").append("https://www.emergencyinfobc.gov.bc.ca").append("\","); json.append("\"currentRestrictions\":\"").append("https://www2.gov.bc.ca/gov/content/safety/wildfire-status/prevention/fire-bans-and-restrictions").append("\","); @@ -121,9 +121,15 @@ openmaps = openmaps.substring(0, openmaps.length() - 1); //Strip off trailing slash, if it exists. } + String services6 = EnvironmentVariable.getVariable("SERVICES6_BASE_URL"); + if (services6 != null && services6.endsWith("/")) { + services6 = services6.substring(0, services6.length() - 1); //Strip off trailing slash, if it exists. + } + // External Application Section json.append("\"mapServices\":{"); json.append("\"openmapsBaseUrl\":\"").append(openmaps).append("\"").append(","); + json.append("\"services6BaseUrl\":\"").append(services6).append("\"").append(","); json.append("\"wfnews\":\"").append(wfnewsUri).append("\"").append(","); json.append("\"drivebcBaseUrl\":\"").append(driveBc).append("\""); json.append("},"); diff --git a/server/wfnews-api/wfnews-api-rest-endpoints/src/main/resources/application.properties b/server/wfnews-api/wfnews-api-rest-endpoints/src/main/resources/application.properties index 739770dbf4..8430a0a651 100644 --- a/server/wfnews-api/wfnews-api-rest-endpoints/src/main/resources/application.properties +++ b/server/wfnews-api/wfnews-api-rest-endpoints/src/main/resources/application.properties @@ -16,4 +16,4 @@ wfone.email.sync.send.frequency=#{wfone.email.sync.send.frequency} wfone.email.sync.error.subject=#{wfone.email.sync.error.subject} wfone.email.sync.subject=#{wfone.email.sync.subject} wfone.default.application.environment=#{wfone.default.application.environment} -wfnews-agol-query.url=https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT' +wfnews-agol-query.url=https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT' diff --git a/server/wfnews-api/wfnews-api-rest-endpoints/src/test/resources/test.properties b/server/wfnews-api/wfnews-api-rest-endpoints/src/test/resources/test.properties index 2185b74155..68ebdab254 100644 --- a/server/wfnews-api/wfnews-api-rest-endpoints/src/test/resources/test.properties +++ b/server/wfnews-api/wfnews-api-rest-endpoints/src/test/resources/test.properties @@ -4,4 +4,4 @@ wfone.datasource.url=#{WFNEWS_DB_URL} wfone.datasource.username=#{WFNEWS_DB_USERNAME} wfone.datasource.password=#{WEBADE_OAUTH2_WFNEWS_REST_CLIENT_SECRET} wfone.datasource.max.connections=#{WFNEWS_DB_MAX_CONNECTIONS} -wfnews-agol-query.url=https://services6.arcgis.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT' \ No newline at end of file +wfnews-agol-query.url=https://services6.dev.bcwildfireservices.com/ubm4tcTYICKBpist/ArcGIS/rest/services/BCWS_ActiveFires_PublicView/FeatureServer/0/query?where=FIRE_STATUS+%3C%3E+'OUT' \ No newline at end of file