Skip to content

Configure geoportal for a disconnected environment

Marten edited this page Dec 18, 2022 · 10 revisions

To configure Geoportal to work in a disconnected environment

This page describes steps to configure geoportal server catalog for use in a disconnected environment.

For instruction about configuring geoportal server harvester for disconnected environment, please visit Geoportal Harvester installation Wiki.

Prerequisites

  • Install a local web server to host external resources normally available online.

  • Setup a local ArcGIS Enterprise (including a ArcGIS Server and Portal for ArcGIS) instance. Geoportal has been verified to work with version 10.9.1.

    • Publish a ArcGIS Server service to be used as basemap

    • Configure Portal for ArcGIS to use the locally published basemap as default.

    • Look up the following parameters required for the configuration. This information can be retrieved via the ArcGIS Services Directory https://servername:6443/arcgis/rest/services

      • URL to the basemap service
      • Service Item ID of the published basemap service
      • Map type (tiled or dynamic) of the published basemap service
  • Install a Tomcat server and deploy Geoportal as described in Installing Geoportal Server

  • Make sure the CA certificate that has generated the server certificate for ArcGIS Server and Portal is added to the truststore you configure Tomcat to use. See https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html for more information.

To avoid configuration issues, make sure that the web server, ArcGIS and Tomcat all use the same access method, i.e. http or https (preferred).

Note: The example configuration is installed on a Windows machine with IIS listening to https on the default port 443. Geoportal runs in Tomcat listening to https on port 8443. ArcGIS Server and ArcGIS Portal is provided via IIS using ArcGIS WebAdaptor (and use the default native https ports 6443 and 7443).

Setup a local version of ArcGIS JavaScript API (JSAPI)

  • Please visit https://developers.arcgis.com/javascript/3/jshelp/intro_accessapi.html for more information about the JSAPI, and download and installation instructions. The supported version 3.36.

  • Ensure the init.js is set as the default file for the virtual directory for the JSAPI.

    • For IIS, the instructions are available online via Microsoft. The path to your init.js should look something like this C:\inetpub\wwwroot\arcgis_js_api\library\3.36\3.36\init.js
  • Make sure to configure CORS using Access-Control-Allow-Origin if you are running JSAPI on another web server than the one running Geoportal.

    If you are hosting the files using IIS you can create the file web.config in the root of the hosted directory with the following content.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <httpProtocol>
                <customHeaders>
                    <add name="Access-Control-Allow-Origin" value="*" />
                </customHeaders>
            </httpProtocol>
        </system.webServer>
    </configuration>
  • Verify that JSAPI is accessible as https://servername/arcgis_js_api/library/3.36/3.36/

Use locally hosted XML schemas and other resources

Geoportal uses Spring Framework and some other resources, you will need to download the Spring Framework XSDs and host them locally

Configure Elasticsearch

Elasticsearch introduced a processor called GeoIP. The GeoIP processor adds information about the geographical location of an IPv4 or IPv6 address.

Geoportal Server does not use or rely on GeoIP. GeoIP is enabled by default. It downloads a database of IP addresses and locations on a regular basis. In a disconnected environment you can manage your own GeoIP database per elastic documentation, or you can disable GeoIP. To disable GeoIP, you can use the elastic API with these requests:

Enable:

PUT _cluster/settings
{
    "persistent": {
       "ingest.geoip.downloader.enabled": true
    }
}

Disable:

PUT _cluster/settings
{
    "persistent": {
       "ingest.geoip.downloader.enabled": false
    }
}

Configure Geoportal

  • Update ...\webapps\geoportal\app\context\AppContext.js

    • Get the latest AppContext.js from github and copy it to ...\webapps\geoportal\app\context\
    • Modify the line this.appConfig.searchMap.basemap = "geoportalCustom"; and replace "geoportalCustom" with the name of your locally hosted basemap service
  • Update ...\webapps\geoportal\app\context\app-config.js

    • Update value for "searchmap" to a local ArcGIS map service url, for example change from:

      searchMap: {
        basemap: "streets",
        autoResize: true, 
        wrapAround180: true,
        center: [-98, 40], 
        zoom: 3
      },

      to something like this:

      searchMap: {
        isTiled: false,
        autoResize: true,
        basemapUrl: "https://servername:6443/arcgis/rest/services/SampleWorldCities/MapServer",
        autoResize: true
       },

      Note that the isTiled value must match the type of basemap used. In the current version ONLY tiled basemap services are supported. If a dynamic map is required, please see https://github.com/Esri/geoportal-server-catalog/pull/452 for code changes required.

  • Update ...\webapps\geoportal\index.html

    • Replace url to JSAPI with url for the local instance, for example: https://servername/arcgis_js_api/library/3.36/3.36/ and the same for the downloaded locally hosted c3.min.js I.e. replace links like these :

      ...
      <link rel="stylesheet" href="//js.arcgis.com/3.36/esri/themes/calcite/dijit/calcite.css">
      <link rel="stylesheet" href="//js.arcgis.com/3.36/esri/themes/calcite/esri/esri.css">
      <link rel="stylesheet" href="//js.arcgis.com/3.36/esri/dijit/metadata/css/gxe.css"/>
      <link rel="stylesheet" href="//js.arcgis.com/3.36/esri/dijit/metadata/css/gxe-calcite.css"/>
      ...
      <script src="//cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.js"></script>
      ...
      <script src="//js.arcgis.com/3.36/"></script>
      ...

      to:

      ...
      <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/themes/calcite/dijit/calcite.css">
      <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/themes/calcite/esri/esri.css">
      <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/dijit/metadata/css/gxe.css"/>
      <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/dijit/metadata/css/gxe-calcite.css"/>
      ...
      <script src="https://servername/c3.min.js"></script>
      ...
      <script src="//servername/arcgis_js_api/library/3.36/3.36/"></script>
      ...
  • Update ...\webapps\geoportal\app\preview\PreviewUtil.js

    • Replace url for geometry service and generate preview features

      from:

      var _gs = new GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
      ...
      url: "http://www.arcgis.com/sharing/rest/content/features/generate",

      to something like:

      var _gs = new GeometryService("https://servername/arcgis/rest/services/Geometry/GeometryServer");
      ...
      url: "https://servername/portal/sharing/rest/content/features/generate",

