Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Web Browser Display (available since 2016.01) can display URL's that are configured for a topology node of the Interactive Forecast Display in the topology.xml.

Table of Contents

Steps to integrate the embedded WebBrowserDisplay (2018.01 and before)

To use the Web Browser Display, do the following.

...

Code Block
xml
xml
		<explorerTask name="Web Browser Display">
			<iconFile>document.png</iconFile>
			<mnemonic>h</mnemonic>
			<taskClass>nl.wldelft.fews.gui.plugin.webbrowser.WebBrowserDisplay</taskClass>
			<toolbarTask>false</toolbarTask>
			<menubarTask>true</menubarTask>
			<accelerator>ctrl h</accelerator>
			<loadAtStartup>false</loadAtStartup>
		</explorerTask>	

Steps to integrate the embedded WebBrowserDisplay (2018.02 and onwards)

To add a new Web Browser Display to your configuration you need to take a few general steps, which are listed here and detailed in the sections below.
If you already have the pre 2018.02 WebBrowserDisplay running, you can skip general steps 2 and 3.

...

In Delft-FEWS 2018.02 (and onwards), a new package (Java Chromium Embedded Framework  -  JCEF) is taking care of launching this display.
By default, this package is NOT installed and available through the Delft-FEWS libraries and need to be installed separately.
Please contact Delft-FEWS Productmanagement by e-mail (fews-pm@deltares.nl) or go directly to the downloads sections at the bottom of the page.

...

Code Block
xml
xml
		<explorerTask name="Web Browser Display">
			<iconFile>document.png</iconFile>
			<mnemonic>h</mnemonic>
			<predefinedDisplay>web browser</predefinedDisplay>
			<toolbarTask>false</toolbarTask>
			<menubarTask>true</menubarTask>
			<accelerator>ctrl h</accelerator>
			<loadAtStartup>false</loadAtStartup>
		</explorerTask>	

Please be aware that you refer to an existing <iconFile> in your configuration!

Note: You can still use the <taskClass> tag to identify the  component by it's class name, but using the <predefinedDisplay> is the preferred way of doing this.   

Topology.xml

To display content in the Web Browser Display, topology nodes can be extended with optional URLs. In the following example, a SA test application (FEWS-Swiss was used) to show the potential variety.

...

Note: The Web Browser can no longer used for viewing pdf files. This was possible in older versions of JCEF, but is not supported in recent versions.

clientConfig.xml

Add an <autoExportModuleDataSet> for the jcef binaries:  <autoExportModuleDataSet name="jcef" exportDir="Modules"/>

...

Code Block
languagexml
titleChanges to the *_clientConfig.xml (SA example)
<?xml version="1.0" encoding="UTF-8"?>
<clientConfiguration xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews https://fewsdocs.deltares.nl/schemas/version1.0/clientConfig.xsd">
	<clientType>Stand alone</clientType>
	<autoExportModuleDataSet name="jcef" exportDir="Modules"/>
</clientConfiguration>

ModuleDataSetFiles

Add the jcef.zip to your Config/ModuleDataSetFiles folder.

Note: you do not need to declare this moduleDataSet in the ModuleInstanceDescriptors.xml, like you would do normally.

Configuring of WebBrowserDisplay.xml

<defaultBrowser>

By default the web browser is linked to items (segments) in the topology tree (IFD) which have a url field assigned. To use the display for all web pages that can be opened within the UI (for example from hyperlinks in tooltips or the forecaster document panel) you can add a <defaultBrowser> element to the config file as shown above. If you do so, you may also want to add the <bringToFront> element to make the browser display activate itself whenever a new web page is loaded.

...

An example of the WebBrowserDisplay.xml file, allowing the Deltares home page and other important pages hosted by Deltares to fully load in the embedded web browser:

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<webBrowserDisplay xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews https://fewsdocs.deltares.nl/schemas/version1.0/webBrowserDisplay.xsd">
    <defaultBrowser>true</defaultBrowser>
	<bringToFront>true</bringToFront>
	<chromiumSwitch>--proxy-server="https://proxy-ip:proxy-port</chromiumSwitch>
    <domainWhiteList>
		<access origin="deltares.nl" />
		<access origin="*.deltares.nl" />
	</domainWhiteList>
	<downloadDir>%REGION_HOME%/downloads</downloadDir>
</webBrowserDisplay>

...

The folder used to download files can be configured with the <downloadDir> element (since 2020.02). 
If you do not configure this, a dialog box will pop up to ask the user where he wants to put a downloaded filedownloading of files is disabled, this is not the intended use for the embedded webbrowser.

Note: prior to 2020.02 downloaded files would go to %REGION_HOME%/temp/session and did not have the expected file name.

...