Skip to content

Configuration

Configuration

Prerequisites

MIKE OPERATIONS Web is supported on the following platforms:

  • Windows 7 Professional, Service Pack 1 (64 bit)

  • Windows 10 Pro, version 1803 (64 bit)

  • Windows Server 2012 R2 Standard (64 bit)

  • Windows Server 2016 Standard (64 bit)

The following software are required:

  • Microsoft .Net Framework 4.7.2

  • DHI License Manager 2019

IIS must be configured for web sites. Refer to the section about IIS Deployment on how to configure the server.

Configuration

The configuration file “configuration.json” can be foundIn the folder “\<MO Web site folder>\data\MIKEOPERATIONS”.

The configuration file contains optional client-side configuration. The possible properties are listed in the file with the text “OPTIONAL” in front. If a property is required, remove the “OPTIONAL” text and modify the value accordingly.

Selected properties are described below.

Property Description
center The map will automatically center on the features. This property allows overriding the center and zoom if required. Zoom will set the default zoom level of the map.
backgroundMapConfig Controls the type and order of background map layers. Google Maps, slippy map tiles, and WMS are supported either on their own or in combination with each other.

If there is no backgroundMapConfig defined then a Google Maps background layer will be presented.

If the type field is google, use the googleType field to set the layer from one of roadmap, satellite, terrain, hybrid.

An example of three background map layers:

