1.5 Administering the Map Visualization Component

This topic introduces the map visualization component Administration page and some administrative and configuration tasks that you can perform, such as adding new data sources, managing map tile layers used by Oracle Maps, and setting logging levels.

1.5.1 Logging in to the Map Visualization Component Administration Page

After you have verified that the map visualization component is running properly, it is suggested that you log in to the map visualization component Administration page. To do this, go first to the map visualization component Welcome page, which is typically http://<host>:<port>/mapviewer, where <host> and <port> should be replaced by the correct value for your installation.

Click the Admin link at the top right to display the map visualization component Administration page.

You can use this administration page to perform administrative tasks, such as clearing cached data, creating tile layers, managing tile layers, and restarting the server (use the Monitoring link to restart).

1.5.2 Configuring the Map Visualization Component

If the default configuration settings for running the map visualization component are not adequate, you can configure the map visualization component by editing the visualization component configuration file, mapViewerConfig.xml, which is located in the $MAPVIEWER_HOME/WEB-INF/conf directory. To modify this file, you can use a text editor, or you can use the map visualization component Administration page.

After you modify this file, you must restart the container to have the changes take effect; however, you can instead use the map visualization component Administration page to restart only the map visualization component servlet (instead of the entire Java EE instance, which may have other applications deployed and running) if you installed the map visualization component with a standalone Glassfish instance.

The map visualization component configuration file defines the following information in XML format:

  • Logging information, defined either through container-controlled logging (recommended) or in the <logging> element (see Specifying Logging Information)

  • Map image file information, defined in the <save_images_at> element (see Specifying Map File Storage and Life Cycle Information)

  • Web proxy information for accessing external information across a firewall, defined in the <web_proxy> element (see Specifying a Web Proxy)

  • Global map "look and feel" configuration, defined in the <global_map_config> element (see Specifying Global Map Configuration Options)

  • Internal spatial data cache settings, defined in the <spatial_data_cache> element (see Customizing the Spatial Data Cache)

  • Permanent map data sources, defined in the <map_data_source> element (see Defining Permanent Map Data Sources)

  • Security configurations, defined in the <security_config> element

  • WMS services configurations, defined in the <wms_config> element

  • External attribute data provider registration, defined in <ns_data_provider> elements

  • Map tile server configurations, defined in the <map_tile_server> element

  • UTF grid lifecycle parameters, defined in the <utfgrid_life_cycle> element

  • External spatial data provider registration, defined in the <s_data_provider> element

  • Map data sources, defined in the <map_data_source> element

  • Map data server stream parameters, defined in the <mds_config> element

  • OAM logout parameters, defined in the <oam_logout> element

All path names in the mapViewerConfig.xml file are relative to the directory in which the file is stored, unless otherwise specified.

Example 1-1 Sample Map Visualization Component Configuration File

Example 1-1 shows a sample mapViewerConfig.xml file.

<?xml version="1.0" ?>
<!-- This is the configuration file for the map visualization component. -->
<!-- Note: All paths are resolved relative to this directory (where 
           this config file is located), unless specified as an absolute 
           path name.
 -->
 
<MapperConfig>
 
  <!-- ****************************************************************** -->
  <!-- ************************ Logging Settings ************************ -->
  <!-- ****************************************************************** -->
 
  <!-- Uncomment the following to modify logging. Possible values are:
       log_level = "fatal"|"error"|"warn"|"info"|"debug"|"finest"  
                 default: info) ;
       log_thread_name = "true" | "false" ;
       log_time = "true" | "false" ;
       one or more log_output elements.
  -->
  <!--
    <logging log_level="info" log_thread_name="false"
             log_time="true">
       <log_output name="System.err" />
       <log_output name="../log/mapviewer.log" />
    </logging>
  -->
 
  <!-- ****************************************************************** -->
  <!-- ********************** Map Image Settings ************************ -->
  <!-- ****************************************************************** -->
 
  <!-- Uncomment the following only if you want generated images to 
       be stored in a different directory, or if you want to customize
       the life cycle of generated image files.
 
       By default, all maps are generated under 
       $ORACLE_HOME/lbs/mapviewer/web/images. 
 
       Images location-related attributes:
       file_prefix: image file prefix, default value is "omsmap"
       url:  the URL at which images can be accessed. It must match the 'path'
             attribute below. Its default value is "%HOST_URL%/mapviewer/images"
       path: the corresponding path in the server where the images are
             saved; default value is "%ORACLE_HOME%/lbs/mapviewer/web/images"
 
       Images life cycle-related attributes:
       life: the life period of generated images, specified in minutes. 
             If not specified or if the value is 0, images saved on disk will 
             never be deleted. 
       recycle_interval:  this attribute specifies how often the recycling 
             of generated map images will be performed. The unit is minute.
             The default interval (when not specified or if the value is 0) 
             is 8*60, or 8 hours.
             
   -->
  <!--
   <save_images_at  file_prefix="omsmap"
                   url="http://mypc.mycorp.com:8888/mapviewer/images"
                   path="../web/images"
   /> 
  -->
 
  <!-- ****************************************************************** -->
  <!-- ********************* IP Monitoring Settings ********************* -->
  <!-- ****************************************************************** -->
 
  <!-- Uncomment the following to enable IP filtering for administrative 
        requests.
    Note:
    - Use <ips> and <ip_range> to specify which IPs (and ranges) are allowed.
      Wildcard form such as 20.* is also accepted. Use a comma-delimited 
      list in <ips>.
 
    - Use <ips_exclude> and <ip_range_exclude> for IPs and IP ranges
      prohibited from accessing eLocation.
 
    - If an IP falls into both "allowed" and "prohibited" categories, it is
      prohibited.
 
    - If you put  "*" in an <ips> element, then all IPs are allowed, except
      those specified in <ips_exclude> and <ip_range_exclude>.
      On the other hand, if you put "*" in an <ips_exclude> element, no one
      will be able to access the map visualization component (regardless of whether an IP is in
      <ips> or <ip_range>).
 
    - You can have multiple <ips>, <ip_range>, <ips_exclude>, and
      <ip_range_exclude> elements under <ip_monitor>.
 
    - If no <ip_monitor> element is present in the XML configuration
      file, then no IP filtering will be performed (all allowed).
 
    - The way the map visualization component determines if an IP is allowed is:
 
          if(IP filtering is not enabled) then allow;
          if(IP is in exclude-list) then not allow;
          else if(IP is in allow-list) then allow;
          else not allow;  
   -->
 
  <!--
     <ip_monitor>
          <ips> 138.1.17.9, 138.1.17.21, 138.3.*, 20.* </ips>
          <ip_range> 24.17.1.3 - 24.17.1.20 </ip_range>
          <ips_exclude> 138.3.29.* </ips_exclude>
          <ip_range_exclude>20.22.34.1 - 20.22.34.255</ip_range_exclude>
     </ip_monitor>
   -->
 
  <!-- ****************************************************************** -->
  <!-- ********************** Web Proxy Setting  ************************ -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and modify the following to specify the web proxy setting.
       This is only needed for passing background image URLs to
       the map visualization component in map requests or for setting a logo image URL, if
       such URLs cannot be accessed without the proxy.
   -->
 
  <!--
    <web_proxy host="www-proxy.my_corp.com"  port="80" />
  -->
 
  <!-- ****************************************************************** -->
  <!-- *********************** Security Configuration ******************* -->
  <!-- ****************************************************************** -->
  <!-- Here you can set various security related configurations of the map visualization component.
  -->
 
  <security_config>
    <disable_direct_info_request> false </disable_direct_info_request>
  </security_config>
 
  <!-- ****************************************************************** -->
  <!-- *********************** Global Map Configuration ***************** -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and modify the following to specify systemwide parameters
       for generated maps. You can specify your copyright note, map title, and
       an image to be used as a custom logo shown on maps. The logo image must 
       be accessible to this map visualization component and in either GIF or JPEG format.
       Notes:
         -  To disable a global note or title, specify an empty string ("") for
            the text attribute of <note> and <title> element.
         - position specifies a relative position on the map where the
                  logo, note, or title  will be displayed. Possible values are
                  NORTH, EAST, SOUTH, WEST, NORTH_EAST, SOUTH_EAST,
                  SOUTH_WEST, NORTH_WEST, and CENTER.
         - image_path specifies a file path or a URL (starts with "http://")
                    for the image.
 
       <rendering> element attributes:
       - Local geodetic data adjustment: If allow_local_adjustment="true",
         The map visualization component automatically performs local data
         "flattening" with geodetic data if the data window is less than
         3 decimal degrees. Specifically, the map visualization component performs a simple
         mathematical transformation of the coordinates using a tangential
         plane at the current map request center.
         If allow_local_adjustment="false" (default), no adjustment is
         performed.
       - Automatically applies a globular map projection (geodetic data only): 
         If use_globular_projection="true", The map visualization component will 
         apply a globular projection on the fly to geometries being displayed. 
         If use_globular_projection="false" (the default), The map visualization component does no map 
         projection to geodetic geometries. This option has no effect on 
         non-geodetic data.
   -->
 
  <!--
    <global_map_config>
        <note text="Copyright 2009, Oracle Corporation" 
              font="sans serif" 
              position="SOUTH_EAST"/>
        <title  text="MapViewer Demo" 
                font="Serif"
                position="NORTH" />
        <logo image_path="C:\\images\\a.gif"  
              position="SOUTH_WEST" />
 
        <rendering allow_local_adjustment="false" 
                   use_globular_projection="false" />
    </global_map_config>
  -->
 
  <!-- ****************************************************************** -->
  <!-- ****************** Spatial Data Cache Setting  ******************* -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and modify the following to customize the spatial data cache
       used by the map visualization component. The default is 64 MB for in-memory cache.
 
       To disable the cache, set max_cache_size to 0.
 
       max_cache_size:  Maximum size of in-memory spatial cache of the map visualization component.
                        Size must be specified in megabytes (MB).
       report_stats:    If you would like to see periodic output of cache
                        statistics, set this attribute to true. The default
                        is false.
   -->
 
  <!--
    <spatial_data_cache   max_cache_size="64"
                          report_stats="false" 
    />
  -->
 
  <!-- ****************************************************************** -->
  <!-- ****************** Custom WMS Capabilities Info ****************** -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and modify the following tag if you want the map visualization component to
       use the following information in its getCapabilities response.
       Note: all attributes and elements of <wms_config> are optional.
  -->
  <!--
  <wms_config host="www.my_corp.com" port="80">
    <title>
        WMS 1.1 interface for Oracle Map visualization component
    </title>
    <abstract>
        This WMS service is provided through the map visualization component.
    </abstract>
    <keyword_list>
       <keyword>bird</keyword>
       <keyword>roadrunner</keyword>
       <keyword>ambush</keyword>
    </keyword_list>    
    <sdo_epsg_mapfile>
      ../config/epsg_srids.properties
    </sdo_epsg_mapfile>
  </wms_config>
  -->
 
  <!-- ****************************************************************** -->
  <!-- **************** Custom Non-Spatial Data Provider **************** -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and add as many custom non-spatial data provider as
       needed here, each in its own <ns_data_provider> element.
       You must provide the id and full class name here. Optionally you
       can also specify any number of global parameters, which the map visualization component
       will pass to the data provider implementation during initialization. 
       The name and value of each parameter is interpreted only by the 
       implementation.
  -->
 
  <!-- this is the default data provider that comes with the map visualization component; 
       refer to the documentation on how to use it.
 
  <ns_data_provider
    id="defaultNSDP" 
    class="oracle.sdovis.NSDataProviderDefault" 
  />
  -->
 
  <!-- this is a sample NS data provider with prameters:
  <ns_data_provider
    id="myProvider1" class="com.mycorp.bi.NSDataProviderImpl" >
 
    <parameters>
      <parameter name="myparam1" value="value1" />
      <parameter name="p2"       value="v2"     />
    </parameters>
 
  </ns_data_provider>
  -->
 
  <!-- ****************************************************************** -->
  <!-- *******************  Map Tile Server Setting  ******************* -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and modify the following to customize the map tile server. 
 
       <tile_storage> specifies the default root directory under which the 
       cached tile images are to be stored if the cache instance configuration
       does not specify the root directory for the cache instance. If the 
       default root directory is not set or not valid, the default root 
       direcotry will be set to be $MAPVIEWER_HOME/web/tilecache
       
          default_root_path:  The default root directory under which the cached 
                              tile images are stored. 
  -->
 
  <!--
     <map_tile_server>
       <tile_storage default_root_path="/scratch/tilecachetest/"/>
    </map_tile_server>
  -->
 
  <!-- ****************************************************************** -->
  <!-- ******************** Predefined Data Sources  ******************** -->
  <!-- ****************************************************************** -->
  <!-- Uncomment and modify the following to predefine one or more data 
       sources.
       Note: You must precede the jdbc_password value with a '!' 
             (exclamation point), so that when the map visualization component starts the next
             time, it will encrypt and replace the clear text password. 
  -->
 
  <!-- 
  <map_data_source name="mvdemo"
                   jdbc_host="elocation.example.com"
                   jdbc_sid="orcl"
                   jdbc_port="1521"
                   jdbc_user="scott"
                   jdbc_password="!password" 
                   jdbc_mode="thin"
                   number_of_mappers="3"
   />
   -->
 
</MapperConfig>

This map visualization component configuration topic includes the following subtopics.

1.5.2.1 Specifying Logging Information

The map visualization component provides a flexible logging mechanism to record runtime information and events. You can configure the granularity, volume, format, and destination of the log output. You can also configure the maximum size of log files as well as automatic log file rotation.

There are two ways to configure the map visualization component's logging: container-controlled logging, and using the <logging> element in the configuration file.

Container-Controlled Logging

If the <logging> element in the mapViewerConfig.xml file is commented out or missing, the map visualization component uses container-controlled logging, specifically using the following loggers:

  • oracle.mapviewer.ws for all web server (maps, tiles, features) messages

  • oracle.mapviewer.access for all user access

  • oracle.mapviewer.sdovis for all rendering (maps, themes, features) messages

  • oracle.mapviewer.webconsole for all administrative console log messages

Using the <logging> Element

If the <logging> element in the mapViewerConfig.xml file is in use (that is, if the <logging> element is not commented out or missing), The map visualization component uses that information instead of using container-controlled logging. The <logging> element can have the following attributes and subelements:

  • The console_log_level attribute controls the levels of information that are recorded in the log, which in turn affect the log output volume. Set the console_log_level attribute value to one of the following, listed from most restrictive logging to least restrictive logging: FATAL, ERROR, WARN, INFO, DEBUG, and FINEST. The FATAL level outputs the least log information (only unrecoverable events are logged), and the other levels are progressively more inclusive, with the FINEST level causing the most information to be logged. For production work, a level of WARN or more restrictive (ERROR or FATAL) is recommended; however, for debugging you may want to set a less restrictive level.

  • The file_limit attribute controls the maximum file size of a log file. The unit is Mb and the default value is 50 (that is, by the default value for the maximum log file size is 50Mb).

  • The file_count attribute determines the number of log files created. The files are rotated (that is, when the last log file reaches its maximum size, the first log file is reused). The default value is 10.

  • The <logger> subelement specifies the log level for a particular logger.

  • The <log_output> subelement identifies output for the logging information. By default, log records are written to the system error console. You can change this to the system output console or to one or more files, or some combination. If you specify more than one device through multiple <log_output> subelements, the logging records are sent to all devices, using the same logging level and attributes.

1.5.2.2 Specifying Map File Storage and Life Cycle Information

