Versions Compared

Key

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

tia Viewer Core settings may be specified either by environment variables in the container context or by providing a YAML configuration file.

kgs recommends to use YAML configuration file with following reasoning

  • YAML files are easy to read and maintain.

  • Using a large number of environment variables is more problematic to maintain. Case-conversion required makes them hard to handle.

Configuration using environment variables

As environment variables do not have any hierarchical order, the tia Viewer parameters must be qualified completely:

TIA_DESTINATIONS_SAPHTTP_HOST

Info

While tia Viewer Core parameter names are case-sensitive and use the . (dot) character. Depending on the operating systems, environment variables must be all uppercase and use _ (underscore) character instead of . , and conversion to parameters then convert the names to all-lowercase.

Example for a docker-compose file with configuration using environment variables:

Code Block
version: '3'
services:

  tiaviewer:
    container_name: tiaviewer
    image: images.docker.kgs-cloud.de/tia-viewer/archivelink-oidc:latest
    ports:
      - "8080:8080"
    environment:
      TIA_DESTINATIONS_SAPHTTP_HOST: contentservevr.kgs.local
      TIA_DESTINATIONS_SAPHTTP_PORT: 8090
      TIA_INSTANCES_DEFAULT_SAP_URL: https://sapServer:8400/tia/tia_viewer?sap-client=250
      TIA_INSTANCES_DEFAULT_SAP_USERNAME: secuser
      TIA_INSTANCES_DEFAULT_SAP_PASSWORD: s3cret
    volumes:
      - ./viewerlicense.json:/application/config/license/viewerlicense.json

Configuration using YAML file

YAML defines a text-file-format (typical file extensions used are .yaml and .yml) for configuration parameters with a hierarchical order by line intend. There is always one parameter setting per row only.

By the parent section and the intend before the parameter name hierarchical order is specified and replace the prefixes as used with environment variables.

  1. Prepare the YAML file in the directory of choice at the host

Info

Using the file name viewer.yml is good practice to ease maintenance.

Example tia Viewer configuration file:

Code Block
tia:
  destinations:
    saphttp:
      host: contentservevr.kgs.local
      port: 8090
  repositoryinstancemapping:
    - FI: finance
    - HR: finance
    - TR: default
    - ZI: production

  instances:
    default:
      watermark:
        text: "copy"
      sap:
        url: "https://sapServer:8400/tia/tia_viewer?sap-client=250"
        username: secuser
        password: s3cret
      mimetypes:
        - application/pdf
    finance:
      downloadDocument: false
      text: "confidential"    
    production:
      printDocumentNote: false    
      mimetypes.0: application/pdf
  1. Map the configuration file into the container context, and included into tia Viewer Core start procedure by specifying its location to the SPRING_CONFIG_ADDITIONAL-LOCATION environment variable.

Example docker compose file to load YAML file configuration:

...

tia® Viewer Core is configured using configuration parameters. There are different ways to specify them, described here: https://kgs-software.atlassian.net/wiki/x/FAALxw .

There are two categories of configuration parameters: