<?xml version="1.0" encoding="utf-8"?>

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *                     OMERO.insight MASTER CONFIGURATION FILE
 *
 * This file specifies the configuration settings for the OMERO.insight runtime 
 * (the Container) and links the available UI components (the Agents) to it. The
 * configuration entries are organized in the following groups:
 *
 * + Services: The runtime services provided by the Container.
 * + Agents: The UI components that will be loaded at runtime.
 * + Resources: Icons and fonts used by the widgets that are part of the
 *              Container.
 * + Look and Feel: The L&F to use for the whole application.
 *
 *
 * Note that the only entry that needs to be edited *before* launching 
 * OMERO.insight is the URL of the OMERO Data Server (OMERODS) in the Services
 * group. All other entries can optionally be edited to tweak runtime behavior,
 * but can in most cases be safely ignored.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

<container>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * 
   * SERVICES
   *
   * The runtime services provided by the Container.All entries can 
   * optionally be edited to tweak runtime behavior.
   * 
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
  <services>
   <!-- OMERO Data Server (OMERO) configuration.
         This entry specifies the hostName and the port to use to connect to
         OMERO using blitz
    -->
    <structuredEntry name="/services/OMERODS" type="OMERODS">
      <!-- The configurable attribute indicates that the user can modify the
      value from the UI.
      -->
      <hostName configurable="true">localhost</hostName>
      <port>4063</port>
      <portSSL>4064</portSSL>
      <!-- Indicates the data transfer is encrypted (slower).
      The default value is false
      -->
      <encrypted configurable="true">false</encrypted>
    </structuredEntry>

    <!-- the value corresponding to the agent defined as the master
    i.e. TreeViewerAgent = 0, ImporterAgent = 1
    The default value is 0.-->
    <entry name="/application/entryPoint" type="integer">0</entry>

    <!-- the value corresponding to a given hierarchy
    i.e. Project/Dataset = 0, HCS = 1, Tags = 2, Attachments = 3
    The default value is 0.-->
    <entry name="/application/entryPointHierarchy" type="integer">0</entry>

    <!-- default fs directory -->
    <entry name="/services/FS/defaultDirectory"></entry>
    
    <!-- The maximum number of times that the Login Service should attempt
         to restore a valid link to OMERO server in the background. 
         Non-positive values will be ignored and the internal default will
         be used instead. -->
    <entry name="/services/LOGIN/omeds/max-retry" type="integer">10</entry>
    <!-- The interval, in milliseconds, between each attempt.
         Non-positive values will be ignored and the internal default will
         be used instead. -->
    <entry name="/services/LOGIN/omeds/retry-interval"
           type="integer">500</entry>

    <!-- The interval, in milliseconds, between each attempt.
         Non-positive values will be ignored and the internal default will
         be used instead. -->
    <entry name="/services/LOGIN/omeds/timeout" type="integer">120000</entry>

    <!-- The interval, in milliseconds, between each time we check if the
         network is up.
         Non-positive values will be ignored and the internal default will
         be used instead. -->
    <entry name="/services/NETWORK/timeout" type="integer">300000</entry>

    <!-- Name of the omero folder. -->
    <entry name="/services/OMERO/home">omero</entry>

    <!-- Name of the omero folder. -->
    <entry name="/services/OMERO/files/home">filesOmero</entry>

    <!-- Log Service configuration.
    -->
    <!-- Enables/disables the Log Service. -->
    <entry name="/services/LOG/on" type="boolean">true</entry>
    <!-- The directory where log files are kept. Path relative to the
         installation directory. -->
    <entry name="/services/LOG/dir">log</entry>
    <!-- The name of the log file -->
    <entry name="/services/LOG/file">omeroinsight.log</entry>
    <!-- Indicate to print out the log in the console -->
    <entry name="/services/LOG/output/console" type="boolean">false</entry>

    <!-- Enables/disables the Caching Service. -->
    <entry name="/services/CACHE/on" type="boolean">true</entry>

    <!-- Maximum number of thumbnails retrieved asynchronously. -->
    <entry name="/services/Thumbnailing/fetchSz" type="integer">50</entry>

     <!-- Factor by which the maximum number of thumbnails to fetch
    is multiplied by when the connection's speed is Low. 
    -->
    <entry name="/services/Thumbnailing/fetchLowSpeed" type="double">0.25</entry>

    <!-- Factor by which the maximum number of thumbnails to fetch
    is multiplied by when the connection's speed is Medium.
    -->
    <entry name="/services/Thumbnailing/fetchMediumSpeed" type="double">0.5</entry>
    
    <!-- Default value for the max plane width which does not require pyramids - 
         will be overwritten if set server side -->
    <entry name="/services/Thumbnailing/non_pyramid_max_plane_width" type="integer">3192</entry>
    
    <!-- Default value for the max plane height which does not require pyramids - 
         will be overwritten if set server side -->
    <entry name="/services/Thumbnailing/non_pyramid_max_plane_height" type="integer">3192</entry>
    
    <!-- Rendering Engine configuration.
         NOTE: All the following entries for the Rendering Engine will
         be removed as soon as we move the engine to the server.
    -->
    <!-- The number of rendering engines to start when viewing a
         big image. -->
    <entry name="/services/RE/worker" type="integer">4</entry>

    <!-- The time after which the rendering is shut down (not the viewer)
    if not active. The value is in milliseconds. Default = 5mins -->
    <entry name="/services/RE/timeout" type="long">300000</entry>

    <!-- Maximum size, in Mb, of the image cache in the Rendering Engine.
          This is a per-image cache which stores planes that have already
          been rendered and are still valid with respect to the current
          rendering settings.  Because the Rendering Engine can only process
          one image at a time, the value you specify here will equal the 
          maximum amount of memory that will be used for caching rendered
          images at any given time.  If set to 0 or a negative value, then
          no caching will be done (this dramatically reduces responsiveness
          though). -->
    <entry name="/services/RE/cacheSz" type="integer">100</entry>
    <!-- Maximum number of planes that will be pre-fetched and rendered
         asynchronously in addition to the plane that has been currently
         requested.  If set to a positive value n, then separate threads 
         will be spawned to render (at most) n planes that are likely to
         be requested after the current plane.  If 0 or negative, then no
         asynchronous rendering will take place.
         Having asynchronous rendering on usually increases performance and
         responsiveness.  However, take into account that too a high value
         can be counterproductive (what is "high" depends on your platform
         and deployment settings). -->
    <entry name="/services/RE/maxPreFetch" type="integer">0</entry>
    <!-- How many Mb should be allocated to the Rendering Engine to cache
         pixels stacks.  If the size of an image stack exceeds this value
         then the stack won't be cached.  This will increase the time it
         takes to render planes within that image stack and will result
         in an error if 3D rendering is attempted; 3D rendering requires
         the stack to be in memory. -->
    <entry name="/services/RE/stackBufSz" type="integer">100</entry>
    <!-- How many Kb should be fetched at a time when retrieving a stack.
     	   Experimental, affects performance and responsiveness.
         Don't modify this unless you know what you're doing. -->
    <entry name="/services/RE/stackBlockSz" type="integer">4096</entry>

    <entry name="/services/RE/compressionMedium" type="float">0.85</entry>
    <entry name="/services/RE/compressionLow" type="float">0.50</entry>
    <!-- Debugger configuration.
         This entry specifies the name of the server and 
         and e-mail address to submit comment.
    -->
    <entry name="/services/DEBUGGER/hostnameToken">http://qa.openmicroscopy.org.uk/qa/initial/</entry>
    <entry name="/services/DEBUGGER/hostnameProcessing">http://qa.openmicroscopy.org.uk/qa/upload_processing/</entry>
    <entry name="/services/DEBUGGER/applicationNameBug">4</entry>
    <entry name="/services/DEBUGGER/applicationNameComment">3</entry>
    <entry name="/services/DEBUGGER/postTimeout" type="integer">2000</entry>
    <entry name="/services/DEBUGGER/emailAddress">qa@openmicroscopy.org.uk</entry>
    <!-- URL to do offline import -->
    <entry name="omero.client.import.offline.url">http://localhost:8000/ome/import</entry>
    <entry name="omero.client.import.offline.enabled" type="boolean">false</entry>
    <!-- mde on/off -->
    <entry name="omero.client.import.mde.enabled" type="boolean">true</entry>
    <!-- mde config file location (. for in config dir; omero for local user omero dir) -->
    <entry name="omero.client.import.mde.path">omero</entry>
    <!-- escape ice special characters, see https://doc.zeroc.com/ice/3.6/properties-and-configuration/configuration-file-syntax -->
    <entry name="omero.client.login_escape_characters">#=\s\\</entry>
  </services>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * 
   * AGENTS
   *
   * The UI components that will be loaded at runtime.
   * This section is mainly used by developers to make their Agents available
   * to a insight instance.  System administrator may decide to remove some of
   * the Agents in exceptional cases.  (This is easily done by deleting an
   * agent tag altogether.)
   * 
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
  <agents>
    <structuredEntry name="/agents" type="agents">

      <!-- NOTE FOR DEVELOPERS
           Add an agent tag for each of your Agents.
           The name tag specifies the human-readable name of the Agent.
           The active tag specified if the agent is turn on or off.
           Set to true to turn the agent on, false otherwise.
           The number tag identifies a possible master.
           The class tag specifies the FQN of the Agent class.
           The config tag specifies the name of the Agent's configuration file
           within the config directory.
      -->
     <agent>
        <name>ImViewer</name>
        <active>true</active>
        <class>org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent</class>
        <config>imviewer.xml</config>
      </agent>
       <agent>
        <name>Tree Manager</name>
        <number>0</number>
        <active>true</active>
        <class>org.openmicroscopy.shoola.agents.treeviewer.TreeViewerAgent</class>
        <config>treeviewer.xml</config>
    </agent>
    <agent>
        <name>Measurement Tool</name>
        <active>true</active>
        <class>org.openmicroscopy.shoola.agents.measurement.MeasurementAgent</class>
        <config>measurement.xml</config>
    </agent>
    <agent>
        <name>Metadata Browser</name>
        <active>true</active>
        <class>org.openmicroscopy.shoola.agents.metadata.MetadataViewerAgent</class>
        <config>metadataViewer.xml</config>
    </agent>
    <agent>
        <name>Data Browser</name>
        <active>true</active>
        <class>org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserAgent</class>
        <config>dataBrowser.xml</config>
    </agent>
    <agent>
        <name>Importer</name>
        <number>2</number>
        <active>true</active>
        <class>org.openmicroscopy.shoola.agents.fsimporter.ImporterAgent</class>
        <config>importer.xml</config>
    </agent>
    </structuredEntry>
  </agents>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * 
   * RESOURCES
   *
   * Icons and fonts used by the widgets that are part of the Container.
   * The iconFactories shouldn't be edited by system administrators, they're
   * only useful to developers.  The fonts family, size, and style can instead
   * be tweaked if needed.
   *
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
  <resources>
    <iconFactories>
      <!-- NOTE FOR DEVELOPERS
           This type of entry can be used in agents' configuration files too.
           It is turned into an instance of: 
              org.openmicroscopy.shoola.env.config.IconFactory
           This object can then be used to retrieve any image file within
           the directory pointed by the location tag
      -->
      <structuredEntry name="/resources/icons/DefaultFactory" type="icons">
        <!-- The location tag specifies the FQN of the package that contains
             the icon files. -->
        <location>images.env</location>
      </structuredEntry>
    </iconFactories>
    <fonts>
      <!-- NOTE FOR DEVELOPERS
           This type of entry can be used in agents' configuration files too.
           It is turned into an instance of java.awt.Font. 
      -->
      <structuredEntry name="/resources/fonts/Titles" type="font">
        <family>SansSerif</family>
        <size>12</size>
        <style>bold</style>
      </structuredEntry>
    </fonts>
  </resources>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * 
   * LOOK & FEEL
   *
   * The L&F to use for the whole application.
   * 
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
  <!-- This entry specifies what Look and Feel to use for the whole application.
       The default value is system (case insensitive).  This will result in the
       system's look and feel being loaded - the Mac L&F on Mac OS platforms,
       the Windows L&F on Microsoft Windows platforms, etc.  Alternatively, you
       can specify the following:
          javax.swing.plaf.metal.MetalLookAndFeel: the Java look and feel.
        
       If you want to use a custom L&F then you can just drop the L&F jar file
       into the lib directory and then specify here the fully-qualified name
       (FQN) of the L&F class to use - this name can usually be found in the
       documents accompanying the L&F.
  -->
  <entry name="LookAndFeel">system</entry>

    <!-- Flag to use the CheckThreadViolationRepaintManager for debugging Swing thread issues -->
    <entry name="DebugRepaintManager" type="boolean">false</entry>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * Information related to the version of the software, name of the software,
   * etc.
   * <entry name="SplashScreenLogo">client_splashscreen.png</entry>
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
    <entry name="SoftwareName">OMERO.insight</entry>
    <entry name="AboutFile">about.xml</entry>
    <entry name="HelpOnLine">https://help.openmicroscopy.org/</entry>
    <entry name="HelpOnLineSearch">https://help.openmicroscopy.org/search.html</entry>
    <entry name="Forum">https://forum.image.sc/tag/omero-insight</entry>

  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * Information indicating if the binary data are available. This should only
   * be set to false when testing DB upgrade for example.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
   <entry name="/services/SERVER/BinaryAvailable" type="boolean">true</entry>
  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * Information indicating to display data per group not per owner.
   * 0: indicate to display the group's data.
   * 1: indicate to display the user's data. Default value
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
   <entry name="DataDisplay" type="integer">1</entry>
   <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * Information indicating to load the original file instead of OME-TIFF
   when using the Open With option
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
   <entry name="/services/OpenWith/Original" type="boolean">false</entry>
  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   * Information indicating the dependencies when the client is used as a plugin
   * e.g. as an ImageJ plugin.
   * The id: 
   * 1 identifies ImageJ plugin. This means that the application is used
   * as an ImageJ plugin, in that case by default the the image will be opened
   * in the imageJ viewer.
   * 2 identifies Knime. This means that the application is used
   * as an KNIME node
   * The plugin tag has the following children:
   * id: The identifier of the plugin
   * dependencies: value should be separated by a comma e.g. a.jar,b.jar
   * conjunction: Indicates if all the items listed in dependencies
   * must be found or only one. Support value: or/and.
   * directory: The location in ImageJ where to look for the dependencies
   * info:  Where to download the dependencies from.
   * name: Name of the application, Used to display informative message.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
  <plugins>
    <structuredEntry name="/plugins" type="plugins">
    <!-- The identifier of the plugin.-->
    <plugin>
      <id>1</id>
      <!-- The dependencies will be ignored if used as an ImageJ2 or Fiji plugin-->
      <dependencies>bioformats_package.jar</dependencies>
      <conjunction>or</conjunction>
      <directory>plugins</directory>
      <info>https://www.openmicroscopy.org/bio-formats/downloads/</info>
      <name>ImageJ</name>
    </plugin>
  </structuredEntry>
  </plugins>
</container>