Map image file information is specified in the <save_images_at> element. By default, images are stored in the $ORACLE_HOME /lbs/mapviewer/web/images directory. You do not need to modify the <save_images_at> element unless you want to specify a different directory for storing images.

A mapping client can request that the map visualization component send back the URL for an image file instead of the actual map image data, by setting the format attribute of the <map_request> element to GIF_URL or PNG_URL. In this case, the map visualization component saves the requested map image as a file on the host system where the map visualization component is running and sends a response containing the URL of the image file back to the map client.

You can specify the following map image file information as attributes of the <save_images_at> element:

  • The file_prefix attribute identifies the map image file prefix. A map image file name will be a fixed file prefix followed by a serial number and the image type suffix. For example, if the map image file prefix is omsmap, a possible GIF map image file could be omsmap1.gif.

    Default value: file_prefix=omsmap

  • The url attribute identifies the map image base URL, which points to the directory under which all map image files are saved on the map visualization component host. The map image URL sent to the mapping client is the map image base URL plus the map image file name. For example, if the map image base URL is http://dev04.example.com:1521/mapviewer/images, the map image URL for omsmap1.gif will be http://dev04.example.com:1521/mapviewer/images/omsmap1.gif.

    Default value: url=$HOST_URL/mapviewer/images

  • The path attribute identifies the path of the directory where all map image files are saved on the map visualization component host system. This directory must be accessible by HTTP and must match the map image URL. Map image files saved in the directory specified by the path attribute should be accessible from the URL specified by the url attribute.

    However, if you are deploying the map visualization component to WebLogic Server, the default value for the path attribute (../web/images) is not correct. The path attribute value in this case should be ../../images, because the physical "images" directory is mapviewer_23_2.ear/web.war/images; so using relative path, the value should be ../../images for the path attribute to resolve to the physical directory.

  • The life attribute specifies the number of minutes that a generated map image is guaranteed to stay on the file system before the image is deleted. If the life attribute is specified, the recycle_interval attribute controls how frequently the map visualization component checks for possible files to delete.

    Default: The map visualization component never deletes the generated map images.

  • The recycle_interval attribute specifies the number of minutes between times when the map visualization component checks to see if it can delete any image files that have been on the file system longer than the number of minutes for the life attribute value.

    Default value: 480 (8 hours)

1.5.2.3 Specifying a Web Proxy

Sometimes the map visualization component server needs to make HTTP connections to external web servers, such as to obtain a background image through a URL or to contact an external WMS server to fetch its map images. In such cases, if there is a firewall between the map visualization component server and the target web server, you may need to specify the HTTP proxy information to the map visualization component so that it will not be blocked by the firewall. The following example specifies web proxy information:

<web_proxy host="www-proxy.mycorp.com" port="80" />

If the web proxy requires authentication, you can specify the user and password attributes. If the password value is preceded by the exclamation mark (!) character, the password value will be encrypted on the first loading of the configuration file. For example:

<web_proxy host="www-proxy.mycorp.com" port="80" user="uservalue" password="!pwdvalue" />

1.5.2.4 Specifying Global Map Configuration Options

You can specify the following global "look and feel" options for the display of each map generated by the map visualization component:

  • Title

  • Note (such as a copyright statement or a footnote)

  • Logo (custom symbol or corporate logo)

  • Local geodetic data adjustment

  • Splitting geometries along the 180 meridian

To specify any of these options, use the <global_map_config> element. For example:

<global_map_config>
    <note text="Copyright (c) 2009, Example Corporation"
              font="sans serif"
              position="SOUTH_EAST"/>
    <title  text="Map Courtesy of Example Corp."
              font="Serif"
              position="NORTH"/>
    <logo image_path="C:\\images\\a.gif"
              position="SOUTH_WEST"/>

    <rendering allow_local_adjustment="false"
               use_globular_projection="false"/>
</global_map_config>

Set the map title through the <title> element of the <global_map_config> element. You can also set the map title in an individual map request by specifying the title attribute with the <map_request> element, and in this case, the title in the map request is used instead of the global title in the map visualization component configuration file. Note the following information about the attributes of the <title> element:

  • The text attribute specifies the title string.

  • The font attribute specifies a font. The font must exist on the system where the map visualization component is running.

  • The position attribute provides a positioning hint to the map visualization component when determining where the map title will be drawn on a map. Possible values are: NORTH, EAST, SOUTH, WEST, NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST, and CENTER.

    Default value: NORTH

Set the map note through the <note> element of the <global_map_config> element. Note the following information about the attributes of the <note> element:

  • The text attribute specifies the note string.

  • The font attribute specifies a font. The font must exist on the system where the map visualization component is running.

  • The position attribute provides a positioning hint to the map visualization component when determining where the map note will be drawn on a map. Possible values are: NORTH, EAST, SOUTH, WEST, NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST, and CENTER.

    Default value: SOUTH_EAST

Set the map logo through the <logo> element of the <global_map_config> element. The map logo image must be in either JPEG or GIF format. The image can be stored in a local file system where the map visualization component instance will have access to it, or it can be obtained from the web by specifying its URL. To specify a map logo, uncomment the <map_logo> element in the map visualization component configuration file and edit its attributes as needed.

Note the following information about the attributes of the <logo> element:

  • The image_path attribute must specify a valid file path name, or a URL starting with http://.

  • The position attribute provides a positioning hint to the map visualization component when determining where the map logo will be drawn on a map. Possible values are: NORTH, EAST, SOUTH, WEST, NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST, and CENTER.

    Default value: SOUTH_WEST

If the logo image is obtained through a URL that is outside your firewall, you may need to set the web proxy in order for the map visualization component to retrieve the logo image. For information about specifying a web proxy, see Specifying a Web Proxy.

If you also specify a map legend, be sure that its position is not the same as any position for a map title, note, or logo. (Map legends are explained in Map Legend. The default position for a map legend is SOUTH_WEST.)

To have the map visualization component automatically project geodetic data to a local non-geodetic coordinate system before displaying it if the map data window is less than 3 decimal degrees, specify allow_local_adjustment="true" in the <rendering> element.

To have the map visualization component automatically apply a globular map projection (that is, a map projection suitable for viewing the world, and specifically the azimuthal equidistant projection for the map visualization component), specify use_globular_projection="true" in the <rendering> element. This option applies to geodetic data only.

1.5.2.5 Customizing the Spatial Data Cache

You can customize the in-memory cache that the map visualization component uses for spatial data by using the <spatial_data_cache> element. For example:

<spatial_data_cache   max_cache_size="64"
                      report_stats="true"
/>

You can specify the following information as attributes of the <spatial_data_cache> element:

  • The max_cache_size attribute specifies the maximum number of megabytes (MB) of in-memory cache.

    Default value: 64

  • The report_stats attribute, if set to true, instructs the map visualization component server to periodically (every 5 minutes) output cache statistics, such as the number of objects cached, the total size of cache objects, and data relating to the efficiency of the internal cache structure. The statistics are provided for each data source and for each predefined theme. They can help you to determine the optimal setting of the in-memory cache. For example, if you want to pin all geometry data for certain themes in the memory cache, you need to specify a max_cache_size value that is large enough to accommodate these themes.

    Default value: false

The spatial data cache is always enabled by default, even if the element is commented out in the configuration file. To completely disable the caching of spatial data, you must specify the max_cache_size attribute value as 0 (zero).

Note:

The disk-based spatial cache, which was supported in the previous release, is no longer supported, because performance tests have shown that disk-based spatial caching was often less efficient than fetching spatial objects directly from the database when needed (that is, in cases where the cached objects frequently did not need to be retrieved again after caching).

For detailed information about the caching of predefined themes, see Caching of Predefined Themes.

1.5.2.6 Specifying the Security Configuration

You can use the <security_config> element to specify whether the map visualization component should reject <info_request> elements in requests. An <info_request> element is a type of request from a client that asks the map visualization component to execute a simple SQL statement and return the result rows in plain text or XML format. This request is often used by the map visualization component applications to identify features displayed on a map, or to run simple spatial search queries.