Configure the metadata editor for disconnected use

  • Edit ...\webapps\geoportal\standalone-metadata-editor.html

  • Replace //esri.github.io/calcite-bootstrap/assets/css/ with ./lib/calcite-bootstrap/css/

  • Update the URL:s related to JSAPI version from:

    <link rel="stylesheet" href="//esri.github.io/calcite-bootstrap/assets/css/calcite-bootstrap.css">
    <link rel="stylesheet" href="//js.arcgis.com/3.19/esri/themes/calcite/dijit/calcite.css">
    <link rel="stylesheet" href="//js.arcgis.com/3.19/esri/themes/calcite/esri/esri.css">
    <link rel="stylesheet" href="//js.arcgis.com/3.19/esri/dijit/metadata/css/gxe.css"/>
    <link rel="stylesheet" href="//js.arcgis.com/3.19/esri/dijit/metadata/css/gxe-calcite.css"/>
    <script src="//js.arcgis.com/3.19"></script>

    to:

    <link rel="stylesheet" href="./lib/calcite-bootstrap/css/calcite-bootstrap.css">
    <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/themes/calcite/dijit/calcite.css">
    <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/themes/calcite/esri/esri.css">
    <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/dijit/metadata/css/gxe.css"/>
    <link rel="stylesheet" href="//servername/arcgis_js_api/library/3.36/3.36/esri/dijit/metadata/css/gxe-calcite.css"/>
    <script src="//servername/arcgis_js_api/library/3.36/3.36"></script>

Configure Geoportal Map Viewer for disconnected environment (in progress)

  • Update ...\webapps\geoportal\viewer\env.js, replace ArcGIS JSAPI url with url for the local instance. Note that there are various formats for the online links that need to be changed

    i.e. change values

    var apiVersion = '3.25';
    ...
    apiUrl = 'https://js.arcgis.com/3.25';
    ...
    apiUrl = 'https://js.arcgis.com/' + apiVersion;

    to:

    var apiVersion = '3.36';
    ...
    apiUrl = 'https://servername/arcgis_js_api/library/3.36/3.36/';
    ...
    apiUrl = 'https://servername/arcgis_js_api/library/3.36/3.36/';
  • Update ...\webapps\geoportal\viewer\config.json as described below based on local instance values.

    • Change the parameter "portalUrl" to point to the root of your local ArcGIS Portal instance
    • Change the parameter "map.portalUrl" to point to the root of your local ArcGIS Portal instance
    • Replace value for "map.itemId" to use the selected basemap service id (as listed as "Service Item Id" for the map service in the ArcGIS Service Directory)
    • Change the parameter "geometryService" to point to a Geometry service locally published by ArcGIS Server, like the default Utilities/Geometry
    • Change the parameter "httpProxy.url" setting to "https://servername:8443/geoportal/viewer/proxy.jsp" (or whatever port your Tomcat running Geoportal is using)
    • Change the parameter "useProxy" to "true"

    I.e. to something like this:

     "httpProxy": {
        "useProxy": true,
        "alwaysUseProxy": false,
        "url": "https://servername:8443/geoportal/viewer/proxy.jsp",
        "rules": []
     },
     "geometryService":  "https://servername:6443/arcgis/rest/services/Utilities/Geometry/GeometryServer",
     "map": {
        "3D": false,
        "2D": true,
        "position": {
           "left": 0,
           "top": 0,
           "right": 0,
           "bottom": 0
        },
        "itemId": "b72acc098c814d34b392b6c5a783c530",
        "mapOptions": {
           "extent": {
              "xmin": -18000000,
              "ymin": -12000000,
              "xmax": 18000000,
              "ymax": 16000000,
              "spatialReference": {
                 "wkid": 102100
              }
           }
        },
        "id": "map",
        "portalUrl": "https://servername/portal"
     },
     "portalUrl": "https://servername/portal"
  • Update ...\webapps\geoportal\viewer\configs\GeoportalSearch\config.json, replace the ArcGIS Online catalog definition

      {
        "name": "ArcGIS Online",
        "url": "https://www.arcgis.com",
        "type": "portal",
        "profile": null,
        "requiredFilter": null,
        "enabled": true,
        "useProxy": false,
        "disableContentType": false
      }

with something like:

   {
     "name": "ArcGIS Portal",
     "url": "https://servername/portal",
     "type": "portal",
     "profile": null,
     "requiredFilter": null,
     "enabled": true,
     "useProxy": false,
     "disableContentType": false
   }
Clone this wiki locally