From 3742f76aaec153624b0959acf0ea2a1104b55b46 Mon Sep 17 00:00:00 2001 From: bclayton-usgs <bclayton@usgs.gov> Date: Thu, 3 Oct 2019 13:44:47 -0600 Subject: [PATCH] update url paths --- etc/matlab/gmmBatchExample.m | 4 ++-- etc/python/gmmBatchExample.py | 4 ++-- .../earthquake/nshmp/www/GmmServices.java | 2 +- .../earthquake/nshmp/www/HazardService.java | 5 ++-- .../earthquake/nshmp/www/HazardService2.java | 5 ++-- .../earthquake/nshmp/www/NshmpServlet.java | 4 ++-- .../earthquake/nshmp/www/SourceServices.java | 6 ++--- .../nshmp/www/UtilitiesService.java | 2 +- .../earthquake/nshmp/www/meta/Metadata.java | 2 +- webapp/WEB-INF/web.xml | 2 +- webapp/apps/js/DynamicCompare.js | 8 +++---- webapp/apps/js/GeoDeagg.js | 4 ++-- webapp/apps/js/GmmDistance.js | 6 ++--- webapp/apps/js/HwFw.js | 6 ++--- webapp/apps/js/Services.js | 18 +++++++------- webapp/apps/js/Spectra.js | 7 +++--- webapp/apps/js/Util.js | 2 +- webapp/apps/js/lib/Config.js | 20 +++++++++------- webapp/apps/js/lib/D3GeoDeagg.js | 4 ++-- webapp/apps/js/lib/Footer.js | 8 +++---- webapp/apps/js/lib/Gmm.js | 4 ++-- webapp/apps/js/lib/GmmBeta.js | 4 ++-- webapp/apps/js/lib/Hazard.js | 4 ++-- webapp/apps/js/lib/HazardNew.js | 4 ++-- webapp/apps/js/lib/Header.js | 24 +++++++++---------- webapp/apps/js/lib/LeafletTestSitePicker.js | 2 +- webapp/apps/js/lib/TestSiteView.js | 2 +- webapp/apps/js/response/WebServiceResponse.js | 2 +- webapp/etc/examples/Dashboard.js | 6 ++--- 29 files changed, 89 insertions(+), 82 deletions(-) diff --git a/etc/matlab/gmmBatchExample.m b/etc/matlab/gmmBatchExample.m index 9327ba746..344532d11 100644 --- a/etc/matlab/gmmBatchExample.m +++ b/etc/matlab/gmmBatchExample.m @@ -1,4 +1,4 @@ -%% nshmp-haz-ws Ground Motion Model (GMM) batch processing example script +%% nshmp-haz-v2 Ground Motion Model (GMM) batch processing example script clear; @@ -31,7 +31,7 @@ inputs = fileread('gmm-inputs.csv'); % All GMM services are available to call for batch processing. host = 'http://localhost:8080'; -service = '/nshmp-haz-ws/gmm/spectra'; +service = '/nshmp-haz-v2/gmm/spectra'; query = 'gmm=AB_06_PRIME&gmm=CAMPBELL_03&gmm=FRANKEL_96'; diff --git a/etc/python/gmmBatchExample.py b/etc/python/gmmBatchExample.py index 8b0201fe4..130267fba 100644 --- a/etc/python/gmmBatchExample.py +++ b/etc/python/gmmBatchExample.py @@ -1,4 +1,4 @@ -## nshmp-haz-ws Ground Motion Model (GMM) batch processing example script +## nshmp-haz-v2 Ground Motion Model (GMM) batch processing example script import requests @@ -35,7 +35,7 @@ file.close() # All GMM services are available to call for batch processing. host = 'http://localhost:8080' -service = '/nshmp-haz-ws/gmm/spectra' +service = '/nshmp-haz-v2/gmm/spectra' url = host + service diff --git a/src/gov/usgs/earthquake/nshmp/www/GmmServices.java b/src/gov/usgs/earthquake/nshmp/www/GmmServices.java index e27192dfb..1a59bcd00 100644 --- a/src/gov/usgs/earthquake/nshmp/www/GmmServices.java +++ b/src/gov/usgs/earthquake/nshmp/www/GmmServices.java @@ -389,7 +389,7 @@ public class GmmServices extends NshmpServlet { Parameters parameters; Metadata(Service service) { - this.syntax = "%s://%s/nshmp-haz-ws/gmm" + service.pathInfo + "?"; + this.syntax = "%s://%s/nshmp-haz-v2/gmm" + service.pathInfo + "?"; this.description = service.description; this.parameters = new Parameters(service); } diff --git a/src/gov/usgs/earthquake/nshmp/www/HazardService.java b/src/gov/usgs/earthquake/nshmp/www/HazardService.java index 05cd528dd..c0a67fb25 100644 --- a/src/gov/usgs/earthquake/nshmp/www/HazardService.java +++ b/src/gov/usgs/earthquake/nshmp/www/HazardService.java @@ -47,6 +47,7 @@ import gov.usgs.earthquake.nshmp.calc.HazardCalcs; import gov.usgs.earthquake.nshmp.calc.Site; import gov.usgs.earthquake.nshmp.calc.Vs30; import gov.usgs.earthquake.nshmp.data.MutableXySequence; +import gov.usgs.earthquake.nshmp.data.Sequences; import gov.usgs.earthquake.nshmp.data.XySequence; import gov.usgs.earthquake.nshmp.eq.model.HazardModel; import gov.usgs.earthquake.nshmp.eq.model.SourceType; @@ -452,7 +453,7 @@ public final class HazardService extends NshmpServlet { for (Imt imt : hazardResult.curves().keySet()) { // total curve - XySequence.addToMap(imt, totalMap, hazardResult.curves().get(imt)); + Sequences.addToMap(imt, totalMap, hazardResult.curves().get(imt)); // component curves Map<SourceType, ? extends XySequence> typeTotalMap = typeTotalMaps.get(imt); @@ -463,7 +464,7 @@ public final class HazardService extends NshmpServlet { } for (SourceType type : typeTotalMap.keySet()) { - XySequence.addToMap(type, componentMap, typeTotalMap.get(type)); + Sequences.addToMap(type, componentMap, typeTotalMap.get(type)); } xValuesLinearMap.put( diff --git a/src/gov/usgs/earthquake/nshmp/www/HazardService2.java b/src/gov/usgs/earthquake/nshmp/www/HazardService2.java index 7c47c89e4..1a57097fe 100644 --- a/src/gov/usgs/earthquake/nshmp/www/HazardService2.java +++ b/src/gov/usgs/earthquake/nshmp/www/HazardService2.java @@ -35,6 +35,7 @@ import gov.usgs.earthquake.nshmp.calc.HazardCalcs; import gov.usgs.earthquake.nshmp.calc.Site; import gov.usgs.earthquake.nshmp.calc.Vs30; import gov.usgs.earthquake.nshmp.data.MutableXySequence; +import gov.usgs.earthquake.nshmp.data.Sequences; import gov.usgs.earthquake.nshmp.data.XySequence; import gov.usgs.earthquake.nshmp.eq.model.HazardModel; import gov.usgs.earthquake.nshmp.eq.model.SourceType; @@ -308,7 +309,7 @@ public final class HazardService2 extends NshmpServlet { for (Imt imt : hazardResult.curves().keySet()) { // total curve - XySequence.addToMap(imt, totalMap, hazardResult.curves().get(imt)); + Sequences.addToMap(imt, totalMap, hazardResult.curves().get(imt)); // component curves Map<SourceType, ? extends XySequence> typeTotalMap = typeTotalMaps.get(imt); @@ -319,7 +320,7 @@ public final class HazardService2 extends NshmpServlet { } for (SourceType type : typeTotalMap.keySet()) { - XySequence.addToMap(type, componentMap, typeTotalMap.get(type)); + Sequences.addToMap(type, componentMap, typeTotalMap.get(type)); } xValuesLinearMap.put( diff --git a/src/gov/usgs/earthquake/nshmp/www/NshmpServlet.java b/src/gov/usgs/earthquake/nshmp/www/NshmpServlet.java index b33247816..78539ae47 100644 --- a/src/gov/usgs/earthquake/nshmp/www/NshmpServlet.java +++ b/src/gov/usgs/earthquake/nshmp/www/NshmpServlet.java @@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse; /** * Custom NSHMP servlet implementation and URL helper class. * - * <p>All nshmp-haz-ws services should extend this class. This class sets custom + * <p>All nshmp-haz-v2 services should extend this class. This class sets custom * response headers and provides a helper class to ensure serialized response * URLs propagate the correct host and protocol from requests on USGS servers * and caches that may have been forwarded. @@ -35,7 +35,7 @@ public abstract class NshmpServlet extends HttpServlet { /* * Set CORS headers and content type. * - * Because nshmp-haz-ws services may be called by both the USGS website, + * Because nshmp-haz-v2 services may be called by both the USGS website, * other websites, and directly by 3rd party applications, reponses * generated by direct requests will not have the necessary header * information that would be required by security protocols for web diff --git a/src/gov/usgs/earthquake/nshmp/www/SourceServices.java b/src/gov/usgs/earthquake/nshmp/www/SourceServices.java index 22dfb8ced..2aea86b93 100644 --- a/src/gov/usgs/earthquake/nshmp/www/SourceServices.java +++ b/src/gov/usgs/earthquake/nshmp/www/SourceServices.java @@ -35,7 +35,7 @@ import gov.usgs.earthquake.nshmp.www.meta.Util; /** * Entry point for services related to source models. Current services: - * <ul><li>nshmp-haz-ws/source/</li></ul> + * <ul><li>nshmp-haz-v2/source/</li></ul> * * @author Brandon Clayton * @author Peter Powers @@ -96,8 +96,8 @@ public class SourceServices extends NshmpServlet { ResponseData() { this.name = "Source Models"; this.description = "Installed source model listing"; - this.syntax = "%s://%s/nshmp-haz-ws/haz/{model}/{longitude}/{latitude}/{vs30}"; - this.deaggSyntax = "%s://%s/nshmp-haz-ws/deagg2/{model}/{longitude}/{latitude}/{imt}/{vs30}/{returnPeriod}/{basin}"; + this.syntax = "%s://%s/nshmp-haz-v2/haz/{model}/{longitude}/{latitude}/{vs30}"; + this.deaggSyntax = "%s://%s/nshmp-haz-v2/deagg2/{model}/{longitude}/{latitude}/{imt}/{vs30}/{returnPeriod}/{basin}"; this.status = Status.USAGE.toString(); this.server = serverData(ServletUtil.THREAD_COUNT, ServletUtil.timer()); this.parameters = new Parameters(); diff --git a/src/gov/usgs/earthquake/nshmp/www/UtilitiesService.java b/src/gov/usgs/earthquake/nshmp/www/UtilitiesService.java index dd9f44c26..e898ec99c 100644 --- a/src/gov/usgs/earthquake/nshmp/www/UtilitiesService.java +++ b/src/gov/usgs/earthquake/nshmp/www/UtilitiesService.java @@ -32,7 +32,7 @@ public class UtilitiesService extends NshmpServlet { throws ServletException, IOException { PrintWriter out = response.getWriter(); - String utilUrl = "/nshmp-haz-ws/apps/util.html"; + String utilUrl = "/nshmp-haz-v2/apps/util.html"; String pathInfo = request.getPathInfo(); diff --git a/src/gov/usgs/earthquake/nshmp/www/meta/Metadata.java b/src/gov/usgs/earthquake/nshmp/www/meta/Metadata.java index 2905d761c..b34b11dfa 100644 --- a/src/gov/usgs/earthquake/nshmp/www/meta/Metadata.java +++ b/src/gov/usgs/earthquake/nshmp/www/meta/Metadata.java @@ -34,7 +34,7 @@ public final class Metadata { */ private static final Set<Imt> HAZARD_IMTS = Region.WUS.imts; - private static final String URL_PREFIX = "%s://%s/nshmp-haz-ws"; + private static final String URL_PREFIX = "%s://%s/nshmp-haz-v2"; public static final String HAZARD_USAGE = ServletUtil.GSON.toJson( new Default( diff --git a/webapp/WEB-INF/web.xml b/webapp/WEB-INF/web.xml index 962b11b4e..fd1e370b1 100644 --- a/webapp/WEB-INF/web.xml +++ b/webapp/WEB-INF/web.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> - <display-name>nshmp-haz-ws</display-name> + <display-name>nshmp-haz-v2</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> diff --git a/webapp/apps/js/DynamicCompare.js b/webapp/apps/js/DynamicCompare.js index 472fb256c..f4fa09459 100644 --- a/webapp/apps/js/DynamicCompare.js +++ b/webapp/apps/js/DynamicCompare.js @@ -31,7 +31,7 @@ import Tools from './lib/Tools.js'; * - Percent difference of the response spectrum * * The class first class out to the source model webservice, - * nshmp-haz-ws/source/models, to get the usage and build the + * nshmp-haz-v2/source/models, to get the usage and build the * following menus: * - Model * - Second Model @@ -63,7 +63,7 @@ export class DynamicCompare extends Hazard { /** @param {!Config} config - The config file */ constructor(config) { let webApp = 'DynamicCompare'; - let webServiceUrl = '/nshmp-haz-ws/haz'; + let webServiceUrl = '/nshmp-haz-v2/haz'; super(webApp, webServiceUrl, config); this.header.setTitle('Dynamic Compare'); @@ -242,7 +242,7 @@ export class DynamicCompare extends Hazard { } /** - * Process usage response from nshmp-haz-ws/source/models and set menus. + * Process usage response from nshmp-haz-v2/source/models and set menus. */ buildInputs() { this.spinner.off(); @@ -1106,7 +1106,7 @@ export class DynamicCompare extends Hazard { } /** - * Given the models in nshmp-haz-ws/source/models find only models + * Given the models in nshmp-haz-v2/source/models find only models * that can be compared, ones that have that same region. */ setComparableModels() { diff --git a/webapp/apps/js/GeoDeagg.js b/webapp/apps/js/GeoDeagg.js index fffcec65a..50753627b 100644 --- a/webapp/apps/js/GeoDeagg.js +++ b/webapp/apps/js/GeoDeagg.js @@ -13,7 +13,7 @@ import Tools from './lib/Tools.js'; * @class GeoDeagg * * @fileoverview Class for the geographic deaggregation webpage, geo-deagg.html. -* The class first calls out to the deagg webservice, nshmp-haz-ws/deagg, to +* The class first calls out to the deagg webservice, nshmp-haz-v2/deagg, to * get the usage and builds the following menus: * - Edition * - Region @@ -72,7 +72,7 @@ export default class GeoDeagg { }; /** @type {String} */ - this.webServiceUrl = this.config.server.dynamic + '/nshmp-haz-ws/deagg'; + this.webServiceUrl = `${this.config.server.dynamic}/${this.config.base}/deagg`; /** @type {HTMLElement} */ this.contentEl = document.querySelector('#content'); diff --git a/webapp/apps/js/GmmDistance.js b/webapp/apps/js/GmmDistance.js index f66886149..5648f33f8 100644 --- a/webapp/apps/js/GmmDistance.js +++ b/webapp/apps/js/GmmDistance.js @@ -17,8 +17,8 @@ import Tools from './lib/Tools.js'; * * @fileoverview Class for gmm-distance..html, ground motion Vs. * distance web app. -* This class plots the results of nshmp-haz-ws/gmm/distance web service. -* This class will first call out to nshmp-haz-ws/gmm/distance web service +* This class plots the results of nshmp-haz-v2/gmm/distance web service. +* This class will first call out to nshmp-haz-v2/gmm/distance web service * to obtain the usage and create the control panel with the following: * - Ground motions models * - Intensity measure type @@ -51,7 +51,7 @@ export class GmmDistance extends Gmm { * @param {HTMLElement} contentEl - Container element to put plots */ constructor(config) { - let webServiceUrl = '/nshmp-haz-ws/gmm/distance'; + let webServiceUrl = `/${config.base}/gmm/distance`; let webApp = 'GmmDistance'; super(webApp, webServiceUrl, config); this.header.setTitle('Ground Motion Vs. Distance'); diff --git a/webapp/apps/js/HwFw.js b/webapp/apps/js/HwFw.js index 60edfe7f9..a7d8ada05 100644 --- a/webapp/apps/js/HwFw.js +++ b/webapp/apps/js/HwFw.js @@ -18,8 +18,8 @@ import NshmpError from './error/NshmpError.js'; * @extends Gmm * * @fileoverview Class for hw-fw.html, hanging wall effects web app. -* This class plots the results of nshmp-haz-ws/gmm/hw-fw web service. -* This class will first call out to nshmp-haz-ws/gmm/hw-fw web service +* This class plots the results of nshmp-haz-v2/gmm/hw-fw web service. +* This class will first call out to nshmp-haz-v2/gmm/hw-fw web service * to obtain the usage and create the control panel with the following: * - Ground motions models * - Intensity measure type @@ -48,7 +48,7 @@ export class HwFw extends Gmm { * @param {HTMLElement} contentEl - Container element to put plots */ constructor(config) { - let webServiceUrl = '/nshmp-haz-ws/gmm/hw-fw'; + let webServiceUrl = `/${config.base}/gmm/hw-fw`; let webApp = 'HwFw'; super(webApp, webServiceUrl, config); this.header.setTitle('Hanging Wall Effects'); diff --git a/webapp/apps/js/Services.js b/webapp/apps/js/Services.js index 2332da797..0996a4114 100644 --- a/webapp/apps/js/Services.js +++ b/webapp/apps/js/Services.js @@ -17,9 +17,9 @@ export default class Services { /** @type {String} */ this.urlPrefix = config.server.dynamic.trim() != '' ? - config.server.dynamic + '/nshmp-haz-ws' : + `${config.server.dynamic}/${onfig.base}` : window.location.protocol + '//' + - window.location.host + '/nshmp-haz-ws'; + `${window.location.host}/${config.base}`; /** @type {HTMLElement} */ this.servicesEl = undefined; @@ -101,7 +101,7 @@ export default class Services { svc.name = 'Deaggregation'; svc.service = 'deagg'; svc.id = 'deagg'; - svc.usage = '/nshmp-haz-ws/deagg'; + svc.usage = '/nshmp-haz-v2/deagg'; svc.description = 'Deaggregate seismic hazard.'; svc.formats = [ @@ -139,7 +139,7 @@ export default class Services { svc.name = 'Ground Motion Vs. Distance'; svc.service = 'gmm/distance'; svc.id = 'gmm-distance'; - svc.usage = '/nshmp-haz-ws/gmm/distance'; + svc.usage = '/nshmp-haz-v2/gmm/distance'; svc.description = 'Compute ground motion Vs. distance.' svc.formats = [ @@ -183,7 +183,7 @@ export default class Services { svc.name = 'Hazard'; svc.service = 'hazard'; svc.id = 'hazard'; - svc.usage = '/nshmp-haz-ws/hazard'; + svc.usage = '/nshmp-haz-v2/hazard'; svc.description = 'Compute probabilisitic seismic hazard ' + 'curves at a site of interest.'; @@ -225,7 +225,7 @@ export default class Services { svc.name = 'Hanging Wall Effect'; svc.service = 'gmm/hw-fw'; svc.id = 'hw-fw'; - svc.usage = '/nshmp-haz-ws/gmm/hw-fw'; + svc.usage = '/nshmp-haz-v2/gmm/hw-fw'; svc.description = 'Compute ground motion Vs. distance.' svc.formats = [ @@ -362,7 +362,7 @@ export default class Services { svc.name = 'Probability'; svc.service = 'probability'; svc.id = 'probability'; - svc.usage = '/nshmp-haz-ws/probability'; + svc.usage = '/nshmp-haz-v2/probability'; svc.description = 'Compute the Poisson probability of earthquake' + ' occurrence at a site of interest.'; @@ -399,7 +399,7 @@ export default class Services { svc.name = 'Rate'; svc.service = 'rate'; svc.id = 'rate'; - svc.usage = '/nshmp-haz-ws/rate'; + svc.usage = '/nshmp-haz-v2/rate'; svc.description = 'Compute the annual rate of earthquakes at a site' + ' of interest.'; @@ -458,7 +458,7 @@ export default class Services { svc.name = 'Response Spectra'; svc.service = 'gmm/spectra'; svc.id = 'spectra'; - svc.usage = '/nshmp-haz-ws/gmm/spectra'; + svc.usage = '/nshmp-haz-v2/gmm/spectra'; svc.description = 'Compute determinisitic reponse spectra.' svc.formats = [ diff --git a/webapp/apps/js/Spectra.js b/webapp/apps/js/Spectra.js index 4be24c98c..1f6a68673 100644 --- a/webapp/apps/js/Spectra.js +++ b/webapp/apps/js/Spectra.js @@ -14,8 +14,8 @@ import { Preconditions } from './error/Preconditions.js'; /** * @fileoverview Class for spectra-plot.html, response spectra web app. - * This class plots the results of nshmp-haz-ws/gmm/spectra web service. - * This class will first call out to nshmp-haz-ws/gmm/spectra web service + * This class plots the results of nshmp-haz-v2/gmm/spectra web service. + * This class will first call out to nshmp-haz-v2/gmm/spectra web service * to obtain the usage and create the control panel with the following: * - Ground motions models * - Magnitude @@ -43,7 +43,8 @@ export class Spectra extends GmmBeta { constructor(config) { let webApp = 'Spectra'; - let wsUrl = '/nshmp-haz-ws/gmm/spectra' + console.log(config); + let wsUrl = `/${config.base}/gmm/spectra`; super(webApp, wsUrl, config); diff --git a/webapp/apps/js/Util.js b/webapp/apps/js/Util.js index 8b837198e..76e5935b9 100644 --- a/webapp/apps/js/Util.js +++ b/webapp/apps/js/Util.js @@ -13,7 +13,7 @@ export default class Util{ _this.header.setTitle("Utilities"); var urlPrefix = window.location.protocol - + "//" + window.location.host + "/nshmp-haz-ws"; + + "//" + window.location.host + "/nshmp-haz-v2"; $(".serviceLink").each(function() { var serviceUrl = urlPrefix + $(this).text(); diff --git a/webapp/apps/js/lib/Config.js b/webapp/apps/js/lib/Config.js index 3dee39453..c8bc54bb9 100644 --- a/webapp/apps/js/lib/Config.js +++ b/webapp/apps/js/lib/Config.js @@ -5,11 +5,11 @@ import NshmpError from '../error/NshmpError.js'; /** * @fileoverview Static method to read two possible config files: -* 1. /nshmp-haz-ws/apps/js/lib/config.json -* 2. /nshmp-haz-ws/config.json -* The first config file, /nshmp-haz-ws/apps/config.json, is +* 1. /nshmp-haz-v2/apps/js/lib/config.json +* 2. /nshmp-haz-v2/config.json +* The first config file, /nshmp-haz-v2/apps/config.json, is * the default config file and remains in the repository. -* The second config file, /nshmp-haz-ws/config.js, is ignored by github and +* The second config file, /nshmp-haz-v2/config.js, is ignored by github and * is for developmental purposes. If this file exists it will be read in * and merged with the default, overriding any keys present in the first * config file. @@ -25,8 +25,10 @@ export default class Config { * new callback(config) will be called. */ static getConfig(callback) { - let mainConfigUrl = '/nshmp-haz-ws/apps/config.json'; - let overrideConfigUrl = '/nshmp-haz-ws/config.json'; + const base = 'nshmp-haz-v2'; + + let mainConfigUrl = `/${base}/apps/config.json`; + let overrideConfigUrl = `/${base}/config.json`; let jsonCall = Tools.getJSONs([mainConfigUrl, overrideConfigUrl]); @@ -35,14 +37,16 @@ export default class Config { let overrideConfig = responses[1]; let config = $.extend({}, mainConfig, overrideConfig); + config.base = base; new callback(config); }).catch((errorMessage) => { - if (errorMessage != 'Could not reach: /nshmp-haz-ws/config.json') return; + if (errorMessage != 'Could not reach: /nshmp-haz-v2/config.json') return; console.clear(); jsonCall.promises[0].then((config) => { + config.base = base; new callback(config); }).catch((errorMessage) => { - if (errorMessage != 'Could not reach: /nshmp-haz-ws/apps/config.json') return; + if (errorMessage != `Could not reach: /${base}/apps/config.json`) return; NshmpError.throwError(errorMessage); }); }); diff --git a/webapp/apps/js/lib/D3GeoDeagg.js b/webapp/apps/js/lib/D3GeoDeagg.js index 48be52cdb..51c2c0d87 100644 --- a/webapp/apps/js/lib/D3GeoDeagg.js +++ b/webapp/apps/js/lib/D3GeoDeagg.js @@ -119,9 +119,9 @@ export default class D3GeoDeagg extends D3View { this.upperPanel = this.updatePlotPanelObject(this.upperPanel); /** @type {String} */ - this.mapBorderUrl = '/nshmp-haz-ws/data/us.json'; + this.mapBorderUrl = '/nshmp-haz-v2/data/us.json'; /** @type {String */ - this.mapUrl = '/nshmp-haz-ws/data/americas.json'; + this.mapUrl = '/nshmp-haz-v2/data/americas.json'; let defaultView = this.options.defaultView == 'closeUp' ? this.options.mapCloseUp : this.options.mapOverview; diff --git a/webapp/apps/js/lib/Footer.js b/webapp/apps/js/lib/Footer.js index 1bfb3886d..9c4f8ec9f 100644 --- a/webapp/apps/js/lib/Footer.js +++ b/webapp/apps/js/lib/Footer.js @@ -29,7 +29,7 @@ import { WebServiceResponse } from '../response/WebServiceResponse.js'; * @property {{ * url: {String}, * version: {String}, -* }} nshmp-haz-ws - nshmp-haz-ws info. +* }} nshmp-haz-v2 - nshmp-haz-v2 info. * @poperty {Number} threads - Number of threads used. * @property {String} servlet. * @property {String} calc - Calculation time. @@ -95,7 +95,7 @@ export default class Footer{ .attr('title', 'Submit a GitHub issue') .attr('alt', 'Submit a GitHub issue') .attr('data-toggle', 'tooltip') - .attr('src', '/nshmp-haz-ws/apps/img/github.svg'); + .attr('src', '/nshmp-haz-v2/apps/img/github.svg'); // Add collapsable div for metadata footerD3.append('div') @@ -240,7 +240,7 @@ export default class Footer{ let codeInfo = [ ['nshmp-haz version: ' + server['nshmp-haz'].version], - ['nshmp-haz-ws version: ' + server['nshmp-haz-ws'].version], + ['nshmp-haz-v2 version: ' + server['nshmp-haz-ws'].version], ['Cores used: ' + server['threads']], ]; @@ -253,7 +253,7 @@ export default class Footer{ } /** - * Set the collapsable panel with the nshmp-haz and nshmp-haz-ws + * Set the collapsable panel with the nshmp-haz and nshmp-haz-v2 * version numbers. * * @param {WebServiceResponse} response The web service response diff --git a/webapp/apps/js/lib/Gmm.js b/webapp/apps/js/lib/Gmm.js index a8335878f..1c0ced8ad 100644 --- a/webapp/apps/js/lib/Gmm.js +++ b/webapp/apps/js/lib/Gmm.js @@ -40,8 +40,8 @@ export class Gmm { * @param {!String} webApp Identifier of the application being used. * Possible values: GmmDistance, HwFW, or Spectra * @param {!String} wsUrl URL to corresponding web service. - * Possible values: /nshmp-haz-ws/gmm/distance, - * /nshmp-haz-ws/gmm/hw-fw, /nshmp-haz-ws/gmm/spectra + * Possible values: /nshmp-haz-v2/gmm/distance, + * /nshmp-haz-v2/gmm/hw-fw, /nshmp-haz-v2/gmm/spectra */ constructor(webApp, webServiceUrl, config) { /** @type {Footer} */ diff --git a/webapp/apps/js/lib/GmmBeta.js b/webapp/apps/js/lib/GmmBeta.js index 1691c4607..527dce567 100644 --- a/webapp/apps/js/lib/GmmBeta.js +++ b/webapp/apps/js/lib/GmmBeta.js @@ -31,8 +31,8 @@ export class GmmBeta { * @param {!String} webApp Identifier of the application being used. * Possible values: GmmDistance, HwFW, or Spectra * @param {!String} wsUrl URL to corresponding web service. - * Possible values: /nshmp-haz-ws/gmm/distance, - * /nshmp-haz-ws/gmm/hw-fw, /nshmp-haz-ws/gmm/spectra + * Possible values: /nshmp-haz-v2/gmm/distance, + * /nshmp-haz-v2/gmm/hw-fw, /nshmp-haz-v2/gmm/spectra */ constructor(webApp, webServiceUrl, config) { /** @type {Footer} */ diff --git a/webapp/apps/js/lib/Hazard.js b/webapp/apps/js/lib/Hazard.js index 193f2381d..5b26a4fb0 100644 --- a/webapp/apps/js/lib/Hazard.js +++ b/webapp/apps/js/lib/Hazard.js @@ -59,7 +59,7 @@ export class Hazard { this.footer.setOptions(this.footerOptions); }); - this.dynamicUrl = this.config.server.dynamic + "/nshmp-haz-ws/hazard"; + this.dynamicUrl = `${this.config.server.dynamic}/${this.config.base}/hazard`; this.staticUrl = this.config.server.static + "/hazws/staticcurve/1"; this.testSitePickerBtnEl = document.querySelector('#test-site-picker'); @@ -209,7 +209,7 @@ export class Hazard { - This function is used for model-compare and model-explorer Format of Dynamic URL: - https://earthquake.usgs.gov/nshmp-haz-ws/hazard? + https://earthquake.usgs.gov/nshmp-haz-v2/hazard? edition=value®ion=value&longitude=value &latitude=value&imt=value&vs30=value diff --git a/webapp/apps/js/lib/HazardNew.js b/webapp/apps/js/lib/HazardNew.js index 991026cc6..34134fbc4 100644 --- a/webapp/apps/js/lib/HazardNew.js +++ b/webapp/apps/js/lib/HazardNew.js @@ -30,7 +30,7 @@ export class Hazard { * @param {String} webApp - Identifier of the application being used. * Possible values: 'DynamicCompare', 'ModelComparison', 'ModelExplorer'. * @param {String} webServiceUrl - URK to corresponding web servce. - * Possible values: '/nshmp-haz-ws/hazard', '/nshmp-haz-ws/source/models' + * Possible values: '/nshmp-haz-v2/hazard', '/nshmp-haz-v2/source/models' * @param {Config} config - The config file. */ constructor(webApp, webServiceUrl, config) { @@ -94,7 +94,7 @@ export class Hazard { }; /** @type {String} */ - this.dynamicUrl = this.config.server.dynamic + '/nshmp-haz-ws/haz'; + this.dynamicUrl = `${this.config.server.dynamic}/${this.config.base}/haz`; /** @type {String} */ this.staticUrl = this.config.server.static + '/hazws/staticcurve/1'; diff --git a/webapp/apps/js/lib/Header.js b/webapp/apps/js/lib/Header.js index 7180a2afd..475c701d0 100644 --- a/webapp/apps/js/lib/Header.js +++ b/webapp/apps/js/lib/Header.js @@ -3,7 +3,7 @@ /** * @class Header * -* @fileoverview Creates the header to be used for all nshmp-haz-ws webapps. +* @fileoverview Creates the header to be used for all nshmp-haz-v2 webapps. * * @typedef {Object} HeaderOptions - Object for header options * @property {String} position - CSS positions: fixed || absolute @@ -21,7 +21,7 @@ export default class Header{ * to put the header. Default is body. */ constructor(containerEl = document.querySelector('body')) { - document.title = "NSHMP-HAZ-WS"; + document.title = "nshmp-haz-v2"; /** @type {HeaderOptions} */ this.options = { @@ -32,34 +32,34 @@ export default class Header{ this.menuItems = [ { label: 'Dashboard', - href: '/nshmp-haz-ws/', + href: '/nshmp-haz-v2/', }, { label: 'Dynamic Comparison', - href: '/nshmp-haz-ws/apps/dynamic-compare.html', + href: '/nshmp-haz-v2/apps/dynamic-compare.html', }, { label: 'Geographic Deaggregation', - href: '/nshmp-haz-ws/apps/geo-deagg.html', + href: '/nshmp-haz-v2/apps/geo-deagg.html', }, { label: 'Ground Motion Vs. Distance', - href: '/nshmp-haz-ws/apps/gmm-distance.html', + href: '/nshmp-haz-v2/apps/gmm-distance.html', }, { label: 'Hanging Wall Effects', - href: '/nshmp-haz-ws/apps/hw-fw.html', + href: '/nshmp-haz-v2/apps/hw-fw.html', }, { label: 'Model Compare', - href: '/nshmp-haz-ws/apps/model-compare.html', + href: '/nshmp-haz-v2/apps/model-compare.html', }, { label: 'Model Explorer', - href: '/nshmp-haz-ws/apps/model-explorer.html', + href: '/nshmp-haz-v2/apps/model-explorer.html', }, { label: 'Response Spectra', - href: '/nshmp-haz-ws/apps/spectra-plot.html', + href: '/nshmp-haz-v2/apps/spectra-plot.html', }, { label: 'Exceedance Explorer', - href: '/nshmp-haz-ws/apps/exceedance-explorer.html' + href: '/nshmp-haz-v2/apps/exceedance-explorer.html' }, { label: 'Services', - href: '/nshmp-haz-ws/apps/services.html', + href: '/nshmp-haz-v2/apps/services.html', } ]; diff --git a/webapp/apps/js/lib/LeafletTestSitePicker.js b/webapp/apps/js/lib/LeafletTestSitePicker.js index 16dc7a507..6c4f053c2 100644 --- a/webapp/apps/js/lib/LeafletTestSitePicker.js +++ b/webapp/apps/js/lib/LeafletTestSitePicker.js @@ -284,7 +284,7 @@ export default class LeafletTestSitePciker extends TestSiteView { /** * @method getUsage * - * Get the test sites from /nshmp-haz-ws/util/testsites. + * Get the test sites from /nshmp-haz-v2/util/testsites. * Update the activationBtnEl to be clickable. * Trigger the custom event on('testSiteLoad'). */ diff --git a/webapp/apps/js/lib/TestSiteView.js b/webapp/apps/js/lib/TestSiteView.js index 711eef02a..a9e738aeb 100644 --- a/webapp/apps/js/lib/TestSiteView.js +++ b/webapp/apps/js/lib/TestSiteView.js @@ -19,7 +19,7 @@ export default class TestSiteView { */ constructor(latEl, lonEl, activationBtnEl) { /** @type {String} */ - this.webServiceUrl = '/nshmp-haz-ws/util/testsites'; + this.webServiceUrl = '/nshmp-haz-v2/util/testsites'; /** @type {Object} */ this.viewOptions = { diff --git a/webapp/apps/js/response/WebServiceResponse.js b/webapp/apps/js/response/WebServiceResponse.js index 6c6a49ab0..6bed99280 100644 --- a/webapp/apps/js/response/WebServiceResponse.js +++ b/webapp/apps/js/response/WebServiceResponse.js @@ -13,7 +13,7 @@ export class WebServiceResponse { /** * Create new WebServiceResponse given the JSON return from a - * nshmp-haz-ws call. + * nshmp-haz-v2 call. * * @param {Object} response The JSON response from web service call */ diff --git a/webapp/etc/examples/Dashboard.js b/webapp/etc/examples/Dashboard.js index 1d03a19c7..5d34d45b0 100644 --- a/webapp/etc/examples/Dashboard.js +++ b/webapp/etc/examples/Dashboard.js @@ -39,13 +39,13 @@ export class Dashboard { let menuItems = [ { label: 'Dashboard', - href: '/nshmp-haz-ws/etc/examples', + href: '/nshmp-haz-v2/etc/examples', }, { label: 'D3 Basic Line Plot', - href: '/nshmp-haz-ws/etc/examples/d3/d3-basic-line-plot.html', + href: '/nshmp-haz-v2/etc/examples/d3/d3-basic-line-plot.html', }, { label: 'D3 Custom Line Plot', - href: '/nshmp-haz-ws/etc/examples/d3/d3-custom-line-plot.html', + href: '/nshmp-haz-v2/etc/examples/d3/d3-custom-line-plot.html', }, ]; -- GitLab