You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »




Contents


Intro

It is possible to view related documents or pictures through the document viewer. There are two options to configure this.

The first option is available since FEWS 2013.01. However since FEWS 2020.01 a new option is available. 

The option will be described below (XML configuration in the Explorer.xml). The second option will be described after this block.

XML configuration in Explorer.xml

To enable this feature the document viewer should be configured as an explorer task only.

<explorerTask name="Document viewer">
  <mnemonic>X</mnemonic>
  <taskClass>nl.wldelft.fews.gui.plugin.information.ForecasterAidDocumentPanel</taskClass>
  <toolbarTask>false</toolbarTask>
  <menubarTask>false</menubarTask>
  <toolWindow>true</toolWindow>
  <loadAtStartup>true</loadAtStartup>
</explorerTask>

Optionally you also may need to configure some credentials for links to websites or hosts that need a user/password.
You can have one general credential for all URLs:

<documentViewer>
  <hostCredentials>
    <user>user</user>
    <password>pw</password>
  </hostCredentials>
</documentViewer>

You can also have multiple credentials for different websites:

<documentViewer>
  <hostCredentials>
    <hostName>http://xxxx.com</hostName>
    <user>user</user>
    <password>pw</password>
  </hostCredentials>
  <hostCredentials>
    <hostName>http://yyyyy.com</hostName>
    <user>user</user>
    <password>pw</password>
  </hostCredentials>
</documentViewer>


Configuration in the TimeSeriesDisplay.xml

The downside of the approach described above is that the url reference were stored in the comments a time series. The downside of that was it was not possible anymore to use the comments fields.

In the new approach which is available since FEWS 2020.01 a new approach is available.

If for a certain timestep for a time series an image is available then this should be indicated by setting the flagsource for that time step to UR. This new flagsource is now also supported in the pi-xml import.

The url reference will be determined by using a template which is configured in the TimeSeriesDisplay.xml. 

A time series filter will determine for which time series the url reference template can be used. To determine the actual url reference for a certain time series for a certain time step the ur template will be used.

The template can contain location attributes and a datetime-pattern. The url reference to be used will be determined by appylying the location attributes and the actual date and time to the datetime-pattern.

Below an example to explain this is in more detail.

<documentViewer>
   <externalImagesSource>
      <user>myUser</user>
      <password>myPassword</password>
      <externalImages>
         <timeSeriesFilter>
            <locationId>H-2001</locationId>
         </timeSeriesFilter>
         <urlTemplate>
            <baseUrl>http://myserver:8080/images</baseUrl>
            <fileUrl>'%locationId%'yyyy/MM/dd'/myimage.gif'</fileUrl>
         </urlTemplate>
      </externalImages>
   </externalImagesSource>
   <externalImagesSource>
      <user>myUser</user>
      <password>myPassword</password>
      <externalImages>
         <timeSeriesFilter>
            <locationId>H-2002</locationId>
         </timeSeriesFilter>
         <urlTemplate>
            <baseUrl>http://myserver:8080/images</baseUrl>
            <fileUrl>'%locationId%'yyyy/MM/dd'/myimage.gif'</fileUrl>
         </urlTemplate>
      </externalImages>
   </externalImagesSource>
</documentViewer>



  • No labels