However, if the map visualization component data source information is exposed, malicious attackers might be able to abuse this capability and obtain sensitive information. To prevent this from happening, you can make sure the map visualization component always connects to a database schema that has very limited access rights and hosts only non-sensitive information, and you can also reject all <info_request> requests by specifying the <security_config> element as follows:

<security_config>
  <disable_direct_info_request> true </disable_direct_info_request>
</security_config>

Note, however, that this setting affects some map visualization component features. For example, the identify() method of the map visualization component Java API will no longer work, and applications will need to implement their own identify() method through other means.

You can also define remote URLs that the map visualization component built-in proxy servlet is allowed to communicate with. Use commas to separate such URLs. You can end a URL with the * (asterisk) wildcard character to allow multiple URLs that start with a path. The following example specifies one remote URL:

<security-config>
    …
    <proxy_enabled_hosts>
      foo.com:8080/mapviewer 
    </proxy_enabled_hosts>
    …
</security-config>

To facilitate the map visualization component's HTTPS (SSL) connection with external web sites that use self-signed certificates, you may register those certificates here. Use one entry for each server that requires an HTTPS connection. The following example shows an excerpt specifying one entry:

<security_config>
    …
    <certificates>
        <entry>
           <host_name>fooserver.com</host_name>
           <keystore_file>/scratch/fooserver.jks</keystore_file>
           <key>123456</key>
        </entry>
    </certificates>
    …
</security_config>

The subelements for each certificate's <entry> element are the following.

The host_name attribute specifies the IP address or domain name of the server that requires an HTTPS connection.

The keystore_file attribute specifies the file containing a single self-signed certificate. After you obtain the certificate (typically a .pem file) from the server site, you can create a key store by using the Java keytool command. For example:

keytool -import -file fooserver.pem -alias fooserver -keystore fooserver.jks

The key attribute specifies the password that you provided when creating the key store file. (It is used to ensure the integrity of the key store file itself.)

1.5.2.7 Registering a Custom Spatial Provider

The map visualization component can render spatial data that is in an external (non-Oracle Spatial) native format, such as shapefile, if there is a spatial provider implementation registered for the format. For information about implementing an external spatial data provider (in connection with custom geometry themes), see Custom Geometry Themes.

To register an external spatial data provider, use the <s_data_provider> element, as shown in the following example:

<s_data_provider
  id="shapefileSDP"
  class="oracle.sdovis.ShapefileDataProvider"
  >
  <parameters>
    <parameter name="datadir" value="/temp/data" />
  </parameters>
</s_data_provider>

The class attribute specifies the name of the class that implements the external spatial data provider.

The <parameters> element specifies a set of initialization parameters that are used by the data provider during its initialization process. In this example, the shapefile provider has a data directory ("datadir") parameter that points to directory where the map visualization component can look for the data.

1.5.2.8 Registering Custom Nonspatial Data Providers

When generating thematic map layers, the map visualization component can dynamically join nonspatial attribute data (such as sales for each region) that originates from an external source with the base geometries (boundaries of all the regions) that are stored in the database. For information about thematic mapping using external attribute data from nonspatial data providers, see Thematic Mapping Using External Attribute Data.

To register a nonspatial data provider, use the <ns_data_provider> element, as shown in the following example:

<ns_data_provider id="testProvider"
                  class="com.mycorp.GetSalesData" >
  <parameters>
    <parameter name="bi_database" value="stadb32.mycorp.com" />
    <parameter name="sid" value="bidata"  />
  </parameters>
</ns_data_provider>

The id attribute uniquely identifies a nonspatial data provider. Use this id value in any map request that involves the provider.

The class attribute specifies the name of the class that implements the nonspatial data provider.

The <parameters> element specifies a set of initialization parameters that are used by the nonspatial data provider during its initialization process.

1.5.2.9 Customizing SRS Mapping

You can use the <srs_mapping> element to specify an SDO to EPSG SRID mapping file, which define mappings between Oracle Spatial SDO_SRID values and EPSG codes. As explained in SDO to EPSG SRID Mapping File, each line in the specified mapping file must contain an SDO_SRID value and the corresponding EPSG code. The <srs_mapping> element can be used with WMS and WFS themes.

The following example uses the <srs_mapping> element to specify an SDO to EPSG SRID mapping file:

<srs_mapping>
  <sdo_epsg_mapfile>
    ../config/epsg_srids.properties
  </sdo_epsg_mapfile>
</srs_mapping>

1.5.2.10 Customizing WMS GetCapabilities Responses

The map visualization component can be used as an Open Geospatial Consortium WMS (Web Map Server) 1.1.1 compliant server. As such, a WMS client can send the map visualization component the GetCapabilities request. In response, the map visualization component will send back the list of themes that it hosts and other important information, such as the data provider's name and a list of keywords that might of interest to the requesting client.

Note:

There is a separate WMS configuration file (wmsConfig.xml) that contains more information than is in the <wms_config> element in the map visualization component configuration file. It is recommended that you define any custom WMS configuration parameters in this separate WMS configuration file; any settings there will override any conflicting settings in the <wms_config> element in the map visualization component configuration file.

For more information about the wmsXonfig.xml file, see Customizing GetCapabilities Responses: Additional Options.

You can use the <wms_config> element to customize the descriptive information sent back to the client as part of the GetCapabilities response, as shown in the following example:

<wms_config host="www.my_corp.com" port="80"
            protocol="http" default_datasource="dsrc1"
            public_datasources="dsrc1,dsrc2">
  <title>
    WMS 1.1 interface for Oracle Application Server 10g MapViewer
  </title>
  <abstract>
    This WMS service is provided through Oracle MapViewer.
  </abstract>
  <keyword_list>
    <keyword>bird</keyword>
    <keyword>roadrunner</keyword>
    <keyword>ambush</keyword>
  </keyword_list>
  <sdo_epsg_mapfile>
    ../config/epsg_srids.properties
  </sdo_epsg_mapfile>
</wms_config>

The host attribute specifies the host part of the service request URL that the client should use for future WMS requests made to this map visualization component server.

The port attribute specifies the port part of the service request URL that the client should use for future WMS requests made to this map visualization component server.

The protocol attribute specifies the protocol part of the service request URL that the client should use for future WMS requests made to this map visualization component server.

The default_datasource attribute specifies the base data source used to retrieve the capabilities response. If this attribute is not defined, the data source WMS is used, and that data source must exist in this map visualization component server.

The public_datasources attribute specifies which data source contents are to be listed in the GetCapabilities response. If this attribute is not defined, all data source contents will be listed.

The <title> element specifies the service title to be included as part of the response.

The <abstract> element specifies the abstract to be included as part of the response.

The <keyword_list> element specifies a list of keywords that best describe the types of layers served by this map visualization component server.

The <sdo_epsg_mapfile> element specifies a text file that defines mappings from Oracle Spatial (SDO) SRID values to the corresponding EPSG SRID values that are typically used in most WMS requests and responses. For information about this mapping file, see SDO to EPSG SRID Mapping File.

1.5.2.11 Customizing WMTS GetCapabilities Responses

The map visualization component can be used as an Open Geospatial Consortium WMTS (Web Map Tile Service) 1.0.0 compliant server, enabling tile layers defined in the USER_SDO_CACHED_MAPS metadata view to be retrieved through WMTS requests. A WMTS client can send to the map visualization component the GetCapabilities request. In response, the map visualization component will send back the list of tile layers that it hosts and other important information, such as the data provider's name and a list of keywords that might of interest to the requesting client. You can edit the WMTS configuration file, which is stored in the same folder as that for mapViewerConfig.xml with a name of wmtsConfig.xml, to provide such customized information.

In the wmtsConfig.xml file, you can use the <wmts_config> element to customize the descriptive information sent back to the client as part of the GetCapabilities response, as shown in the following example:

<wmts_config>
     <public_datasources>
        <public_datasource name="MVDEMO" include_all_tile_layers="true"/>
        <public_datasource name="ELOCATION">
          <tile_layers>
            <tile_layer name="WORLD_MAP"/>
          </tile_layers>
        </public_datasource> 
    </public_datasources>
    <sdo_epsg_mapfile>
      ../config/epsg_srid.properties
    </sdo_epsg_mapfile>
   <ServiceAttributes>              
    <ServiceIdentification> 
        <Title>Web Map Tile Service by myCorp</Title> 
        <Abstract> U.S. maps for state and county boundaries and big cities</Abstract>
        <Keywords> 
           <Keyword>Maps,U.S. State Boundaries,Cities</Keyword>
        </Keywords> 
    </ServiceIdentification>     
    <ServiceProvider> 
      <ProviderName>provider's name</ProviderName> 
        <ProviderSite url="http://www.myCorp.com/mySite"/> 
    </ServiceProvider> 
  </ServiceAttributes>
</wmts_config>

The <public_datasources> element can contain <public_datasource> subelements, which specify which data sources' tile layers to list in the WMTS GetCapabilities response. If this <public_datasources> element is not defined, all data sources' tile layers will be listed; if this element is defined but contains no <public_datasource> subelement, then no tile layers from any data source will be listed in the response.

The <public_datasource> element must contain a name attribute, which indicates the name of the data source.

The include_all_tile_layers attribute is optional, and the default is false. When set to true, it indicates that all tile layers in that data source are to be listed in the response.

The <tile_layer> element must contain a name attribute, which indicates the name of the tile layer to be included in the response from the data source defined in its parent element.

The <sdo_epsg_mapfile> element specifies a text file that defines mappings from Oracle Spatial (SDO) SRID values to the corresponding EPSG SRID values that are typically used in most WMTS requests and responses. For information about this mapping file, see SDO to EPSG SRID Mapping File.

The <Title> element specifies the service title to be included as part of the response.

The <Abstract> element specifies the abstract to be included as part of the response.

The <Keywords> element specifies a collection of keywords (from its <Keyword> subelements) that best describe the types of layers served by this map visualization component server.

More information can be found in the comments in the wmtsConfig.xml file.

1.5.2.12 Configuring the Map Tile Server for Oracle Maps

The Oracle Maps feature of the map visualization component can pre-generate base map image tiles and cache them through the map tile server. You can use the <map_tile_server> element to provide configuration information to the map tile server, such as default location for map tile file storage, and logging information, as shown in the following example:

<map_tile_server>
   <tile_storage default_root_path="/scratch/tilecache/" />
   <logging log_level="finest" log_thread_name="false" log_time="true">
      <log_output name="System.err"/>
   </logging>
</map_tile_server>

The <tile_storage> element specifies the default root directory where all map image tiles generated by this map visualization component server will be stored.

The <logging> element specifies logging information specific to the map tile server.

1.5.2.13 Defining Permanent Map Data Sources

Every map request must have a data source attribute that specifies a map data source, which is a database user with geospatial data. You can predefine available map data sources by using the <map_data_source> element. For instance, the following example defines a map data source by specifying the JDBC connection details:

<map_data_source name="mvdemo"
                 jdbc_host="mapsrus.example.com"
                 jdbc_sid="orcl"
                 jdbc_port="1521"
                 jdbc_user="scott"
                 jdbc_password="<password_for_scott>"
                 jdbc_mode="thin"
                 number_of_mappers="5"
                 allow_jdbc_theme_based_foi="true"
                 plsql_package="web_user_info"
/>

You can specify the following information as attributes of the <map_data_source> element:

  • The name attribute specifies a unique data source name to the map visualization component. You must specify the data source name in all map requests that identify a data source.

  • You can choose one of the following options to provide the connection details as applicable to your scenario:
    • Specifying all the necessary JDBC connection information
      You can specify the following connection information:
      • jdbc_host: Host name of the database
      • jdbc_sid: System identifier for the database
      • jdbc_port: Database listener port
      • jdbc_user: Database user name
      • jdbc_password: Password for the jdbc_user
      • jdbc_mode: Type of Oracle JDBC driver

      The jdbc_password attribute specifies the database user's login password. It must be prefixed with an exclamation point (!) when you specify the password for the first time. When the map visualization component next restarts, it will automatically obfuscate and replace the clear text password.

      The map visualization component does not change this password string in any way; no conversion to upper or lower case is performed. If the database uses case-sensitive passwords, the specified password must exactly match the password in the database.

      The jdbc_mode attribute tells the map visualization component which Oracle JDBC driver to use when connecting to the database. The default is thin (for the "thin" driver). The other possible value is oci8, which requires that you also have the Oracle Database client installed on the same host on which the map visualization component is running.

      On database restart, the map visualization component will resume normal operation (for example responding to map requests with properly created maps) as soon as the database is back online.

    • Specifying the Container data source name

      The container_ds attribute lets you specify the Java EE container name (JNDI name) instead of specifying the jdbc_host, jdbc_sid, jdbc_port, jdbc_user, jdbc_password, and jdbc_mode attributes. For example, assume you created a JDBC data source and gave it a JNDI name of jdbc/OracleDS. You can then define the permanent map visualization component data source as follows:

      <map_data_source name="mvdemo"
                       container_ds="jdbc/OracleDS"
                       number_of_mappers="5"
      />
      

      If you use the container_ds attribute, and if you want the map visualization component to resume normal operation (for example, responding to map requests with properly created maps) automatically after the database on which you defined a data source is restarted, you must instruct the container data source to always validate a connection before it can be returned to the application.

      In a production deployment of the Map Visualization component, this is the recommended way of defining a data source for maximum security.

    • Specifying the Net Service name

      The jdbc_tns_name attribute identifies a net service name that is defined in the tnsnames.ora file.

      On database restart, the map visualization component will resume normal operation (for example responding to map requests with properly created maps) as soon as the database is back online.

    • Specifying the Autonomous Database (ADB) Credentials

      This is applicable if you are using Oracle Autonomous Database as the map data source. In this case, you can create a MapViewer data source using the client credentials from the wallet zip file. If the MapViewer server is running behind a firewall, and it needs a proxy server to access the Autonomous Database, then you must provide the host and port details of the proxy server.

      The following explores the various alternatives to define the wallet zip file's storage location.

      • Option 1: Copy the downloaded wallet zip file onto the machine where MapViewer server is deployed and provide its absolute path as shown:
        <map_data_source name="adb_no_proxy"
                           wallet_zip_file="/home/myfolder/mywallets/<wallet_filename>.zip"
                           user="myCloudDBUser"
                           password="<password_for_myCloudDBUser>"
                           service="db20220510_low"
                           number_of_mappers="5"
                           allow_jdbc_theme_based_foi="false"
           />
      • Option 2: Copy the downloaded wallet zip file onto the machine where MapViewer server is deployed and provide its relative path. It is relative to where the mapViewerConfig.xml file is stored. For example:
        <map_data_source name="adb_require_proxy"
                           wallet_zip_file="../wallets/<wallet_filename>.zip"
                           user="myCloudDBUser"
                           password="<password_for_myCloudDBUser>"
                           service="db20220510_low"
                           proxy_host="<proxy_host_name>"
                           proxy_port="80"
                           number_of_mappers="5"
                           allow_jdbc_theme_based_foi="false"
           />
      • Option 3: Define the wallet zip file using a URL. The URL must be accessible by the MapViewer server. For example:
        <map_data_source name="adb_url"
                           wallet_zip_file="https://objectstorage.<region_identifier>.oraclecloud.com/p/b/<bucket_name>/o/<wallet_filename>.zip"
                           user="myCloudDBUser"
                           password="<password_for_myCloudDBUser>"
                           service="db20220510_high"
                           number_of_mappers="5"
                           allow_jdbc_theme_based_foi="false"
           />
      It is important to note that in all the preceding examples:
      • The service attribute can be found in the tnsnames.ora file. This file is obtained by unzipping the wallet zip file. The tnsnames.ora file contains three service names, for example, <service_name>_high, <service_name>_medium, <service_name>_low. You can choose one of them according to your preference.
      • For other attributes, such as user and password, refer to jdbc_user and jdbc_password explained earlier in this section.

      Each time the MapViewer server is started, it will try to access the wallet zip file from the file system, or download it from the provided link. If the storage location of the wallet zip file is provided by a URL, then the MapViewer server will download the zip file and store it in a temporary folder. Since the MapViewer server will unzip the wallet file into the folder where this zip file is stored, ensure that the folder is writable.

  • The number_of_mappers attribute identifies the maximum number of map renderers available (and thus the maximum number of map requests that the map visualization component can process in parallel for the data source) for this data source. Any unprocessed map requests are queued and eventually processed. For example, if the value is 3, the map visualization component will be able to process at most three mapping requests concurrently. If a fourth map request comes while three requests are being processed, it will wait until the map visualization component has finished processing one of the current requests.

    Specifying a large number_of_mappers value (such as 50 or 100) can improve the overall throughput, but it will also increase runtime memory and CPU usage at times of peak loads, since the map visualization component will attempt to process more concurrent map requests. It will also increase the number of active database sessions. Therefore, be sure that you do not set too large a number for this attribute.

    Note:

    The obsolete max_connections attribute no longer affects rendering and is ignored. The number_of_mappers attribute value affects the actual maximum number of database connections or sessions open for the data source at any given time.

  • The allow_jdbc_theme_based_foi attribute lets you specify whether to allow JDBC theme-based FOI requests to be performed against this data source. A JDBC theme-based FOI request is based on a dynamic SQL query constructed by the JavaScript client application.

    By default, such FOI requests are not allowed unless you set this attribute to true. Due to the potential security threat, JDBC theme-based FOI requests should be used with caution. You should only allow JDBC theme-based FOI requests on database connections that are granted very low privilege and contain only data that you want to expose.

  • The plsql_package attribute lets you specify a PL/SQL package to be used for secure map rendering, as explained in Secure Map Rendering.

  • The web_user_type attribute (not shown in the example in this section) lets you specify the source for the authenticated user's name. It is especially useful for getting the authenticated user's name from a cookie, in conjunction with specifying a PL/SQL package to be used for secure map rendering. For more information about the web_user_type attribute and an example of its use, see Getting the User Name from a Cookie.

