Skip to end of metadata
Go to start of metadata

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

Compare with Current View Page History

Version 1 Next »

tia Viewer Core configuration parameters can be specified either by environment variables in the container context or by providing a YAML configuration file:

  • configuration by environment variables is only viable for minimal configurations

  • configuration by YAML configuration file is required when requiring configuring of instances and more. Here only one environment variable to point to the YAML file is required (SPRING_CONFIG_ADDITIONALLOCATION).

 

tia Viewer Core parameter names are ordered hierarchically: Except of top-level settings, each setting has one direct superior, also called parent. A . (dot) separates parent name from parameter name.

When configuring using environment variables, a prefix string provides the exact location in the hierarchy from top-level to setting.

When configuring using YAML file, the setting must be placed below its parent with other siblings, each with an line intend increased by the same number of space characters, while no shorter intend may be appear between the setting and its parent.

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

Not all environments support the parameter name scheme for environment variables.

To convert a parameter name to an environment variable name follow these rules:

  • Replace dots (.) with underscores (_).

  • Remove any dashes (-).

  • Convert to uppercase.

 

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

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:50000/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

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

Example tia Viewer configuration file:

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_ADDITIONALLOCATION environment variable.

Example docker compose file to load YAML file configuration:

version: '3'
services:

  tiaviewer:
    container_name: tiaviewer
    image: http://images.docker.kgs-cloud.de/tia-viewer/archivelink-oidc:latest 
    ports:
      - "8080:8080"
    volumes:
      - ./viewer.yml: /app/config/viewer.yml
      - ./viewerlicense.json:/application/config/license/viewerlicense.json
    environment:
      SPRING_CONFIG_ADDITIONALLOCATION: /app/config/viewer.yml 
  • No labels