backgroundMapConfig" : [
{
"type" : "google",
"googleType" : "roadmap",
"googleApiKey" : "AIzaSyDpm2Zmy5E4d4Rga7jRfpUi1KBzzJ5nSxY"
},
{
"type" : "slippy",
"url" : "http://eo4sd-water.net:8000/singleband/TB.1/AguasSuperficiales/20190131/{z}/{x}/{y}.png?colormap=ylgnbu",
"comment" : "use {-y} in the url for TMS schema"
},
{
"type" : "wms",
"url" : "https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi",
"layers" : "nexrad-n0r-900913"
}
]
apiUrl The apiUrl is by default empty which means it will access the web services in the same location as the web site. Modify this if the web services are located elsewhere. The apiUrl has the format of e.g. http://localhost/mySite if the Web Site Name created was mySite. It is important to understand the visibility of the urls. In above, if the apiUrl is configured to http://localhost/mySite, then the web page is successfully accessible on http://localhost/mySite and displays all data. If, however, the url is sent to someone else for testing, then the browser on that persons machine will try to access http://localhost/mySite on that local machine, where it obviously is not located. Changing the url to http://computername/mySite will display the page, but since the apiUrl in the configuration.json file is still set to http://localhost/mySite, it will try to fetch data from the local machine which of course cannot deliver, hence the apiUrl always either needs to be blank or set to a web server that is visible for the end user.
googleAnalyticsCode Code for DHI Google Analytics. DHI Google Analytics is a component for using google analytics on a web page.
connections The connections are what ties the web site together with the connections defined in the connections.json file of the DHI WebAPI. If additional connections is needed, they must be added here.
defaultFilterGroups This can be used to specify default filter groups for GIS layers.
collapsibleLegend This controls visibility of GIS layer legend. If “true” then a legend visibility toggle button is visible on right side of the layer control. This toggle button can be used to show or hide the legend, irrespective of whether the layer is checked on or off.
collapsibleLeftPanel Defines if the left stations and legend panel should be collapsible, showing a triangle so that the user can hide the panel.
jobStatusView Show a ribbon item “Job Status” for displaying status of all running job schedules.
configurationCaption Determines the text to be displayed in the configuration selection drop box.
themeCaption Determines the text to be displayed in the theme selection drop box.
layerCaption Determines the text to be displayed in the layers ribbon control.
stationCaption Determines the text to be displayed in the station ribbon control.
observationPeriodCaption Determines the text to be displayed in the observation period ribbon control.
observationPeriodGroupCaption Determines the text to be displayed for offset option in the observation period selection options.
observationPeriodOffsetCaption Determines the text to be displayed for offset option in the observation period selection options.
emailRequired To enforce that email is a required field for adding new users via the MIKE OPERATIONS website. True means email is required.
forgotPassword It enables / disables the forgot password link in the login dialog. It’s a Boolean property.
forgotPasswordCaption Determines the text to be displayed as forgot password link on the login dialog.
userNameCaption Determines the text to be displayed in the user name input box on login dialog.
passwordCaption Determines the text to be displayed in the password input box on login dialog.
repeatPasswordCaption Determines the text to be displayed in the repeat password input box on change password dialog.
loginCaption Determines the text to be displayed in the login button on login dialog.
emailOrUserIdCaption Determines the text to be displayed in the input field for email address or user id on request password reset dialog.
returnToLoginCaption Determines the text to be displayed in return to login link on request password reset dialog.
requestPasswordResetCaption Determines the text to be displayed in request password reset button on request password reset dialog.
changePasswordCaption Determines the text to be displayed in change password button on change password dialog.
cancelChangePasswordCaption Determines the text to be displayed in cancel button on cancel password change dialog.
logo The logo image is assumed located in the images folder.
logoUrl Url hyper link when clicking the logo image.
title Title to be displayed in the heading bar.
dateTimeFormat Date time format to be used for displaying dates to user.
dateTimeFormatShort Short date time format to be used for displaying dates to user.
TimeseriesTimeZone Time zone for the web site. By default, it uses the time zone of the database.
locale This is used to specify locale of the calendar used in observation period selection dialog (choose offset dates option). e.g. ‘da’ / ‘en’. Default value is ‘en’.
lazyLoad If lazyLoad is set to true, then the time steps will be loaded in blocks with the size specified in lazyLoadBlockSize. This is useful when there are large number of time steps and will provide a responsive site before every time steps have been loaded
lazyLoadCaption Determines the text to be displayed in the lazy load message box.
lazyLoadBlockSize Number of time steps to be downloaded in one call, i.e. batch size of each call to the server.
thresholdNames A Boolean indicating if threshold names should be displayed. Default is false.
thresholdDisplay A string with the options “none”/”required”/”all”. The options are all lowercase. None means the y axis will not be scaled to accommodate any of the threshold lines. Required means the y axis will be scaled to display the first threshold line higher than the maximum value and the first threshold line lower than the minimum value as well as all in between. All means the y axis will be scaled to show all threshold lines.
ribbon The ribbon provides similar functionality as the ribbon in MIKE OPERATIONS. It allows feature types to be enabled or disabled in the same way as in the layer list. In addition to feature types, it also shows any summary views as well as reflected elements. It is default off.
login Determines if login is required on the web page. More details about handling the login can be found in the section User Access below.
loginExpiryDays Number of days after which login expires.
loginExpiryCaption Determines the text to be displayed when user login expires.
loginAPIRoles These are the WebAPI roles the web page supplies the web services with and that are automatically assigned to a user when the user is created. By default the role “User” is used which applies in all cases where no modifications occur in the back end like running jobs. If the sites invokes job execution functionality, then the role “Editor” must be applied. This is independent of the access to functionality in the web page itself which is controlled by the loginMORoles. All users will be assigned the same set of roles.
loginMORoles The site allows for filtering of configurations based on users and their roles current MORole. When loginMORoles are defined in the configuration.json file, these roles appear when creating new users and the administrator can select between the roles. When requests are made to the backend, the user credentials are automatically provided to the backend where the user is verified, and the data is filtered according to the roles that have permission to see the data. If this functionality is enabled the internal flow is as follows. An admin creates a new user and in this process the loginMORoles from the configurations.json file are presented for the admin to select from. The selection is stored as metadata (MORole) for the account created through the WebAPI and up in the accounts.json file. The new user logs in and is validated by the WebAPI (accounts.json) to continue on the web page. Requests to the backend for data are done including the username and password where the backend validates the user (accounts.json), gets the metadata (MORole) for the user and returns the data available for the user.
successOverlay Success overlay image for scheduled jobs succeeding. Jobs are configured in MIKE OPERATIONS Desktop.
failureOverlay Failure overlay image for scheduled jobs failing. Jobs are configured in MIKE OPERATIONS Desktop.
observationPeriodCaption Determines the prefix text to be displayed in hover popup before the observation period.
featureHover Array of objects specifying hover popup information to be shown for a feature of a specified feature type id. Each object in array has below attributes.
  • featureTypeId: Feature type id.
  • showObservationPeriod: If set to true then observation period is shown in the hover popup dialog.
  • reflectedElements The web page features dynamic load of polymer elements that will appear in the ribbon (if enabled).
  • url: The relative url to the Polymer element to import
  • elementName: The name of the Polymer element
  • availableForConfigurationIds: An optional list of configuration ids that this reflection element is displayed for. If not defined, it will be displayed for all
  • availableForMORoles: An optional list of MO roles that this reflection element is displayed for. If not defined, it will be displayed for all
  • displayName: The name in the ribbon
  • ribbonGroupName: The group in the ribbon that this is added to
  • icon: The relative path to an icon sized 32x32 pixel
  • properties: The properties of the element.
    In the properties of the reflected elements a series of keywords can be used that will automatically be resolved into internal variables.

    These are:
    [Configuration]: The current configuration name
    [Theme]: The current theme name
    [FilterGroups]: The current filter groups
    [FeatureType]: The current feature type id selected in the drop down above the station list
    [ApiUrl]: The location of the web site, e.g. http://localhost/webapi
    [ApiId]: The string used in the interaction with the MIKE OPERATIONS WebAPI consisting of configuration, theme, observation period and observation period offse
    [DocumentConnection]:
    [ObservationPeriod]: The current observation period name
    [User]: The current user object. Used for e.g. passing into the jobexecuter
  • [displayTitle]:
    [displaySubtitle]:
    [url]:
    [elementName]: The name of the Polymer element
    [properties]:
    [JobName]:
    [Settings]:
  • documents The web page features dynamic load of help pdf file elements that will appear in the ribbon (if enabled).
  • docking:
  • url: The relative url to the PDF file on server.
  • availableForConfigurationIds: An optional list of configuration ids that this document element is displayed for. If not defined, it will be displayed for all
  • displayName: The name in the ribbon
  • ribbonGroupName: The group in the ribbon that this is added to
  • icon: The relative path to an icon sized 32x32 pixel
  • userRoles: Array of comma separated user roles e.g. [“User”,“Administrator”]. If this is defined then the corresponding document will be shown only when the logged in user’s role matches with one of the roles in this array.
    Note that from MIKE OPERATIONS 2019, documents can be configured in MO Desktop and shown in the ribbon.
  • rasters Static rasters can be specified to be displayed when the user double clicks on a corresponding feature on the map.

    It is an array of objects as shown below:
  • filterGroups: Raster will be displayed only if feature is a part of the specified filtergroup.
  • themes: Raster will be displayed only when the specified theme is selected.
  • type: If set to “background” then the raster will be displayed as a background layer.
  • url: Url of the raster image to be displayed.
  • boundingBox: Bounding box within which the image needs to be displayed.

    LowerLeft: Object with the following properties.
    latitude: Latitude of the lower left point.
    longitude: Longitude of the lower left point.

    UpperRight: Object with the properties.
    latitude: Latitude of the upper right point.
    longitude: Longitude of the upper right point.

    Center: Center of the map control. Has the following properties:
    latitude: Latitude of the center of the map.
    longitude: Longitude of the center of the map.
    zoom: Zoom level of the map
  • If forgot password functionality needs to be enabled for a MIKE OPERATIONS website,make sure the settings shown below are present in the web.config file.

    Note: change \<website address> below to the actual website address before saving the web.config file.

    \</applicationSettings> \</DHI.Services.Web.Properties.Settings> \<setting name="SmtpHost" serializeAs="String"> \<value>smtpserv.dhi.dk\</value> \</setting> \<setting name="PasswordResetUri" serializeAs="String"> \<value>http://\<website address>/\</value> \</setting> \</DHI.Services.Web.Properties.Settings> \</applicationSettings>

    Remote Raster and Traces Layer Sources

    In MO Desktop, remote raster layers and traces layers based on external DFS2 files can be configured. These layers will be added to MO Web if the DHI Web API has read access to their remote sources (DFS2 files). This can be achieved by copying the respective DFS2 files to the App_Data folder of DHI Web API.

    Optional configuration of a different directory for external DFS2 files

    To make a different directory accessible, the following steps can be done:

    In case the demo installation with IIS Express is used, the currently logged on user has to have access to the DFS2 files. Using the Windows File Explorer, the respective rights can be granted.

    In case the DHI Web API has been deployed to IIS:

    • In IIS: Activate Authentication and set it to Application Pool Identity.

    • In File Explorer: Edit the Security options of the raster folder and add the ApplicationPool of DHI Web API with the respective rights.

    Adding connections for traces layer

    For each traces layer, a respective connection has to be added to App_Data\connections.json. The installed version contains a template. According to the location of the traces layer source, the ConnectionString value has to be adapted. Instead of using [AppData] which allows to define relative paths to the App_Data folder of DHI Web API, an absolute path can be set (e.g., “C:\\Program Files (x86)\\DHI\\2019\\MIKE OPERATIONS WEB\\Web\\App_Data\\Forecast.dfs2”).

    User Access

    This section describes the workflow when adding a login to the webpage. The workflow can be divided into two steps, where step 1 is in the configuration file and step 2 is done on the website.

    Step 1 - Configuration file
    In the configuration file (configuration.json) the login should be activated by removing the “OPTIONAL” in front and setting it to “true”, as seen below.

    Other specifications regarding the log-in are also set here, such as the roles of users, whether a forgot password option should be offered, time before the login expires etc. For details about each input, refer to the table in section configuration.

    Step 2 - Website
    The first time the administrator logs into the website, it is done with the default administrator username and password: admin/webapi. This can be changed later on.

    New users can be set up in administration. This is also where the password can be changed, both by the administrator and by standard users.

    Here, the existing users can be viewed, edited and deleted.

    Clicking the plus-sign opens the dialogue below where new users can be set up. This includes setting up a password and assigning roles.