1.5.2.13.1 Data Sources

A data source corresponds to a database schema or user.

Before you can draw any spatial data in a database schema, you must first define (create) a data source for the schema:

  • You can define a data source by specifying its connection information and user login credentials in the map visualization component configuration file (mapViewerConfig.xml).

  • You can define or modify a data source using the map visualization component administration (Admin) page.

Each map request must specify a data source. You can, however, specify a different data source for individual themes added to the map request. This makes it easy to aggregate data stored across different database schemas. If a theme has no specified data source, it is associated with the data source of the map request. A base map (and thus the themes included in it) is always associated with the data source. When a theme is processed, all of its underlying data, as well as the styles referenced in its definition, must be accessible from the data source or sources associated with the theme.

Each data source has associated renderers (sometimes called mappers or map makers), the number of which is determined by the number_of_mappers attribute in the <map_data_source> element. This attribute (described in Defining Permanent Map Data Sources) affects the number of database connections created for each data source when map requests are processed. The number of renderers specified in a data source also is the maximum number of concurrent requests that can be processed for that data source. Each additional renderer requires only a small amount of memory, so the main potential disadvantage of specifying a large number of renderers (such as 100) is that the underlying CPU resource might be strained if too many map requests are allowed to come through, thus affecting the performance of the entire map visualization component server.

Each data source has its own internal metadata cache. The metadata cache holds the definitions of all accessed styles, as well as of all predefined themes that originate from the data source. This eliminates the need to query the database repeatedly for the definition of a style or predefined theme whenever it is needed.

1.5.2.13.1.1 Catalog Data Sources

A catalog data source gets all of its data from local files. The local directory where the data files are stored is relative to where the mapViewerConfig.xml file is stored. From another perspective, a catalog data source does not need the Oracle database, because all necessary data (the spatial geometry data and its attributes, as well as the metadata for how to rend the spatial data, such as styles and themes) is stored in local files.

The following are the general steps for creating and using a catalog data source:

  1. Export the Necessary Metadata from an Oracle Database

  2. Export the Necessary Spatial Tables

  3. Edit the Map Visualization Component Configuration File to Add the Catalog Data Source

  4. Restart the Map Visualization Component Server

1.5.2.13.1.1.1 Export the Necessary Metadata from an Oracle Database

