Configuration¶
In the folder [MO Web site folder]\data\MIKEOPERATIONS, the configuration file configuration.json can be found.
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.
{
"OPTIONALcenter": {
"latitude": 46.008790,
"longitude": 14.902405,
"zoom": 8
},
"OPTIONALbackgroundMapConfig": [{
"type": "google",
"googleType": "roadmap",
"googleApiKey": "AIzaSyDpm2Zmy5E4d4Rga******************"
},
{
"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"
}
],
"OPTIONALbackgroundMapConfig": [{
"type": "wms",
"url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi",
"layers": "nexrad-n0r-900913"
}],
"selectionColor": "#0099ff",
"OPTIONALapiUrl": "http://localhost/webapi",
"OPTIONALgoogleAnalyticsCode": "UA-XXXXX-1",
"OPTIONALconnections": {
"TimeStep": "mo-timestep",
"Gis": "mo-gis",
"TimeSeries": "mo-timeseries",
"Documents": "mo-doc",
"Jobs": "mo-job"
},
"useSingleConfigThemeDropDown":true,
"showFilterGroups": true,
"filterGroupCaption": "Select Groups",
"stationSortProperty": "name",
"OPTIONALdefaultFilterGroups": ["Filter1"],
"OPTIONALcollapsibleLegend": true,
"collapsibleLeftPanel": true,
"leftPanelDefaultCollapsed": false,
"chartPanelDefaultCollapsed": false,
"jobStatusView": false,
"OPTIONALconfigurationCaption": "Configuration",
"OPTIONALthemeCaption": "Themes",
"OPTIONALshowLayersList": true,
"OPTIONALlayerCaption": "Layers",
"OPTIONALstationCaption": "Stations",
"OPTIONALobservationPeriodCaption": "Observation Period",
"OPTIONALobservationPeriodGroupCaption": "Group",
"OPTIONALobservationPeriodOffsetCaption": "Offset",
"OPTIONALemailRequired": false,
"OPTIONALforgotPassword": false,
"OPTIONALforgotPasswordCaption": "",
"OPTIONALuserNameCaption": "User name",
"OPTIONALpasswordCaption": "Password",
"OPTIONALrepeatPasswordCaption": "Repeat password",
"OPTIONALloginCaption": "Login",
"OPTIONALemailOrUserIdCaption": "E-Mail address or User id",
"OPTIONALreturnToLoginCaption": "Return to Login",
"OPTIONALrequestPasswordResetCaption": "Request password reset",
"OPTIONALchangePasswordCaption": "Change",
"OPTIONALcancelChangePasswordCaption": "Cancel",
"logo": "dhiLogo.png",
"logoUrl": "http://www.dhigroup.com/",
"title": "MIKE OPERATIONS WEB Showcase",
"OPTIONALdateTimeFormat": "DD-MM-YYYY HH:mm",
"OPTIONALdateTimeFormatShort": "DD-MM-YYYY",
"OPTIONALTimeseriesTimeZone": "(UTC +01:00)",
"OPTIONALlocale": "en",
"OPTIONALlazyLoad": true,
"OPTIONALlazyLoadCaption": "Loading",
"OPTIONALlazyLoadBlockSize": 10,
"OPTIONALthresholdNames": true,
"OPTIONALthresholdDisplay": "required",
"ribbon": true,
"OPTIONALlogin": false,
"OPTIONALloginAPIRoles": ["User", "Editor"],
"OPTIONALloginMORoles": ["member", "webuser"],
"OPTIONALloginExpiryDays": 1,
"OPTIONALloginExpiryCaption": "login expiry",
"successOverlay": "images/MIKEOPERATIONS/Overlays/ov_check.png",
"failureOverlay": "images/MIKEOPERATIONS/Overlays/ov_error.png",
"OPTIONALfeatureHover": [{
"featureTypeId": "FT1",
"showObservationPeriod": true
}],
"reflectedElements": [{
"url": "extensions/dhi-mo-export/dhi-mo-export.html",
"elementName": "dhi-mo-export",
"OPTIONALavailableForConfigurationIds": ["Sava5"],
"OPTIONALavailableForMORoles": ["member"],
"displayName": "Export",
"ribbonGroupName": "csv / dfs0",
"icon": "images/MIKEOPERATIONS/export.png",
"properties": {
"configuration": "[Configuration]",
"theme": "[Theme]",
"OPTIONALObservationPeriod": "[ObservationPeriod]",
"filterGroups": "[FilterGroups]",
"featureType": "[FeatureType]",
"apiUrl": "[ApiUrl]",
"apiId": "[ApiId]",
"documentConnection": "mo-doc"
}
}, {
"displayTitle": "Job instances",
"displaySubtitle": "Select a job instance to the left for inspection.",
"url": "extensions/dhi-mo-jobs/dhi-mo-jobs.html",
"elementName": "dhi-mo-jobs",
"properties": {
"apiUrl": "[ApiUrl]",
"apiId": "[ApiIdNoObservationPeriodOffset]",
"jobName": "[JobName]",
"settings": "[Settings]"
}
}],
"OPTIONALdocuments": [{
"url": "/dev/data/Samdus/SAMDUS_visualisering_Dokumentation_for_Superbrugere.pdf",
"availableForConfigurationIds": ["Sava5"],
"displayName": "Superbruger",
"ribbonGroupName": "Dokumentation",
"icon": "images/MIKEOPERATIONS/info24x24.png",
"userRoles": ["Administrator"]
}],
"OPTIONALrasters": [{
"filterGroups": ["GROUP1"],
"themes": ["Styring - Skema", "Styring"],
"type": "background",
"url": "images/MIKEOPERATIONS/klimaspringSkema.png",
"boundingBox": {
"lowerLeft": {
"latitude": 56.151024,
"longitude": 10.209174
},
"upperRight": {
"latitude": 56.155040,
"longitude": 10.219989
}
},
"center": {
"latitude": 56.15300194058882,
"longitude": 10.214425921440125,
"zoom": 17
}
}, {
"filterGroups": ["GROUP1"],
"themes": ["Regn - Geografisk"],
"type": "radar",
"dataSource": {
"host": "http://klimaspring.dhigroup.com",
"radar": "aarhus-radar"
},
"boundingBox": {
"lowerLeft": {
"latitude": 55.602311,
"longitude": 9.036234225387541
},
"upperRight": {
"latitude": 56.664502,
"longitude": 10.995200612874198
}
},
"center": {
"latitude": 56.12565331475411,
"longitude": 10.135574340820312,
"zoom": 10
}
}]
}
Selected properties are described below.
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" : "AIzaSyDpm2Zmy5E4d4Rga7*****************"
},
{
"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 is 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 are 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 or 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. The login is handled in the accounts system in the WebAPI and the accounts located in the accounts.json file. When login is set to true, the user is met by a login dialog. Login as admin/webapi and create required users as well as changing the admin password. When user’s login they can change their own passwords as well.
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 site is invoking 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
- [ObservationPeriod]: The current observation period name
- [FeatureType]: The current feature type id selected in the drop down above the station list
- [User]: The current user object. Used for e.g. passing into the jobexecuter
- [FilterGroups]: The current filter groups
- [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 offset
documents¶
The web page features dynamic load of help pdf file elements that will appear in the ribbon (if enabled).
- 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 user double clicks on a corresponding feature on the map. It’s an array of objects e.g. 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 specified theme is selected.
- type: if set to “background” then the raster will be displayed as 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 below two properties.
- latitude: latitude of the lower left point.
- longitude: longitude of the lower left point.
- upperRight: object with below two properties.
- latitude: latitude of the upper right point.
- longitude: longitude of the upper right point.
- Center: center of the map control. Its object with below properties.
- latitude: latitude of the center of the map.
- longitude: longitude of the center of the map.