Before creating a catalog data source, you must use the Map Builder utility to export the metadata to USER_SDO_CACHED_MAPS.xml, USER_SDO_THEMES.xml, and USER_SDO_STYLES.xml files. The following considerations apply:

  • Only external tile layers are supported in catalog data source. So, the tile layers exported into USER_SDO_CACHED_MAPS.xml must be external tile layers, such as Oracle eLocation map services.

  • All styles needed by the themes in USER_SDO_THEMES.xml must be exported in to the USER_SDO_STYLES.xml file.

  • You need note all required spatial data tables (themes' base tables from which to fetch spatial data) used by all of the exported themes, so that you can export each base table into a GeoJSON file (explained in Export the Necessary Spatial Tables).

  1. In the Map Builder utility, select Tools, then Export Metadata to XML.

  2. Select a temporary directory to store the metadata.

  3. Accept the default prefix (USER_SDO_) for the table names.

  4. Select the tile layers, themes, and styles to export. (If you are not sure which styles are needed for the desired themes, you may export all styles.)

  5. Click OK to perform the export operation.

    The USER_SDO_CACHED_MAPS.xml, USER_SDO_THEMES.xml, and USER_SDO_STYLES.xml files are created in the specified directory.

1.5.2.13.1.1.2 Export the Necessary Spatial Tables

For a catalog data source, the spatial data sets are stored in GeoJSON files. One GeoJSON file corresponds to one spatial table is the database. To export spatial tables, you send requests to the map visualization component server.

For example, if a spatial table called OBIEE_COUNTRY is needed by a catalog data source theme (assume that the theme is also called OBIEE_COUNTRY) in the USER_SDO_THEMES.xml file, then this spatial table needs to be exported as a GeoJSON file. As a convention, you may name it with the same name as the name of the spatial table. In this case, it is named as OBIEE_CONTRY.json.

  1. Check the themes definition from the USER_SDO_THEMES.xml file. For example, if a theme named OBIEE_COUNTRY uses the OBIEE_COUNTRY spatial table, then the spatial table needs to be exported. The table's columns and expected names must be identified, and the column names are the same as the name attributes in the theme definition. In the following example, the ISO_COUNTRY_CODE column is mapped as Country Code:

     <theme>
        <name>OBIEE_COUNTRY</name>
        <description><![CDATA[OBIEE Country]]></description>
        <base_table>OBIEE_COUNTRY</base_table>
        <geometry_column>GEOMETRY</geometry_column>
        <styling_rules><![CDATA[<?xml version="1.0" standalone="yes"?><styling_rules>
      <hidden_info>
        <field column="ISO_COUNTRY_CODE" name="Country Code"/>
        <field column="NAME" name="Country Name"/>
        <field column="NAME_INIT" name="Country Name (Init)"/>
      </hidden_info>
      <rule>
        <features style="C.AIRPORTS"> </features>
        <label column="NAME_LABEL" style="T.COUNTRY_NAME_10"> 1 </label>
      </rule>
    </styling_rules>]]></styling_rules>
      </theme>
       . . . 
    
  2. Identify the spatial table columns. In the following example, base table OBIEE_COUNTRY has the spatial geometry column named GEOMETRY:

    SQL> describe obiee_country
     Name                          Null?    Type
     ----------------------------- -------- ----------------------------
     NAME                                   VARCHAR2(255 CHAR)
     NAME_INIT                              VARCHAR2(1020 CHAR)
     OBIEE_LOWER                            VARCHAR2(1020 CHAR)
     ISO_COUNTRY_CODE                       VARCHAR2(5)
     SQKM                                   NUMBER(11)
     NAME_LABEL                             VARCHAR2(255 CHAR)
     GEOMETRY                               MDSYS.SDO_GEOMETRY
    
  3. Create request strings to the map visualization component data server. For example, if OBIEE_COUNTRY is the base table, and if the map visualization component is running at localhost:8080, and if the data source name is my_ds_name with spatial data retrieval enabled, you can send a request string like the following:

    http://localhost:8080/ mapviewer/dataserver/my_ds_name?t=obiee_country&sql=select iso_country_code as id, iso_country_code as "country Code", name as "Country Name", name_init as "Country Name (Init)", name_label, geometry from obiee_country&id_col=id&simplify=true&threshold=90&include_label_box=true
    

    You can save the data set with a name OBIEE_COUNTRY.json in this case to the temporary folder where the exported metadata (the USER_SDO_CACHED_MAPS.xml, USER_SDO_THEMES.xml, and USER_SDO_STYLES.xml files) is stored.

1.5.2.13.1.1.3 Edit the Map Visualization Component Configuration File to Add the Catalog Data Source

Edit the mapViewerConfig.xml file and add the catalog data source. For example:

<map_data_source name="catalogds1"
   catalog_dir="../catalogs/datafolder1"
   private="true"
   number_of_mappers="3"
   allow_jdbc_theme_based_foi="true"
   editable="false"/>

For the preceding catalog data source definition, you must create the specified catalog_dir folder relative to where the mapViewerConfig.xml file is stored, and then copy all data files into the folder: that is, the three exported metadata files (USER_SDO_CACHED_MAPS.xml, USER_SDO_THEMES.xml, and USER_SDO_STYLES.xml) and all exported GeoJSON files, such as OBIEE_COUNTRY.json in this example.

1.5.2.13.1.1.4 Restart the Map Visualization Component Server

Restart the map visualization component server.

After the map visualization component server is restarted, all the exported tile layers and themes should be accessible from this catalog data source. For example, you should see a map image if you send a map request like the following:

http://localhost:8080/mapviewer/omserver?xml_request= <?xml version="1.0" standalone="yes"?> <map_request  datasource = "catalogds1" width="1024" height="768" format="PNG_STREAM"> <center size="200"> <geoFeature><geometricProperty typeName="center"> <Point> <coordinates>0, 0</coordinates> </Point> </geometricProperty></geoFeature> </center> <themes> <theme name="OBIEE_COUNTRY"> </theme> </themes> </map_request>

1.5.2.14 Configuring and Securing the Map Data Server for the HTML5 API

Themes can be streamed by default, and the only way to protect them is by adding authentication, that is, by adding a security constraint in the map visualization component web.xml file and by configuring the <mds_config> element in the configuration file to authorize access to various themes.

The Map Data Server (MDS) server component facilitates the streaming of geospatial data in vector format to the Oracle Maps API (described in Oracle Maps JavaScript API). The MDS provides a RESTful API for browser clients to request the vector data of any predefined or dynamic (JDBC) theme from a map visualization component server instance. The only way to secure or protect the access to this service is by adding a security constraint in the map visualization component web.xml deployment file, as in the following example:

<security-constraint>
<web-resource-collection>
. . .
<url-pattern>/dataserver/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>map_admin_role</role-name>
</auth-constraint>
</security-constraint>

The preceding example adds a security constraint to any incoming URL with the relative path /dataserver/ in it. Because the MDS servlet responds only to URLs with /dataserver in its path, this constraint effectively protects all access to the MDS. This means that any application or web client accessing the Map Data Server will require proper authentication, and only those users with the role map_admin_role will be granted access. (For more information on how to secure a Java EE servlet such as MDS, check the Java EE and WebLogic Server documentation.)

Access to any predefined or dynamic (JDBC) theme's vector data is blocked by default, regardless of whether you added a security constraint on the MDS URL patterns. In other words, for example, even if the /dataserver/* URLs are protected and an HTML5 application has passed authentication, it still cannot access a theme's data without proper authorization. When an Oracle Maps HTML5 application attempts to load or display a theme without proper authorization, the error message typically contains a statement like "This data source does not allow streaming access."

To grant access to a data source's themes, you must explicitly configure the <mds_config> element in the configuration file.

Example 1-2 Configuring the mds.xml File

Example 1-2 shows an <mds_config> element in which two map visualization component data sources, mvdemo and my-data, are configured such that certain themes of theirs can be streamed to clients.

<mds_config>
 
<data_source name="mvdemo">
<allow_predefined_themes>true</allow_predefined_themes>
<deny>my_secret_theme</deny>
<allow_dynamic_themes>true</allow_dynamic_themes>
</data_source>
 
<data_source name="my-data">
<allow_predefined_themes>false</allow_predefined_themes>
<allow>
<theme>public_points_theme</theme>
<theme>office_locations*</theme>
</allow>
<allow_dynamic_themes>false</allow_dynamic_themes>
</data_source>
 
</mds_config>

In Example 1-2:

  • Each data source authorizes its themes in its own <data_source> element. With this element, the two tags <allow_predefined_themes> and <allow_dynamic_themes> provide the overall or default access control on these two types of themes. Note that for dynamic/JDBC themes, you can also disable them in the data source definition (in the main mapViewerConfig.xml file). If a dynamic theme is disabled in the data source definition, then that setting always has precedence (regardless of how it is set in the <mds_config> element.).

  • The mvdemo data source grants all clients with access to both predefined and dynamic (JDBC) theme vector data by default; this is a reasonable choice given the nature of the data (data from publicly available samples). An exception is added, however, for the my_secret_theme theme, through the use of the <deny> tag.

  • For the my-data data source, access to both types of themes is blocked by default. In this case exceptions (to open certain themes to streaming) are added through the <allow> tag. In both <allow> and <deny> tags, the theme names or patterns are case insensitive, and the wild card character * (asterisk) can be used to match multiple themes. The example uses the <allow> tag to open the theme public_points_theme and all the themes whose name starts with office_locations to streaming, while all other themes are blocked. No dynamic/SQL theme is allowed on this data source.

If you modify the <mds_config> element, you must restart the deployed map visualization component instance for the modifications to take effect.

1.5.3 Creating a Map Visualization Component Data Source Using a JDBC Container

You can create a JDBC data source using a container defined data source in the map visualization component configuration file. However, to establish database connections to the newly created container data source, you must restart the map visualization component after performing the instructions in the following sections.

1.5.3.1 Create a JDBC Data Source in a Map Visualization Component Container

You can use Oracle Enterprise Manager 12c or later to create a data source that connects to the Oracle Database.

The following steps show how to create GridLink data source. (These are followed by steps showing how to create a Multi data source.)

  1. Log in to Enterprise Manager and in the Target Navigation pane, click the server instance that contains the map visualization component server.

    In Figure 1-2, clicking map_viewer1 under WebLogic Domain causes the map_viewer1 server information to appear in the main area of the window.

    Figure 1-2 Selecting the Server Instance

    Description of Figure 1-2 follows
    Description of "Figure 1-2 Selecting the Server Instance"
  2. Click WebLogic Server and select JDBC Data Sources, as shown in Figure 1-3.

    Figure 1-3 Displaying JDBC Data Sources

    Description of Figure 1-3 follows
    Description of "Figure 1-3 Displaying JDBC Data Sources"
  3. Under JDBC Data Sources, click Create and select GridLink Data Source, as shown in Figure 1-4.

    Figure 1-4 Creating a GridLink Data Source

    Description of Figure 1-4 follows
    Description of "Figure 1-4 Creating a GridLink Data Source"
  4. Enter any necessary information in the Creating New JDBC Data Source wizard. For example, to create a container data source named jdbc/mvdemo:

    1. Data Source Properties: Specify Data Source Name as mvdemo, Driver Service Name as Oracle Driver (Thin XA) for GridLink Connections Versions: Any, and JNDI Name as jdbc/mvdemo.

    2. Connection Properties: Generate the URL for database user mvdemo on the appropriate host.

    3. Transaction Properties: Accept the displayed transaction properties.

    4. ONS Properties: Accept the displayed transaction properties, or make any changes as needed.

    5. Select Targets: Select (check) map_viewer1 under Name to deploy the JDBC data source on the desired server.

    6. Review: Review the properties for the new data source to be created. If you need to make any changes, go back and make them and then return to this page.

To create a Multi data source instead of a GridLink data source as in the preceding instructions, adapt the steps as appropriate. For example:

  1. Log in to Enterprise Manager and in the Target Navigation pane, click the server instance that contains the map visualization component server.

    In Figure 1-5, clicking map_viewer1 under WebLogic Domain causes the map_viewer1 server information to appear in the main area of the window.

    Figure 1-5 Selecting the Server Instance

    Description of Figure 1-5 follows
    Description of "Figure 1-5 Selecting the Server Instance"
  2. Click WebLogic Server and select JDBC Data Sources, as shown in Figure 1-6.

    Figure 1-6 Displaying JDBC Data Sources

    Description of Figure 1-6 follows
    Description of "Figure 1-6 Displaying JDBC Data Sources"
  3. Under JDBC Data Sources, click Create and select Multi Data Source, as shown in Figure 1-7.

    Figure 1-7 Creating a Multi Data Source

    Description of Figure 1-7 follows
    Description of "Figure 1-7 Creating a Multi Data Source"
  4. Enter any necessary information. For example:

    1. Data Source Properties: Specify Data Source Name as mvdemo, JNDI Name as jdbc/mvdemo, and Algorithm Type as Failover.

    2. Select Targets: Select (check) map_viewer1 under Name .

    3. Select Data Source Type: Accept the default values (non-XA Driver).

    4. Click Create New Data Source.

    5. Specify properties for the first data source node, such as: Name: mvdemo-rac0, JNDI Name: jdbc/mvdemo-rac0, Database Type: Oracle.

    6. For Database Driver, select Oracle's Driver (Thin) for Oracle RAC Service-Instance connections: Versions: Any.

    7. Accept the default values (Supports Global Transactions and One-Phase Commit).

    8. Define the connection properties for Node 1. Provide values for Service Name, Database Name, Host Name, Port, Database User Name, Password, and Protocol.

    9. Verify the properties and click Test Configuration. If it succeeds, click Next.

    10. Select (check) the server in which the map visualization component is deployed (map_viewer1), and click Finish.

    11. On the next page, click Create a New Data Source to create and configure the second node.

    12. Specify properties for the second data source node, such as: Name: mvdemo-rac1, JNDI Name: jdbc/mvdemo-rac1, Database Type: Oracle.

    13. For Database Driver, select Oracle's Driver (Thin) for Oracle RAC Service-Instance connections: Versions: Any.

    14. Accept the default values (Supports Global Transactions and One-Phase Commit).

    15. Define the connection properties for Node 2. Provide values for Service Name, Database Name, Host Name, Port, Database User Name, Password, and Protocol.

    16. Verify the properties and click Test Configuration. If it succeeds, click Next.

    17. Select (check) the server in which the map visualization component is deployed (map_viewer1), and click Finish.

    18. If you need to add more nodes, click Create a New Data Source and create each in the same way as before.

1.5.3.2 Create a Map Visualization Component Data Source

After creating a container data source in the map visualization component container (explained in Create a JDBC Data Source in a Map Visualization Component Container), create a new map visualization component data source that enables it to connect to the Oracle database by adding the container_ds attribute in the map visualization component data source. For example:

<map_data_source  name="mvdemo"
                  container_ds="jdbc/mvdemo"
                  number_of_mappers="7" />

In the preceding example:

  • The name attribute specifies the map visualization component data source name, which is required for map requests.

  • The value for the container_ds attribute must match the JNDI Name that you specified on the Data Source Properties page of the Creating New JDBC Data Source wizard.

  • The number_of_mappers attribute specifies the maximum number of supported concurrent map requests that can target this data source.

For more information about these attributes, see Defining Permanent Map Data Sources.

1.5.4 Creating a Map Visualization Component Data Source Using Oracle Service Name

As an alternative to creating a JDBC container data source for use with the container_ds attribute in the map visualization component configuration file (as explained in Creating a Map Visualization Component Data Source Using a JDBC Container), you can create a map visualization component data source directly in the map visualization component configuration file by specifying the Oracle Database connection parameters. (This type of connection works only with Oracle Database Release 11.2 and later.) For example:

<map_data_source name="mvdemo"
         jdbc_host="hostname.example.com"
         jdbc_sid="//srv.mycompany.com"
         jdbc_port="1521"
         jdbc_user="mvdemo"
         jdbc_password="<password_for_mvdemo>" 
         jdbc_mode="thin"
         number_of_mappers="8"
         allow_jdbc_theme_based_foi="true"
         editable="false"
/>

In the preceding example:

  • The jdbc_host attribute must be the Oracle IP address or host name.

  • The jdbc_sid attribute (note the leading // characters in jdbc_sid="//srv.mycompany.com") specifies the Oracle database service name and not the SID value.

For more information about the attributes in this example, see Defining Permanent Map Data Sources.

In order to have the newly created map visualization component data source take effect, you must restart the map visualization component. Once restarted, the map visualization component obtains the necessary database connections directly using the connection parameters.

1.5.5 Performing Map Visualization Component Administrative Tasks

Besides knowing how to configure the map visualization component, you should also know how to perform other important administrative tasks using the map visualization component administration page. To log in to this page, see the instructions in Logging in to the Map Visualization Component Administration Page.

The tasks you can do as a map visualization component administrator include the following:

  • Editing the configuration file

    Click Configuration.

  • Refreshing the list of data sources

    Click Admin to refresh the list automatically, or click Refresh to perform a manual refresh.

  • Clearing cached definitions of map visualization component styles, themes, and base maps

    Click Admin, select the data source, then click Purge Cached Metadata.

  • Clearing cached geometry data for predefined themes

    Click Admin, then Geometry Cache, then Purge for a selected theme or all themes.

  • Creating map tile layers for Oracle Maps

    Click Admin, then Create Tile Layer, select the tile layer type, and click Next.

    Internal map source: Enter the map cache name, then select the data source and base map. Also define parameters for cache storage (where tiles will be stored), zoom levels, minimum and maximum scale, spatial reference ID (SRID), data bounding box (MBR), and tile size and format. Click Next and Submit to create the map tile layer. You can also define the map cache properties in XML by clicking XML.

    External map source: Enter the map cache name, then select the data source. To provide access to the external source, define parameters such as the map service URL, the request method (GET or POST), the proxy information (if needed), the java adapter class name and its location on the server, and additional adapter properties. Also define parameters for cache storage (where tiles will be stored), zoom levels, minimum and maximum scale, spatial reference ID (SRID), data bounding box (MBR), and tile size and format. Click Next and Submit to create the map tile layer. You can also define the map cache properties in XML by clicking XML.

    For other types of tile layers (Oracle Maps, Here, Google, TomTom), follow similar steps.

  • Managing map tile layers for Oracle Maps

    Click Admin, then Manage Tile Layers. Then do any of the following:

    To manually refresh the tile layer list, click Refresh.

    To edit a map tile layer, select the row for that layer and click Edit/View Details.

    To view and manage map tile layer, select the row for that layer and click View Map/Manage Tiles.