Kitodo.Presentation

Classification

dlf

Version

6.0

Language

en

Description

Kitodo.Presentation is a powerful framework for building a METS-based digital library. It is highly customizable through a user-friendly backend and flexible design templates.

Keywords

kitodo,presentation,digitization,viewer,library,METS,OAI-PMH

Copyright

since 2017

Author

Kitodo Release Management Team

Email

contact@kitodo.org

License

This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml

Rendered

Tue, 22 Apr 2025 10:41:36 +0000

The content of this document is related to TYPO3, a GNU/GPL CMS/Framework available from www.typo3.org.

Table of Contents

Introduction

About Kitodo.Presentation

Kitodo.Presentation is a powerful framework for building a METS-based digital library. It is highly customizable through an user-friendly backend and flexible design templates.

Since it is based on the great free and open source Content Management System TYPO3, it can be integrated seamlessly into your website and can easily be managed by editors.

Kitodo.Presentation provides a comprehensive toolset covering all basic requirements for presenting digitized media: books, archivalia, digital depositary copies, manuscripts and letters, prints, newspapers and magazines.

Download of current version is available on GitHub.

Libraries using Kitodo.Presentation

Amongst others Kitodo.Presentation is known to be used on the following digital presentations:

In Kitodo.Presentation, the METS/MODS formats are flexible. Digital collections can be configured for any METS-based format, e.g. METS/TEI for manuscripts.

Unrestricted access to TYPO3 functions, such as user authentication, session handling, language localization, caching, etc., is possible within the Kitodo.Presentation functional modules. The entire system is multi-client capable, i.e. any number of instances of Kitodo.Presentation can be run within a single TYPO3 installation, each with its own configuration, search index, backend pages, access permissions, visual design, etc.

Kitodo.Presentation offers a standard OAI-PMH2-compliant interface for international search capability and digital metadata legibility. We recommend registering your Kitodo installation with the appropriate public OAI registry.

Software Components

The software primarily consists of three modules:

Commons

is a group of classes that build upon the TYPO3 API, adding Kitodo-specific functions, such as handling METS structures and library metadata in various formats, or linking external resources, such as OAI-PMH interfaces or Solr search engines. The API extensions are available to all TYPO3 extensions, which means that they can be used not only by Kitodo.Presentation, but by other extensions as well. Thus, commercial or other very specific functions, which are only necessary in single installations, don't need to be part of the official Kitodo.Presentation release, but can be created as separate extensions.

Modules

is a group of components that are integrated into the TYPO3 backend and manage the configuration of extensions as well as of digital resources, clients and collections. Currently, there is a module for client management as well as integrations with the basic TYPO3 list module to manage the digital resources. In addition, they enable a highly granular configuration of structure and metadata handling as well as database management. Furthermore, a command line interface is provided, which allows automation of procedures, such as importing digital resources.

Plugins

are components that build the frontend output and provide various functions. All plugins can be precisely configured via GUI and freely dropped into TYPO3-managed web pages. All frontend outputs are based on design templates and are thus fully customizable.

Screenshots

Some examples of Kitodo.Presentation in action on the Digital Collection of SLUB Dresden:

https://digital.slub-dresden.de/id457052678

Mscr.Dresd.A.180.d

Mscr.Dresd.A.180.d

https://digital.slub-dresden.de/id416971482-19060601

Newspaper issue with full-text switched on

Newspaper Issue with Full-text Switched on

https://digital.slub-dresden.de/id501434038

All Years Overview of a Newspaper Title

All Years Overview of a Newspaper Title

https://digital.slub-dresden.de/id501434038-1942

Calendar View of a Newspaper Year

Calendar View of a Newspaper Year

Administrator Manual

Installation

Make sure you have TYPO3 and Apache Solr already running.

  1. Get the latest release ("jar" file) from https://github.com/dbmdz/solr-ocrhighlighting/releases. Version 0.9.1 is the minimum version number. Make sure to pick the right file for Solr 8 or 9 respectively.
  1. Copy the jar file (e.g. solr-ocrhighlighting-0.9.1.jar) to the modules/ocrsearch/lib/ directory of your Apache Solr.
  1. Copy the schema.xml and solrconfig.xml from Configuration/ApacheSolr/configsets/dlf/conf/ to $SOLR_HOME/configsets/dlf/.
  1. Restart Solr.

Composer Mode

It is highly recommended to install this extension by using composer. This is the only supported way.

Please run the following commands in your webroot where the TYPO3 composer.json is located:

  1. Fetch Kitodo.Presentation with Composer

    composer require kitodo/presentation
    Copied!
  2. Install and Activate the Extension

    ./vendor/typo3 extension:activate dlf
    Copied!

Upgrade

This section contains version specific instructions on upgrading an existing Kitodo.Presentation installation.

Version 3.3 -> 4.0

Upgrade Wizards

There are two upgrade wizards available. If you upgrade an existing installation, you should use them. Without, you have to configure all plugins from scratch and the collection record images won't be visible.

Database Upgrade

Run the database upgrade (Maintenance > Analyze Database Structure) and delete the columns metadata and metadata_sorting. (These columns are not used anymore by Kitodo.Presentation 4. If they are not removed, indexing new documents may fail.)

Set the Storage Pid

The Kitodo.Presentation configuration folder must be set by TypoScript constant plugin.tx_dlf.persistence.storagePid now. This setting is available for all plugins in the page tree. The plugin specific constant pages has been removed.

Migrate Plugin Settings

When plugins are configured in TypoScript, the values must now be wrapped in a settings key.

// Before
plugin.tx_dlf_pageview {
  features = OverviewMap
}

// After
plugin.tx_dlf_pageview {
  settings {
    features = OverviewMap
  }
}
Copied!

Fluid Rendering

All plugins now use the Fluid Template Engine instead of marker templates for outputting HTML.

  • If you override a .tmpl file, it needs to be migrated to an HTML/Fluid template.
  • The TypoScript setting templateFile has been removed.

See the Plugin Reference for more information.

Plugin Feeds

The plugin feeds uses the fluid template engine to render XML now. To enable this output format, you must create a TypoScript extension template on the page with the feed plugin and include the template "RSS Feed Plugin Configuration".

Plugin OAI-PMH

The plugin oai-pmh uses the fluid template engine to render XML now. To enable this output format, you must create a TypoScript extension template on the page with the oai-pmh plugin and include the template "OAI-PMH Plugin Configuration".

Plugin Page Grid

The plugin use the fluid widget.paginate viewhelper now. The markup has changed. You need to check and adopt your design.

The pagination can be configured by TypoScript. The flexform setting limit is changed to default paginate.itemsPerPage.

Plugin ListView

The ListView plugin works in a different manner now. It still can be used to render results from the Search plugin or the Collection plugin. Both plugins have their own "listview" which basically uses the same Fluid partials.

With the ListView plugin, you still achieve the following situation:

page 1: Search Plugin (main column)
   |
   v
   +--> page 2: ListView Plugin (main column) | Search Plugin (sidebar) e.g with forceAbsoluteUrlHttps
   ^
   |
page 3: Collection Plugin (main column)
Copied!

The setting targetPid has been renamed to targetPidPageView.

Toolbox Plugins

Previously, the toolbox plugins (located in namespace Kitodo\Dlf\Plugin\Tools) could be used directly. This is not possible anymore, but instead they must be included via the overarching Toolbox plugin.

// Before
lib.imagemanipulation < tt_content.list.20.dlf_imagemanipulationtool

// After
lib.imagemanipulation < tt_content.list.20.dlf_toolbox {
  settings {
    tool = imagemanipulationtool
  }
}
Copied!

Update CSP

In Kitodo.Presentation 4.0, the way how static images are loaded has changed. Please make sure that blob: URLs are not forbidden by your Content Security Policy.

Other Changes

  • jQuery and OpenLayers have been updated. If you manually include them, update the paths.

Version 3.2 -> 3.3

Version 3.3 introduce the usage of the OCR Highlighting Plugin for Solr. The plugin can be found at GitHub: https://github.com/dbmdz/solr-ocrhighlighting. This plugin is now mandatory if you are using the full text feature.

Please note: The full text is stored in Solr index in a XML format (MiniOCR). This will rise the demand for storage space. You should therefore monitor the disc usage during reindexing.

Steps to Upgrade

a. Get the latest release ("jar"-file) from https://github.com/dbmdz/solr-ocrhighlighting/releases. Version 0.8.0 is the minimum version number. Make sure to pick the right file for Solr 7/8. b. Copy the jar-file (e.g. "solr-ocrhighlighting-0.8.0-solr78.jar") to the contrib/ocrsearch/lib/ directory of your Solr. c. Copy the updated schema.xml to your Solr configsets in $SOLR_HOME/configsets/dlf/ d. Copy the schema.xml from EXT:dlf/Configuration/ApacheSolr/configsets/dlf/conf/ to all of your Solr cores. E.g. $SOLR_HOME/data/dlfCore0/conf/ e. Restart Solr. f. Reindex all documents. This can be done by the kitodo:reindex CLI command with the '-a' (all) flag. See: Reindex collections.

Version 5.0 -> 5.1

Version 5.1 supports Apache Solr 9 (9.4+) now, a revised configuration for Apache Solr 8 (8.11+) is included and support for Apache Solr 7 and earlier is dropped.

Steps to Upgrade to Solr 9.4+

a. Get the latest release ("jar"-file) from https://github.com/dbmdz/solr-ocrhighlighting/releases. Version 0.9.1 is the minimum version number. Make sure to pick the right file for Solr 9. b. Copy the jar-file (e.g. "solr-ocrhighlighting-0.9.1.jar") to the modules/ocrsearch/lib/ directory of your Solr. c. Copy the updated schema.xml and solrconfig.xml to your Solr configsets in $SOLR_HOME/configsets/dlf/ d. Restart Solr. e. Reindex all documents. This can be done by the kitodo:reindex CLI command with the '-a' (all) flag. See: Reindex collections.

Steps to Upgrade to Solr 8.11+

a. Copy the updated schema.xml and solrconfig_8.11.2.xml to your Solr configsets in $SOLR_HOME/configsets/dlf/ b. Rename solrconfig_8.11.2.xml in $SOLR_HOME/configsets/dlf/ to solrconfig.xml c. Restart Solr. d. Reindex all documents. This can be done by the kitodo:reindex CLI command with the '-a' (all) flag. See: Reindex collections.

Furthermore version 5.1 supports the use of Solr Managed Schemas to update the schemas automatically during the update of the extension. To use this feature you have to change the schemaFactory within solrconfig.xml from "ClassicIndexSchemaFactory" to "ManagedIndexSchemaFactory".

Logging

The application uses default TYPO3 logging framework. It writes logs to the typo3_xyz.log file placed in <project-root>/var/log/ (Composer based installation).

You influence the Loglevel by overwriting the writerConfiguration in $GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration']. Have a look at the documentation: https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/ApiOverview/Logging/Configuration/Index.html#writer-configuration

System Setup

Web Server

Content Security Policy

In case a Content Security Policy is set on the Kitodo.Presentation instance, make sure that blob: URLs are allowed as img-src. Otherwise, the page view may remain blank.

TYPO3 Setup

Extension Configuration

You should check the extension configuration!

  • go to the Extension Configuration (ADMIN TOOLS -> Settings -> Extension Configuration).
  • open dlf
  • check and save the configuration

Tenant Configuration

You must create a data folder for some Kitodo.Presentation configuration records like metadata, structures, solrCore and formats (namespaces). This can be achieved easily with the 'New Tenant' backend module on the left side in section 'Tools'.

Make sure, all fields are green. Then all necessary records are created.

TYPO3 Configuration

Disable caching in certain situations

Avoid empty Workview

You may notice from time to time, the viewer page stays empty even though you pass the tx_dlf[id] parameter.

This happens, if someone called the viewer page without any parameters or with parameters without a valid cHash. In this case, TYPO3 saves the page to its cache. If you call the viewer page again with any parameter and without a cHash, the cached page is delivered.

With the search plugin or the searchInDocument tool this may disable the search functionality.

To avoid this, you must configure tx_dlf[id] to require a cHash. Of course this is impossible to achieve so the system will process the page uncached.

Add this setting to your typo3conf/LocalConfiguration.php:

'FE' => [
    'cacheHash' => [
        'requireCacheHashPresenceParameters' => [
            'tx_dlf[id]',
        ],
    ],
]
Copied!

Tip: Use the admin backend module: Settings -> Configure Installation-Wide Options

TypoScript Basic Configuration

Please include the Template "Basic Configuration (dlf)". This template adds jQuery to your page by setting the following typoscript:

page.includeJSlibs.jQuery

Slug Configuration

With TYPO3 9.5 it is possible to make speaking urls with the builtin advanced routing feature ("Slug"). This may be used for extensions too.

TYPO3 documentation about Advanced Routing Configuration.

The following code is an example of an routeEnhancer for the workview page on uid=14.

routeEnhancers:
  KitodoWorkview:
    type: Plugin
    namespace: tx_dlf
    limitToPages:
      - 14
    routePath: '/{id}/{page}'
    requirements:
      id: '(\d+)|(http.*xml)'
      page: \d+
  KitodoWorkviewDouble:
    type: Plugin
    namespace: tx_dlf
    limitToPages:
      - 14
    routePath: '/{id}/{page}/{double}'
    requirements:
      id: '(\d+)|(http.*xml)'
      page: \d+
      double: '[0-1]'
Copied!

Solr Installation

This extension doesn't include Solr, but just a prepared configuration set. To setup Apache Solr, perform the following steps:

  1. Make sure you have Apache Solr 8.11 and running.

    Download Solr from https://solr.apache.org/downloads.html. Other versions may work but are not tested.

  2. Copy the config set to your solr home
cp -r dlf/Configuration/ApacheSolr/configsets/dlf to $SOLR_HOME/configsets/
Copied!
  1. Get the Solr OCR Highlighting plugin and put it into contrib-directory.

    The plugin is available on GitHub: https://github.com/dbmdz/solr-ocrhighlighting/releases. The documentation can be found here: https://dbmdz.github.io/solr-ocrhighlighting/.

    The Solr OCR Highlighting plugin is required for full text search as of Kitodo.Presentation 3.3.

cp solr-ocrhighlighting-0.7.1.jar to contrib/ocrsearch/lib/
Copied!
  1. Using basic authentication is optional but recommended.

    The documentation is available here: https://solr.apache.org/guide/8_8/basic-authentication-plugin.html

Plugin Reference

Kitodo Plugin Reference

Common Settings

Fluid Template Configuration

As of Kitodo.Presentation 4.0 the Fluid rendering engine is used. The former marker templates for plugins are not supported anymore.

Now, all HTML markup is done in Fluid. To use different templates, you have to overload the templates by the common TYPO3 way.

The following TypoScript defines additional paths inside an "example" extension:

plugin.tx_dlf {
   view {
      templateRootPaths {
         10 = EXT:example/Resources/Private/Plugins/Kitodo/Templates
      }
      partialRootPaths {
         10 = EXT:example/Resources/Private/Plugins/Kitodo/Partials
      }
   }
}
Copied!

In this example, you place the customized fluid template into this file:

EXT:example/Resources/Private/Plugins/Kitodo/Partials/Navigation/Main.html

Copied!

Audioplayer

The audioplayer plugin is only active if the selected document has valid audio file use groups (useGroupsAudio).

Properties

plugin.tx_dlf_audioplayer.

Property

Data type

Default

excludeOther

boolean

1

elementId

string

tx-dlf-audio

excludeOther

Show only documents from the selected page.

elementId

ID value of the HTML element for the audio player.

Basket

plugin.tx_dlf_basket.

Property

Data type

Default

pregeneration

boolean

pdfgenerate

string

 

pdfdownload

string

 

pdfprint

string

 

pdfparams

string

##docId##,##startpage##,##endpage##,##startx##,##starty##,##endx##,##endy##,##rotation##

pdfparamseparator

string

*

basketGoToButton

boolean

targetBasket

t3tsref:data-type-page-id

 

Calendar

The calendar plugin may be used with newspaper and ephemeras (periodical published media). The plugin shows itself an overview of all available years or all issues in a calendar view of a selected year.

You can't place the plugin together with the pageview plugin on one page. But you can use TypoScript conditions on this page to select the proper plugin e.g by setting some specific FLUID variables.

This is an example usage of the TypoScript condition ("getDocumentType"):

[getDocumentType({$config.storagePid}) === 'ephemera' or getDocumentType({$config.storagePid}) === 'newspaper']
page.10.variables {
    isNewspaper = TEXT
    isNewspaper.value = newspaper_anchor
}
[END]

[getDocumentType({$config.storagePid}) === 'year']
page.10.variables {
    isNewspaper = TEXT
    isNewspaper.value = newspaper_year
}
[END]

[getDocumentType({$config.storagePid}) === 'issue']
page.10.variables {
    isNewspaper = TEXT
    isNewspaper.value = newspaper_issue
}
[END]
Copied!

The {$config.storagePid} is a TypoScript constant holding the Kitodo.Presentation storage pid.

This way, the FLUID variable "isNewspaper" is set according to the given value. Inside the FLUID template it's possible to switch to the right plugin now.

plugin.tx_dlf_calendar.

Property

Data type

Default

initialDocument

integer

 

showEmptyYears

boolean

showEmptyMonths

boolean

1

Collection

The collection plugin shows one collection, all collections or selected collections.

plugin.tx_dlf_collection.

Property

Data type

Default

Description

collections

t3tsref:data-type-list

 

show_userdefined

integer

 

dont_show_single

boolean

randomize

boolean

targetPid

t3tsref:data-type-page-id

 

targetFeed

t3tsref:data-type-page-id

 

Embedded 3D Viewer

The embedded3dviewer plugin renders an iFrame in which the configured 3D viewer displays the model.

plugin.tx_dlf_embedded3dviewer.

Property

Data type

Description

document

string

The URL of the XML document which contains the model.

model

string

The URL of the 3D model.

viewer

string

Override the default viewer from the extension configuration (see Configuration) with a supported viewer (from the "dlf_3d_viewers" directory).

Feeds

The feeds plugin renders a RSS 2.0 feed of last updated documents of all or a specific collection.

The following steps are necessary to activate the plugin:

a. Create a new page "Feed" with slug "feed". b. Create an extension template on this page and include the TypoScript template of the feeds plugin. c. Place the "Kitodo Feeds" plugin on it and configure it for your needs.

The TypoScript part is necessary to switch the page rendering to a different page object.

plugin.tx_dlf_feeds.

Property

Data type

Default

collections

t3tsref:data-type-list

 

excludeOtherCollections

boolean

library

integer

 

limit

integer

50

prependSuperiorTitle

boolean

targetPid

t3tsref:data-type-page-id

 

title

string

 

description

string

 

List View

plugin.tx_dlf_listview.

Property

Data type

Default

limit

integer

25

targetPid

t3tsref:data-type-page-id

 

getTitle

boolean

basketButton

boolean

targetBasket

t3tsref:data-type-page-id

 

Media Player

The mediaplayer plugin is only active if the selected document has valid video file use groups (useGroupsVideo).

plugin.tx_dlf_mediaplayer.

Property

Data type

Default

excludeOther

boolean

1

elementId

string

tx-dlf-video

Metadata

plugin.tx_dlf_metadata.

Property

Data type

Default

excludeOther

boolean

1

linkTitle

boolean

1

targetPid

t3tsref:data-type-page-id

 

getTitle

boolean

1

showFull

boolean

1

rootline

integer

separator

string

#

OAI-PMH

plugin.tx_dlf_oaipmh.

Property

Data type

Default

library

integer

 

limit

integer

5

expired

integer

1800

show_userdefined

boolean

stylesheet

resource

Page Grid

plugin.tx_dlf_pagegrid.

Property

Data type

Default

paginate.itemsPerPage

integer

24

placeholder

resource

Navigation.tmpl

targetPid

t3tsref:data-type-page-id

 

Page View

plugin.tx_dlf_pageview.

Property

Data type

Default

excludeOther

boolean

1

features

t3tsref:data-type-list

1

elementId

string

tx-dlf-map

progressElementId

string

tx-dlf-page-progress

crop

boolean

useInternalProxy

boolean

magnifier

boolean

basketButton

boolean

targetBasket

t3tsref:data-type-page-id

 

Statistics

plugin.tx_dlf_statistics.

Property

Data type

Default

collections

t3tsref:data-type-list

 

description

string

 

Table Of Contents

plugin.tx_dlf_tableofcontents.

Property

Data type

Default

Description

excludeOther

boolean

1

basketButton

boolean

showFull

boolean

targetBasket

t3tsref:data-type-page-id

 

targetPid

t3tsref:data-type-page-id

 

titleReplacement

t3tsref:data-type-list

 

List containing types for which title should be replaced when the label is empty. The defined fields are used for replacement. Example data: 0 { type = issue fields = type,year } 1 { type = volume fields = type,volume }

Toolbox

plugin.tx_dlf_toolbox.

Property

Data type

Default

Values

tools

t3tsref:data-type-list

 
  • tx_dlf_annotationtool
  • tx_dlf_fulltexttool
  • tx_dlf_imagedownloadtool
  • tx_dlf_imagemanipulationtool
  • tx_dlf_pdfdownloadtool
  • tx_dlf_fulltextdownloadtool
  • tx_dlf_searchindocumenttool

solrcore

integer

 

Fulltext Tool

This plugin adds an activation link for fulltext to the toolbox. If no fulltext is available for the current page, a span-tag is rendered instead.

The default behavior is to show the fulltext after click on the toggle link. There is a TypoScript configuration to show the fulltext initially.

plugin.tx_dlf_fulltexttool.

Property

Data type

Default

Values

activateFullTextInitially

boolean

0: show fulltext after click on toggle link

1: show fulltext on document load

fullTextScrollElement

string

html, body

The fulltext is fetched and rendered by JavaScript into the <div id="tx-dlf-fulltextselection"> of the pageview plugin.

Please note: To allow JavaScript fetching the fulltext, the CORS headers must be configured appropriate on the providing webserver.

Model download tool

This tool makes it possible to extract the model URL from the METS file or use the provided model parameter to provide a download URL.

plugin.tx_dlf_modeldownloadtool.

Viewer selection tool

This tool can display a selection list of configured 3D viewers (from the "dlf_3d_viewers" directory see Setup) that support the current model.

The model URL is extracted from the METS file or taken from the provided model parameter. The extension of the model is extracted from this URL and compared with the supported model formats specified in the respective viewer configuration.

plugin.tx_dlf_viewerselectiontool.

Search in Document Tool

This plugin adds a possibility to search all appearances of the phrase in currently displayed document.

plugin.tx_dlf_searchindocumenttool.

Property

Data type

Default

Values

searchUrl

string

 

documentIdUrlSchema

string

empty

https://host.de/items/id/record - example value

idInputName

string

tx_dlf[id]

queryInputName

string

tx_dlf[query]

startInputName

string

tx_dlf[start]

pageInputName

string

tx_dlf[page]

highlightWordInputName

string

tx_dlf[highlight_word]

encryptedInputName

string

tx_dlf[encrypted]

Validation Form

The plugin renders an input field where a METS URL can be entered. After submission, the document is loaded and validated against the DOMDocumentValidation Middleware. For the validation to work, a corresponding configuration (see Configuration) must be present in TypoScript, and the type of this configuration must be provided to the plugin as a required parameter.

plugin.tx_dlf_validationform.

Property

Data type

Description

type

string

Validation configuration type for DOMDocument validation

User Manual

Indexing Documents

New documents may be indexed via the TYPO3 command line interface (CLI).

Index single document

The command kitodo:index is used for indexing a single document:

./vendor/bin/typo3 kitodo:index -d http://example.com/path/mets.xml -p 123 -s dlfCore1

Copied!

Option

Required

Description

Example

-d|--doc

yes

This may be an UID of an existing document in tx_dlf_documents or the URL of a METS XML file. If the URL is already known as location in tx_dlf_documents, the file is processed anyway and the records in database and solr index are updated.

Hint: Do not encode the URL! If you have spaces in path, use quotation marks.

123 or http://example.com/path/mets.xml

-p|--pid

yes

The page UID of the Kitodo.Presentation data folder. This keeps all records of documents, metadata, structures, solrcores etc.

123

-s|--solr

yes

This may be the UID of the solrcore record in tx_dlf_solrcores. Alternatively you may write the index name of the solr core.

The solr core must exist in table tx_dlf_solrcores on page "pid". Otherwise an error is shown and the processing won't start.

123 or 'dlfCore1'

-o|--owner

no

This may be the UID of the library record in tx_dlf_libraries which should be set as the owner of the document. If omitted, the default is to try to read the ownership from the metadata field "owner".

123

--dry-run

no

Nothing will be written to database or index. The solr-setting will be checked and the documents location URL will be shown.

 

-q|--quite

no

Do not output any message. Useful when using a wrapper script. The script may check the return value of the CLI job. This is always 0 on success and 1 on failure.

 

-v|--verbose

no

Show processed documents uid and location with indexing parameters.

 

Reindex collections

With the command kitodo:reindex it is possible to reindex one or more collections or even to reindex all documents on the given page.:

# reindex collection with uid 1 on page 123 with solr core 'dlfCore1'
# short notation
./vendor/bin/typo3 kitodo:reindex -c 1 -p 123 -s dlfCore1
# long notation
./vendor/bin/typo3 kitodo:reindex --coll 1 --pid 123 --solr dlfCore1

# reindex collection with uid 1 on page 123 with solr core 'dlfCore1' in given range
# short notation
./vendor/bin/typo3 kitodo:reindex -c 1 -l 1000 -b 0 -p 123 -s dlfCore1
./vendor/bin/typo3 kitodo:reindex -c 1 -l 1000 -b 1000 -p 123 -s dlfCore1
# long notation
./vendor/bin/typo3 kitodo:reindex --coll 1 --index-limit=1000 --index-begin=0 --pid 123 ---solr dlfCore1
./vendor/bin/typo3 kitodo:reindex --coll 1 --index-limit=1000 --index-begin=1000 --pid 123 --solr dlfCore1

# reindex collection with uid 1 and 4 on page 123 with solr core 'dlfCore1'
# short notation
./vendor/bin/typo3 kitodo:reindex -c 1,4 -p 123 -s dlfCore1
# long notation
./vendor/bin/typo3 kitodo:reindex --coll 1,4 --pid 123 --solr dlfCore1

# reindex collection with uid 1 and 4 on page 123 with solr core 'dlfCore1' in given range
# short notation
./vendor/bin/typo3 kitodo:reindex -c 1,4 -l 1000 -b 0 -p 123 -s dlfCore1
./vendor/bin/typo3 kitodo:reindex -c 1,4 -l 1000 -b 1000 -p 123 -s dlfCore1
# long notation
./vendor/bin/typo3 kitodo:reindex --coll 1,4 --index-limit=1000 --index-begin=0 --pid 123 ---solr dlfCore1
./vendor/bin/typo3 kitodo:reindex --coll 1,4 --index-limit=1000 --index-begin=1000 --pid 123 --solr dlfCore1

# reindex all documents on page 123 with solr core 'dlfCore1' (caution can result in memory problems for big amount of documents)
# short notation
./vendor/bin/typo3 kitodo:reindex -a -p 123 -s dlfCore1
# long notation
./vendor/bin/typo3 kitodo:reindex --all --pid 123 --solr dlfCore1

# reindex all documents on page 123 with solr core 'dlfCore1' in given range
# short notation
./vendor/bin/typo3 kitodo:reindex -a -l 1000 -b 0 -p 123 -s dlfCore1
./vendor/bin/typo3 kitodo:reindex -a -l 1000 -b 1000 -p 123 -s dlfCore1
# long notation
./vendor/bin/typo3 kitodo:reindex --all --index-limit=1000 --index-begin=0 --pid 123 ---solr dlfCore1
./vendor/bin/typo3 kitodo:reindex --all --index-limit=1000 --index-begin=1000 --pid 123 --solr dlfCore1

Copied!

Option

Required

Description

Example

-a|--all

no

With this option, all documents from the given page will be reindex.

 

-c|--coll

no

This may be a single collection UID or a list of UIDs to reindex.

1 or 1,2,3

-p|--pid

yes

The page UID of the Kitodo.Presentation data folder. This keeps all records of documents, metadata, structures, solrcores etc.

123

-s|--solr

yes

This may be the UID of the solrcore record in tx_dlf_solrcores. Alternatively you may write the index name of the solr core.

The solr core must exist in table tx_dlf_solrcores on page "pid". Otherwise an error is shown and the processing won't start.

123 or 'dlfCore1'

-o|--owner

no

This may be the UID of the library record in tx_dlf_libraries which should be set as the owner of the documents. If omitted, the default is to try to read the ownership from the metadata field "owner".

123

-l|--index-limit

no

With this option, all documents in given limit for the given page will be reindex.

Used when it is expected that memory problems can appear due to the high amount of documents.

1000

-b|--index-begin

no

With this option, all documents beginning from given value for the given page will be reindex.

Used when it is expected that memory problems can appear due to the high amount of documents.

--dry-run

no

Nothing will be written to database or index. All documents will be listed which would be processed on a real run.

 

-q|--quite

no

Do not output any message. Useful when using a wrapper script. The script may check the return value of the CLI job. This is always 0 on success and 1 on failure.

 

-v|--verbose

no

Show each processed documents uid and location with timestamp and amount of processed/all documents.

 

Harvest OAI-PMH interface

With the command kitodo:harvest it is possible to harvest an OAI-PMH interface and index all fetched records.:

# example
./vendor/bin/typo3 kitodo:harvest --lib=<UID> --pid=<PID> --solr=<CORE> --from=<timestamp> --until=<timestamp> --set=<set>
Copied!

In order to use the command, you first have to configure a library in the backend, setting at least a label and oai_base. The latter should be a valid OAI-PMH base URL (e.g. https://digital.slub-dresden.de/oai/).

Option

Required

Description

Example

-l|--lib

yes

This is the UID of the library record with the OAI interface that should be harvested. This library is also automatically set as the documents' owner.

123

-p|--pid

yes

This is the page UID of the library record and therefore the page the documents are added to.

123

-s|--solr

yes

This may be the UID of the solrcore record in tx_dlf_solrcores. Alternatively you may write the index name of the solr core.

The solr core must exist in table tx_dlf_solrcores on page "pid". Otherwise an error is shown and the processing won't start.

123 or 'dlfCore1'

--from

no

This is a timestamp in the format YYYY-MM-DD. The parameters from and until limit harvesting to the given period, e.g. for incremental updates.

2021-01-01

--until

no

This is a timestamp in the format YYYY-MM-DD. The parameters from and until limit harvesting to the given period, e.g. for incremental updates.

2021-06-30

--set

no

This is the name of an OAI set. The parameter limits harvesting to the given set.

'vd18'

--dry-run

no

Nothing will be written to database or index. All documents will be listed which would be processed on a real run.

 

-q|--quite

no

Do not output any message. Useful when using a wrapper script. The script may check the return value of the CLI job. This is always 0 on success and 1 on failure.

 

-v|--verbose

no

Show each processed documents uid and location with timestamp and amount of processed/all documents.

 

Delete single document

The command kitodo:delete is used for deleting a single document:

./vendor/bin/typo3 kitodo:delete -d http://example.com/path/mets.xml -p 123 -s dlfCore1

Copied!

Option

Required

Description

Example

-d|--doc

yes

This may be an UID of an existing document in tx_dlf_documents or the URL of a METS XML file.

Hint: Do not encode the URL! If you have spaces in path, use quotation marks.

123 or http://example.com/path/mets.xml

-p|--pid

yes

The page UID of the Kitodo.Presentation data folder. This keeps all records of documents, metadata, structures, solrcores etc.

123

-s|--solr

yes

This may be the UID of the solrcore record in tx_dlf_solrcores. Alternatively you may write the index name of the solr core.

The solr core must exist in table tx_dlf_solrcores on page "pid". Otherwise an error is shown and the processing won't start.

123 or 'dlfCore1'

-v|--verbose

no

Show processed documents uid and location with deleting parameters.

 

Commit and/or optimize index

With the command kitodo:optimize it is possible to hard commit documents to and/or optimize the index.:

# example
./vendor/bin/typo3 kitodo:optimize --solr=<CORE> --commit --optimize
Copied!

Option

Required

Description

Example

-s|--solr

yes

This may be the UID of the solrcore record in tx_dlf_solrcores. Alternatively you may write the index name of the solr core.

The solr core must exist in table tx_dlf_solrcores on page "pid". Otherwise an error is shown and the processing won't start.

123 or 'dlfCore1'

--commit

no

Hard commit documents to the index.

 

--optimize

no

Optimize the index.

 

--dry-run

no

Nothing will be written to database or index. All documents will be listed which would be processed on a real run.

 

-q|--quite

no

Do not output any message. Useful when using a wrapper script. The script may check the return value of the CLI job. This is always 0 on success and 1 on failure.

 

-v|--verbose

no

Show each processed documents uid and location with timestamp and amount of processed/all documents.

 

Features and Testing

This is a list of features and how to do some functional tests.

F-10 Basket

In the ListView it is possible to place an "Add-To-Basket" button. The list entry will be put in a basket. The basket itself must be configures on the same or a separate page.

Page View

This document describes features of the pageview plugin and how to test them.

Some of the sample URLs rely on the Kitodo.Presentation DDEV system.

Image Sources

The viewer supports various image formats. Each of them should work in single page and double page mode.

For Zoomify and IIPImage, the sample METS files may be used via a local file server (e.g., by copying them to the public/ folder of the DDEV system).

Features

Basic Features

  • Zoom and rotate

    • Buttons from Digital Collections template
    • Stepless: Drag the image while pressing Shift.
    • Zoom via mouse wheel
    • Zoom via + and - keys
  • Pan the image

    • Pan by mouse dragging
    • Pan via arrow keys

Image Manipulation

In the Digital Collections template, activate the tool by clicking the slider button.

Full Text

In the Digital Collections template, the following full text features are available:

  • Click the reading-glass icon on the left to toggle the fulltext overlay. When hovering a text line on the image, the corresponding part should be highlighted in the overlay.
  • When showing an indexed document, click the search icon on the right to toggle in-document search. Search results should be highlighted on the page.
  • In single page mode, click the download link and select "Fulltext page (TXT)" to download the raw text.

Overview Map and Zoom Buttons

Additional OpenLayers controls may be configured in TypoScript:

plugin.tx_dlf_pageview {
  settings {
    features = OverviewMap,ZoomPanel
  }
}
Copied!

These are created in dlfViewer::createControls_().

Loading Indicator

A progress element may be configured to be used as loading indicator for static images. This requires CORS and possibly a non-mixed context, and the server must send a Content-Length header.

In TypoScript, set progressElementId to the ID of the <progress> element:

plugin.tx_dlf_pageview {
    settings {
        progressElementId = tx-dlf-page-progress
    }
}
Copied!

The element may be placed anywhere on the page.

<progress id="tx-dlf-page-progress"></progress>
Copied!

For styling, the CSS class loading is added whenever the loading indicator is in use:

#tx-dlf-page-progress {
    visibility: hidden;
}

#tx-dlf-page-progress.loading {
    visibility: visible;
}
Copied!

Tools for Basket Plugin

There are additional tools for the basket plugin:

  • Magnifier: Show zoomed page at mouse location in a separate panel.
  • Cropping Tool: Select a region that should be added to the baseket.

To insert links for activating these tools into the default PageView template, the following settings may be used:

plugin.tx_dlf_pageview {
  settings {
    basket {
      magnifier = 1
      crop = 1
    }

    // The basket must be configured for these settings to take effect
    basketButton = 1
    targetBasket = 123
  }
}
Copied!

Magnifier

  • To use the magnifier, the page must contain an element with the id ov_map. It is included in the default PageView template.

    <div id="ov_map" style="height: 200px;"></div>
    Copied!
  • The magnifier can be activated manually via JavaScript:

    tx_dlf_viewer.activateMagnifier();
    Copied!

Cropping Tool

  • Activate and reset manually:

    tx_dlf_viewer.activateSelection();
    tx_dlf_viewer.resetCropSelection();
    Copied!

Media Player (A/V)

Work-in-progress document aiming to answer some questions about the media player:

  • What is it?
  • How can I use it?
  • How can I change it?

Features

Scope:

  • Learn about the features on a semi-technical level.
  • Learn about MPEG-DASH/HLS specifics for the player.

General

The media player plugin is based upon Shaka Player.

Supported Formats

For adaptive bitrates, media content may be provided using either MPEG-DASH manifests or Apple HLS playlists (or both). While MPEG-DASH can nowadays be used in most browsers (via Media Source Extensions), HLS is still required for some iOS devices.

As a fallback or when adaptive bitrate streaming is not necessary, you may also supply a raw media file (such as MP3). What codecs can be used generally depends on the user's browser.

For more details on supported formats, see https://github.com/shaka-project/shaka-player.

Player Modes

The player supports two display modes:

  • In video mode, the playback controls are shown as an overlay.
  • In audio mode, the player consists of a control bar.

By default, the mode is auto-selected based on the media source. It is, however, possible to adjust the mode; see the guide for integrators for details.

The set of available controls and keyboard shortcuts is determined depending on source, browser and mode.

There are keybindings to switch between audio and video mode (currently, additional tools are shown in audio mode).

Gestures

Supported gestures:

  • All input methods

    • Double click/tap left or right of video, but keep pressed: Rewind or fast-forward (four times original speed)
    • Press and hold: Scrub through video
    • Natural swipe left/right: Jump by the configured amount (10 seconds by default)
  • Touch only

    • Double tap left or right of the video: Jump by the configured amount
    • Double tap middle of video (outside of big play button): Switch to fullscreen mode
  • Mouse only

    • Click to play/pause
    • Double click to toggle fullscreen mode

Seeking

The player supports sub-second seeking. When the video has constant frame rate and information about the frame rate is available to the player (DASH or HLS), this is used to simulate frame-accurate seeking and display the current frame count. Whether or not this is precise depends on the media encoding and the browser.

To seek to the exact position of a thumbnail, hold the Shift key. This currently assumes that the frame is in between the thumbnail time range, as produced by ffmpeg's fps filter.

Wide/narrow seek:

  • Wide: In video mode, the thumbnail/chapter preview area can be used for seeking.
  • Narrow: In audio mode, only the timeline can be used for seeking. (This is so that the chapter/timecode box doesn't interfer with other controls shown in the main panel.)

Trick Play

In the player, when keeping the right arrow key pressed, media is fast-forwarded in four times the original speed. The reverse is also possible depending on browser support. To avoid wasting bandwidth, a so-called trick track in lower frame rates may be provided.

In DASH, add an adaptation set that includes the following marker:

<EssentialProperty schemeIdUri="http://dashif.org/guidelines/trickmode" value="ID_HERE"/>
Copied!

Replace ID_HERE by the id of the normal-speed representation.

For HLS, trick play is not supported (https://github.com/shaka-project/shaka-player/issues/742).

Multiple Video Tracks

The player supports multiple video tracks when encoded in DASH or HLS. Each track uses its own set of qualities and thumbnails. Tracks can be switched in the overflow menu.

Multitrack is not supported natively by Shaka Player, so there are some specifics of how to encode them in the manifest.

MPEG-DASH

Add a separate <AdaptationSet> for each video track. In order to uniquely identify the track, the adaptation set must contain a special role ascription:

<Role schemeIdUri="urn:mpeg:dash:role:2011" value="dlf:key=TRACK_ID_HERE"/>
Copied!

When adding a thumbnail adaptation set, it must contain the same role ascription to match it with the video track.

Other roles may be used:

  • dlf:label=TEXT: Specify TEXT as a label that is shown to the user. If no label is given, the track ID is shown instead.
  • dlf:label_XX=TEXT: Localized label, where XX is replaced by the two-letter ISO code of the langauge.
  • Using prefix#group to match streams to video tracks
  • WIP/TODO: Using <Label> and dlf:label role to set label of video track. (multiple languages?)

HLS

Similarly to MPEG-DASH, set the roles in the CHARACTERISTICS attribute of the video media and the thumbnail streams.

Thumbnail Preview

When the manifest contains an image track, the player loads it for the thumbnail preview. The image files are grids of thumbnails.

The player supports using multiple image tracks in varying qualities. This can be used to quickly show a lower-resolution thumbnail and switch to a higher-resolution thumbnail when available.

MPEG-DASH

<AdaptationSet mimeType="image/jpeg" contentType="image">
  <Representation bandwidth="2500" id="thumbnails_80x45" width="1600" height="900">
    <SegmentTemplate media="https://www.example.com/$RepresentationID$/tile_$Number$.jpg" duration="400" startNumber="1"/>
    <EssentialProperty schemeIdUri="http://dashif.org/thumbnail_tile" value="20x20"/>
  </Representation>
  <Representation bandwidth="5000" id="thumbnails_160x90" width="1601" height="900">
    <SegmentTemplate media="https://www.example.com/$RepresentationID$/tile_$Number$.jpg" duration="100" startNumber="1"/>
    <EssentialProperty schemeIdUri="http://dashif.org/thumbnail_tile" value="10x10"/>
  </Representation>
</AdaptationSet>
Copied!

Set Markers

  • Set markers and segments
  • Annotate, share, export markers

The list of markers is shown in audio mode.

Screenshot Download

  • PNG or JPEG
  • Embed metadata
  • Overlay metadata
  • Directly from video

Help Modal

The help modal (press F1) lists the available keyboard shortcuts.

METS Encoding

Chapter Markers

To set chapter markers, use <mets:area> with type TIME on the physical structure node and link it from a leaf logical structure node. Only the begin is used.

<mets:div ID="PHYS_0002" ORDER="2" TYPE="track">
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT" BEGIN="00:06:04" BETYPE="TIME" />
  </mets:fptr>
</mets:div>
Copied!

Fractional timecodes (e.g., 00:06:04.5) may be used.

Waveform

To link preprocessed audio waveform data, use the WAVEFORM use groups (configurable in useGroupsWaveform). See the section on the waveform component for information on how to generate the data.

<mets:fileGrp USE="WAVEFORM">
  <mets:file ID="FILE_0000_WAVEFORM" MIMETYPE="application/vnd.kitodo.audiowaveform">
    <mets:FLocat LOCTYPE="URL" xlink:href="https://www.example.com/waveform.dat"/>
  </mets:file>
</mets:fileGrp>
Copied!

Note that the custom MIME type must be specified. Currently, data generated by the audiowaveform tool is supported. Other formats may become supported in the future.

Multiple Sources

Multiple alternative sources may be referenced by linking more than one file to a <mets:div>. They are tried in the order of the <mets:fptr>.

<mets:div ID="PHYS_0001" ORDER="1" TYPE="track">
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT_MPD" BEGIN="00:00:00" BETYPE="TIME" />
  </mets:fptr>
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT_HLS" BEGIN="00:00:00" BETYPE="TIME" />
  </mets:fptr>
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT_MP4" BEGIN="00:00:00" BETYPE="TIME" />
  </mets:fptr>
</mets:div>
Copied!

Configuration

Placeholders

Some configuration values (e.g., screenshot captions) use template strings. These may contain placeholders that substitute timecode or metadata information.

Placeholder

Replaced by

{<metadata>} (replace <metadata> by the index name of a configured metadata entry)

Metadatum in current document

{url}

Current video URL with timecode information

{host}

Current protocol and hostname (e.g., https://sachsen.digital)

{h}

Hours elapsed in video

{m}

Total minutes elapsed in video

{hh}, {mm}, {ss}, {ff}

Hours, minutes, seconds, frames elapsed (two-digit, leading zero)

{00}, {000}

Fractional part of seconds elapsed (two or three digit, leading zeros)

Commented Example

The following sample explains all base configuration options available from TypoScript.

For information on equalizer configuration, see the equalizer subpage.

plugin.tx_dlf_mediaplayer {
  settings {
    playerTranslations {
      // Language file of player localization strings without language prefix
      baseFile = EXT:dlf/Resources/Private/Language/locallang_media.xlf
    }

    // Share buttons to be shown in bookmark modal
    // Both numeric and non-numeric keys may be used
    shareButtons {
      0 {
        // Type of the button/icon: 'material' or 'image'
        type = material
        // For material icons, this is the icon key (https://material.io/icons)
        icon = email
        // Key in to specified language file shown as tooltip
        titleTranslationKey = share.email.tooltip
        // Template of generated link target. Placeholders may be used.
        hrefTemplate = mailto:?body={url}%0A%0A
      }

      1 {
        type = material
        icon = qr_code
        titleTranslationKey = share.qr_code.tooltip
        // 'dlf:qr_code' indicates that a QR code of the video URL should be shown
        hrefTemplate = dlf:qr_code
      }

      2 {
         type = image
         // For icons based on images, specify the image source
         src = EXT:dlf/Resources/Public/Images/mastodon-logo-purple.svg
         titleTranslationKey = share.mastodon.tooltip
         hrefTemplate = dlf:mastodon_share
      }
    }

    // Captions that can be shown shown on generated screenshots
    screenshotCaptions {
      0 {
        // Horizontal position: left, center, right
        h = left
        // Vertical position / baseline: top, middle, bottom
        v = bottom
        // Text to be shown. Placeholders may be used.
        text = {host}
      }

      1 {
        h = right
        v = bottom
        // This is an example to show metadata
        text = {title}
      }
    }

    constants {
      // Number of seconds in which to still rewind to previous chapter
      prevChapterTolerance = 5

      // Fractional value of volume increase/decrease when pressing up/down arrow keys
      volumeStep = 0.05

      // Number of seconds for seek/rewind
      seekStep = 5

      // On mobile, whether or not to switch to landscape in fullscreen mode
      forceLandscapeOnFullscreen = 1

      // Whether or not showing the Poster Image, if given, until playback is first started
      showPoster = 1

      // Template of filename used when downloading screenshot (without file extension)
      // Placeholders may be used
      screenshotFilenameTemplate = sachsen-digital-de_{title}_h{hh}m{mm}s{ss}f{ff}

      // Template of comment that is written to screenshot metadata
      // (EXIF in JPEG, iTxt in PNG)
      // Placeholders may be used
      screenshotCommentTemplate (
Screenshot taken on Sachsen.Digital.

{url}
)
    }
  }
}
Copied!

For Integrators

Embedding the Player

The media player is implemented as a custom HTML element <dlf-media>.

Basic

Generally speaking, syntax is oriented at the native <video> tag. Here is a simple example:

<dlf-media poster="https://www.example.com/poster.jpg" start="10">
  <source src="https://www.example.com/manifest.mpd" type="application/dash+xml">
  <source src="https://www.example.com/playlist.m3u8" type="application/x-mpegurl">
  <source src="https://www.example.com/static.mp4" type="video/mp4">
</dlf-media>
Copied!

As with native videos, the sources are tried in order, and the first one that is supported is played. The MIME type must always be given. The poster image, if given, is shown until playback is first started.

Chapter Markers

To add chapter markers, use the <dlf-chapter> tag:

<dlf-media>
  <!-- snip: sources -->

  <dlf-chapter timecode="0" title="First"></dlf-chapter>
  <dlf-chapter timecode="23.5" title="Second"></dlf-chapter>
</dlf-media>
Copied!

The timecode is given in seconds. Fractional numbers are possible.

Player Mode

There are two attributes to control player mode:

  • mode: Either audio or video to use a fixed mode, or auto (default) to auto-determine the mode based on media content.
  • mode-fallback: When setting mode="auto", this is the initial mode used until the media type is determined. To avoid flicker due to mode switching, it is best if the fallback mode already matches the media type.
<dlf-media mode="auto" mode-fallback="video">
  <!-- snip -->
</dlf-media>
Copied!

Control Elements

To add control elements to the player, use the <dlf-media-controls> tag.

<dlf-media-controls>
  <!-- Use a predefined button via "data-type" -->
  <button data-type="volume"></button>
  <button data-type="mute"></button>
  <button data-type="fullscreen"></button>
  <!--
    Define a custom button:
    * data-t-title: Translation key of tooltip
    * data-action: Key for onclick action
  -->
  <button
   class="material-icons-round sxnd-help-button"
   data-t-title="control.help.tooltip"
   data-action="modal.help.open"
  >
    info_outline
  </button>
</dlf-media-controls>
Copied!

Player View

The ID of a container element may be specified in player-view:

  • The element is used when switching to full screen, so that additional elements besides the player may be used.
  • It can be used to make sure that modals are sized and positioned appropriately even in audio mode.
<div id="tx-dlf-view" class="tx-dlf-view">
  <dlf-media player-view="tx-dlf-view">
    <!-- snip -->
  </dlf-media>
</div>
Copied!

More

  • end
  • config

<slub-media>

When using <slub-media> instead of <dlf-media>, some additional features and options are available.

Metadata

Video metadata may be provided in the <dlf-meta> tag. This is used, for example, to imprint the video title on screenshots.

<slub-media>
  <!-- snip: sources -->

  <dlf-meta key="title" value="Schattensucher"></dlf-meta>
</slub-media>
Copied!

Styling the Player

The player can be styled using CSS variables, here shown in Less syntax.

.dlf-shaka {
  &[data-mode="audio"] {
    --controls-color: #2a2b2c;

    --volume-base-color: rgba(0, 0, 0, 0.4);
    --volume-level-color: rgba(0, 0, 0, 0.8);

    .dlf-media-flat-seek-bar {
      --base-color: rgba(0, 0, 0, 0.3);
      --buffered-color: rgba(0, 0, 0, 0.54);
      --played-color: #2a2b2c;
    }

    .dlf-media-chapter-marker {
      background-color: #abc;
    }
  }
}
Copied!

Extending the Player

Plugins

If you would like to extend the player, one way is to write a "player plugin". This is intended for situations where you would like to add functionality by using the existing DlfMediaPlayer API. It is, for example, used to provide an table to a marker table that connects to a player instance. Roughly:

class MarkerTable extends DlfMediaPlugin {
  constructor() {
    super();
  }

  /**
   * @override
   * @param {DlfMediaPlayer} player
   */
  attachToPlayer(player) {
    // Optionally, check player specifics
    if (!(player instanceof SlubMediaPlayer)) {
      return;
    }

    // Here you have access to all attributes and
    // DOM elements inside the custom element

    // Add actions that can be referenced in control elements or keybindings
    player.addActions({
      'marker-table.action': {
        isAvailable: () => {
          // Optionally, check preconditions for the action. If the action is not available,
          // the control element will be hidden, and the help entry will be grayed out.
          return true;
        },
        execute: () => {
          // ...
        },
      },
    });

    // Access the <media> element that underlies the player
    player.media.addEventListener('loadedmeta', () => {
      // ...
    });

    // Access the player environment, e.g., to translate a string
    const btn = document.createElement('button');
    btn.textContent = this.env.t('marker-table.button-text');
  }
}

customElements.define('dlf-marker-table', MarkerTable);
Copied!

A plugin is attached to a player via the forPlayer attribute:

<dlf-marker-table forPlayer="playerOne"></dlf-marker-table>

<dlf-media id="playerOne">
  <!-- snip -->
</dlf-media>
Copied!

Subclassing

If you would like to make more pervasive changes to the player, or if you would like to provide a player element containing all your customizations, you may also inherit from DlfMediaPlayer. This is done in SlubMediaPlayer to define an extended <slub-media> element.

class MyMediaPlayer extends DlfMediaPlayer {
  constructor() {
    super();
  }

  connectedCallback() {
    super.connectedCallback();
  }
}

customElements.define('my-media', MyMediaPlayer);
Copied!

For styling, use the Less function dlf-media-base:

my-media {
  .dlf-media-base();
}
Copied!

The new element <my-media> may then be used just as <dlf-media>, plus any additional attributes or child elements that you query within MyMediaPlayer.

For Developers

Code Organization

This is a broad outline of the directory and class structure to aid getting acquainted with the code. To learn more about individual classes or methods, have a look at their doc-comments.

lib

The lib/ folder contains functionality that either is used throughout or isn't strictly related to the player.

Notably, class Environment encapsulates quasi-global state such as the set of language strings. An instance of this is constructed at startup and passed down to where it is needed (in variables named env).

DlfMediaPlayer

class DlfMediaPlayer is the core player. It integrates Shaka Player, loads and plays media, and provides a UI.

class ShakaFrontend encapsulates the visible part of the player UI. It is based upon Shaka Player UI, configuring it and replacing, for example, the seek bar with a custom one (FlatSeekBar).

ShakaFrontend implements the interface dlf.media.PlayerFrontend, which I originally introduced when planning to write a separate frontend class for the audio player. This plan got dropped, and instead the frontend distinguishes between video and audio mode. Still, the interface is kept to help make sure the frontend handling isn't too reliant on Shaka internals.

SlubMediaPlayer

class SlubMediaPlayer derives from DlfMediaPlayer to customize and extend it, and to integrate it into the the Digital Collections page view. Currently, its tasks are:

  • Read the initial timecode from the URL and pass it to DlfMediaPlayer.
  • Integrate with the table of contents and page select (jump to chapter markers, highlight current chapter).
  • React to keyboard events, using actions defined in DlfMediaPlayer.
  • Add help, screenshot and bookmark modal.

Consideration/TODO: It may make sense to move some of this functionality into DlfMediaPlayer.

Aspects

Localization

The player can be localized via TYPO3/XLIFF language files.

  • There is a separate language file for the media player related translation strings. The file is located at dlf/Resources/Private/Language/locallang_media.xlf.
  • Translation strings use the ICU MessageFormat syntax, which in particular supports pluralization, enumerations (via select), number formatting (e.g., percentages), and named placeholders. On the client, the strings are processed using the Intl MessageFormat library from FormatJS.

    (Consideration/TODO: Pre-process translation strings into JavaScript functions to dispense of the library and reduce bundle size.)

  • The translations are collected and serialized into a JSON string in the MediaPlayerConfigViewHelper. The result array also contains the two-letter ISO code, which is passed to Shaka Player's UI.
  • To access translation in the application, Environment is used:

    • Environment::setLang() is called at startup to store the translations.
    • Environment::t() translates a message key.

Keybindings

The keyboard shortcuts are registered in the top-level component to allow fine control of which component receives them. Existing keybindings (e.g., from Shaka Player) are disabled or overridden as far as possible.

The available keybindings are listed in keybindings.json:

  • The result object is an array of type Keybinding, which is defined and documented in SlubMediaPlayer/types.d.ts.
  • Keys are bound to an action, which are defined in DlfMediaPlayer::getActions() and extended in SlubMediaPlayer::getActions().
  • Event handlers are registered in SlubMediaPlayer::configureFrontend().

Gestures

  • The class Gestures defines the mechanics of several standard gestures (multi-tap, tap-and-hold, swipe).
  • The available gestures are currently registered in DlfMediaPlayer::registerGestures(), which accesses a Gestures object on ShakaFrontend.
  • ShakaFrontend constructs the Gestures object, registers event handlers on an appropriate DOM element, and checks whether or not a particular gesture is allowed (most importantly, to forbid gestures in the control button area).

DOM Handling

Generally speaking, DOM construction and manipulation is done in a "vanilla" way, though with some utilities to make this less tedious.

lib/util.js defines a utility function e() (e for "element") for constructing DOM elements and trees.

Tooling

Overview

  • Webpack 5 is used for building. Configuration file: /Build/webpack.config.js.
  • Jest is used for unit tests. Configuration is embedded in /Build/package.json.
  • TypeScript-flavored JSDoc and the TypeScript compiler are used for static typing. Configuration file: /jsconfig.json
  • ESLint (eslint-plugin-compat) and Babel (via Webpack) are used to check and improve browser compatibility.

Webpack Dev Server

The Dev Server is intended for developing and testing the media player in a well-defined, standalone environment.

  • To start the server, run npm run serve in the Build/ folder. This will watch, recompile and reload when source files change; other builds should not be run simultaneously.
  • The live JavaScript and CSS builds are available at /JavaScript and /Css, for example:

    <script src="/JavaScript/DlfMediaPlayer/DlfMediaPlayer.js"></script>
    Copied!
  • The server is configured in the devServer key in /Build/webpack.config.js.
  • Resources to be served are located in Build/Webpack/DevServer/. This contains a symlink to /Resources, so that all resources can be accessed from a served page via a repository-relative path.

Command Reference

Install

cd Build/

# Install/Use Node
nvm install
nvm use

# Install dependencies
npm ci
Copied!

Build

# Build in watch/development mode
npm run watch
# Build in production mode
npm run build
# Start Webpack Dev Server
npm run serve
Copied!

Validate

# Check static types
npm run typecheck
# (Alternative) Watch mode
npm run tsc-watch

# Run unit tests
npm test
# (Alternative) Watch mode
npm test -- --watch
# With coverage report
npm test -- --coverage
xdg-open coverage/lcov-report/index.html

# Check browser compatibility
# - in source files:
npm run compat
# - in built files:
npm run compat-build
Copied!

Waveform View

Overview

The waveform component is based on a toolkit provided by BBC. It can be used, for example, to set points and segments that can be processed or exported.

METS

For information on how to link preprocessed audio waveform data, see the section on METS.

Integration

A custom <dlf-waveform> tag is exposed that can be used in the HTML template.

<dlf-waveform
   id="tx-dlf-media-waveform"
   forPlayer="tx-dlf-media"
   src="https://www.example.com/waveform.dat"
   type="application/vnd.kitodo.audiowaveform"
></dlf-waveform>
Copied!

Other attributes:

  • Use hidden to control whether or not the waveform is visible.

Frontend

An instance of Peaks.js fulfills multiple functions:

  • Model for point and segment data
  • Controller and view to render waveform and points/segments into a given DOM element

An instance of BBC's WaveformData is used as a model of the waveform data and passed to Peaks.js for rendering.

We have the following class structure:

  • Markers is the model for a collection of points and segments. An instance of this is created in DlfMediaPlayer. Actions to add markers via keybindings also are registered in the player.
  • Custom components that serve as view of the player's markers:

    • WaveForm renders a waveform by integrating and customizing Peaks.js. A major part also is to adapt Peaks to Markers. (We don't use the internal model of Peaks.js directly. This allows to set markers when Peaks is not, or not yet, initialized, e.g., if a waveform is not available or not shown yet.)
    • MarkerTable lists all segments and allows to further interact with them, e.g. to edit labels or export the list.

Backend

To avoid loading the full audio file before waveform data can be displayed, the audio is preprocessed using audiowaveform.

For installation or build instructions, see https://github.com/bbc/audiowaveform.

Sample call:

# 8 bit, 1024 samples/pixel
# (at 44800 Hz, this correponds to a maximum resolution of 43.75 pixels/second)
audiowaveform -i input.mp3 -o output.dat -b 8 -z 1024
Copied!

Equalizer

Features

  • Interface to change equalizer parameters and preview frequency/phase response
  • Presets (predefined via Typoscript, user-defined in Local Storage)
  • Modes:

    • Graphic/band equalizer (via peaking filters)
    • RIAA equalizer (combining lowcut, lowshelf and highshelf filters)

Configuration

The configuration options are passed to the Equalizer in the default Fluid template.

equalizer {
  // Whether or not the equalizer control is shown
  enabled = 1

  // Key of the preset that should be selected by default
  default = 3-band

  // Presets that are available to the user as dropdown
  presets {
    // "band-iso" defines an ISO graphic/band equalizer. Starting at 1000 Hz,
    // bands are added by stepping up and down by the specified number of octaves
    3-band {
      // Used translation key: control.sound_tools.equalizer.preset.group.graphic
      group = graphic
      mode = band-iso
      label = 3-Band
      // One decade = log2(10) octaves
      octaveStep = 3.32
    }

    // It is also possible to specify bands manually via "mode = band".
    // The following preset is (virtually) equivalent to the previous.
    3-band-manual {
      group = graphic
      mode = band
      label = 3-Band
      bands {
        0 {
          frequency = 100
          octaves = 3.32
          gain = 0
        }

        1 {
          frequency = 1000
          octaves = 3.32
          gain = 0
        }

        2 {
          frequency = 10000
          octaves = 3.32
          gain = 0
        }
      }
    }

    // In "mode = riaa", the time constants of a RIAA-style EQ can be specified.
    // Parameters that are not needed may be omitted (in particular, deepBaseRolloff).
    riaa-iec {
      group = riaa
      mode = riaa
      label = Enhanced RIAA / IEC
      params {
        trebleCut = 75
        baseBoost = 318
        baseBoostRolloff = 3180
        deepBaseRolloff = 7950
      }
    }
  }
}
Copied!

Developers

Testing

For testing that the equalizer produces a correct frequency response, check the "Equalizer Test" page (https://localhost:9000/equalizer.html) hosted in Webpack Dev Server, which plays sine waves at constant amplitudes and renders the FFT.

Class Overview

  • EqualizerPlugin: Player plugin to set up the equalizer and connect it to an instance of DlfMediaPlayer.

    • EqualizerView: User interface for display and manipulation of EQ parameters and presets of an Equalizer.
    • Equalizer: Top-level class for actual equalization. Connects to an AudioContext, adds an FFT node that is used to test the frequency response, loads presets, and delegates to implementations of specific modes/filtersets (BandEq and RiaaEq).

Community

GitHub Repository

All sources of Kitodo.Presentation and other Kitodo software are hosted at GitHub.

If you find a bug, please report it to the Kitodo.Presentation issue tracker on GitHub.

Pull Requests are greatly appreciated! ;-)

Mailing Lists

If you have questions about this extensions or about other Kitodo components you may check the mailing lists of Kitodo:

Please write to the lists in English or German.

Kitodo Consulting

For all other questions about Kitodo, please check the website of Kitodo or contact the Kitodo office by mail to contact@kitodo.org.

Developers

These pages are aimed at developers working on Kitodo.Presentation.

Metadata

Kitodo.Presentation allows a per-tenant configuration of which metadata is extracted from documents, and how it is indexed and displayed.

Formats

A METS document may embed or reference resources in many formats:

  • Within the <mdWrap> tag, it may embed sections of metadata in formats such as MODS or TEIHDR (TEI Header).
  • Via the <FLocat> tag, it may reference fulltext in formats such as ALTO.

Data format records, which are stored on the root page (PID = 0), tell Kitodo how to extract and process these formats, and may be used to define the entries shown in the metadata plugin. A record contains the following fields:

Field

Description

Format Name

Name of the type that is used to reference it.

For metadata embedded via <mdWrap>, this corresponds to its MDTYPE or OTHERMDTYPE attribute.

For XML fulltext files, this corresponds to the capitalized root tag of the file.

Root Element

The XML root element used by this format. In METS, this is used to locate the sub-root within an <mdWrap>.

Namespace URI

The XML namespace URI used by this format. It is registered within the parser and may be used to declare namespace prefixes.

Class Name

(Optional) Fully qualified name of the PHP class that handles the format. Some formats are pre-defined in the Kitodo\Dlf\Format namespace.

For metadata, this is used to programmatically extract values by implementing MetadataInterface. This may be useful, for example, when the value is needed universally, is difficult to extract via XPath, or requires post-processing.

For fulltext, this is used to parse the fulltext file by implementing the FulltextInterface.

TypoScript Wrap

The TypoScript wrap controls how the metadata plugin displays the entries. There are three objects that may be set, each of which is passed to stdWrap with a different aspect of the metadata table.

  • key: First, the (localized) label of the metadata entry, such as "Title" or "Year", is transformed using the key object.
  • value: Each value of the entry is transformed using the value object.
  • all: The combined output (label and values) is processed using the all object and appended to the output (unless there is no value or all processed values are blank).

Finally, all entries are wrapped in a definition list (<dl> tag). If one of the objects is not specified, the unprocessed output is taken as-is.

Displaying Multiple Values

To allow TypoScript wrap to reference metadata values, all configured entries of the current metadata section are set as data before calling stdWrap. The index names are used as key. Whenever there are multiple values, they are joined by the separator that is configured in the metadata plugin.

To see where this is useful, consider the following MODS access condition.

<mods:accessCondition
   xmlns:xlink="http://www.w3.org/1999/xlink"
   type="use and reproduction"
   xlink:href="http://creativecommons.org/licenses/by-sa/4.0/"
>
    CC BY-SA 4.0
</mods:accessCondition>
Copied!

In the metadata table, we may want to render an <a> tag that links to the license summary page and displays the license name as link text. To achieve this, we may create two metadata entries:

  • Create a hidden entry called useandreproduction_link that has xpath set to ./mods:accessCondition[@type="use and reproduction"]/@xlink:href. This entry is used purely to extract the license URL.
  • The main entry sets xpath to ./mods:accessCondition[@type="use and reproduction"] (so it extracts the license name) and uses a wrap along the lines of

    key.wrap = <dt>|</dt>
    value.required = 1
    value.typolink.parameter.field = useandreproduction_link
    value.wrap = <dd>|</dd>
    Copied!

Database Tables

This is a reference of all database tables defined by Kitodo.Presentation.

tx_dlf_actionlog: Action protocol

Extbase domain model: Kitodo\Dlf\Domain\Model\ActionLog

(Basket Plugin) Action log for mails and printouts.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

crdate integer

 

deleted smallint

 

user_id integer

User ID

file_name string

Filename

count_pages integer

Page count

name string

Name

label string

Action protocol

tx_dlf_basket: Basket

Extbase domain model: Kitodo\Dlf\Domain\Model\Basket

(Basket Plugin) A basket that is bound to a frontend session.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

fe_user_id integer

FE user ID

deleted smallint

 

sys_language_uid integer

 

l18n_parent integer

 

l18n_diffsource blob

 

l10n_state text

 

label string

Basket

session_id string

Session ID

doc_ids string

Document ID

tx_dlf_collections: Collections

Extbase domain model: Kitodo\Dlf\Domain\Model\Collection

Domain model of the 'Collection'.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

crdate integer

 

cruser_id integer

 

fe_cruser_id integer

Frontend User

fe_admin_lock smallint

Disallow frontend editing?

deleted smallint

 

sys_language_uid integer

Language

l18n_parent integer

Transl.Orig

l18n_diffsource blob

 

l10n_state text

 

hidden smallint

Hide

fe_group string

Access

label string

Display Label

index_name string

Index Name

index_search text

Define (virtual) collection via Solr Query

oai_name string

OAI-PMH Mapping

description text

Description

thumbnail string

Thumbnail

thumbnail

priority smallint

Priority

documents integer

Documents

owner integer

Owner

status smallint

Status

tx_dlf_documents: Documents

Extbase domain model: Kitodo\Dlf\Domain\Model\Document

Domain model of the 'Document'.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

Last Modified

crdate integer

Created At

cruser_id integer

 

deleted smallint

 

hidden smallint

Hide

starttime integer

Start

endtime integer

Stop

fe_group string

Access

prod_id string

Production Identifier

location string

Location of METS file / IIIF manifest (URI)

record_id string

Record Identifier

opac_id string

OPAC/Local Identifier

union_id string

Union Catalog/Foreign Identifier

urn string

Uniform Resource Name (URN)

purl string

Persistent Uniform Resource Locator (PURL)

title text

Title

title_sorting text

Title (Sorting)

author string

Author

year string

Year of Publication

place string

Place of Publication

thumbnail string

Thumbnail

structure integer

Typ of Document

partof integer

Part of ...

volume string

Number of Volume

volume_sorting string

Number of Volume (Sorting)

license string

License

terms string

Terms of Use

restrictions string

Restrictions on Access

out_of_print text

Out Of Print Works

rights_info text

Rights Information

collections integer

Collections

mets_label text

METS @LABEL

mets_orderlabel text

METS @ORDERLABEL

owner integer

Owner

solrcore integer

 

status smallint

Status

document_format string

METS or IIIF

tx_dlf_formats: Data Formats

Extbase domain model: Kitodo\Dlf\Domain\Model\Format

Configured data formats and namespaces like MODS, ALTO, IIIF etc. They are referenced by tx_dlf_metadataformat.encoded. The formats OAI, METS and XLINK are pre-defined.

Data formats are modeled after XML, though JSON may be used with a pseudo root and namespace.

For more information, see the documentation page on metadata.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

type string

Format Name (e.g. in METS)

Name of the type that is used to reference it.

root string

Root Element

The XML root element used by this format.

namespace string

Namespace URI

The XML namespace URI used by this format.

class string

Class Name

Fully qualified name of the PHP class that handles the format, or the empty string if no such class is configured.

tx_dlf_libraries: Libraries

Extbase domain model: Kitodo\Dlf\Domain\Model\Library

A library institution with the following use cases:

  • Each tx_dlf_document is owned by exactly one tx_dlf_library. The owner is set on indexing, and it is shown in the metadata plugin. If no library is configured, the fallback library is named 'default'.
  • The OAI-PMH plugin has a configuration option library that is used to identify the OAI repository.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

sys_language_uid integer

Language

l18n_parent integer

Transl.Orig

l18n_diffsource blob

 

l10n_state text

 

label string

Name

index_name string

Index Name

website string

Website

contact string

Contact

Contact email address of the library (used as adminEmail in responses to OAI Identify requests).

image string

Logo

image

oai_label string

Open Archives Interface (OAI) Label

The label that is used as repositoryName in responses to OAI Identify requests

oai_base string

Open Archives Interface (OAI) Base URL

OAI base URL used when harvesting the library via kitodo:harvest.

opac_label string

Online Public Access Catalog (OPAC) Label

opac_base string

Online Public Access Catalog (OPAC) Base URL

union_label string

Union Catalog Label

union_base string

Union Catalog Base URL

tx_dlf_mail: Email

Extbase domain model: Kitodo\Dlf\Domain\Model\Mail

(Basket Plugin) Recipient mail addresses for sending documents.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

deleted smallint

 

sorting integer

 

mail string

Address

name string

Name

label string

Email

tx_dlf_metadata: Metadata

Extbase domain model: Kitodo\Dlf\Domain\Model\Metadata

A metadata kind (title, year, ...) and its configuration for display and indexing.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

sys_language_uid integer

Language

l18n_parent integer

Transl.Orig

l18n_diffsource blob

 

l10n_state text

 

hidden smallint

Hide

sorting integer

Order (relative position) of this entry in metadata plugin and backend list.

label string

Display Label

index_name string

Index Name

format integer

Data Format

The formats that encode this metadata (local IRRE field to tx_dlf_metadataformat).

default_value string

Default Value

wrap text

TypoScript-Wrap

index_tokenized smallint

Tokenize in Search Index?

index_stored smallint

Store in Search Index?

index_indexed smallint

Index in Search Index?

index_boost float

Field boost

is_sortable smallint

Prepare for sorting?

is_facet smallint

Prepare for faceting?

is_listed smallint

Show in titledata/listview?

index_autocomplete smallint

Use for search suggestion?

status smallint

Status

tx_dlf_metadataformat: Metadata Format

Extbase domain model: Kitodo\Dlf\Domain\Model\MetadataFormat

This specifies a way how a metadata (tx_dlf_metadata) may be encoded in a specific data format (tx_dlf_format).

For instance, the title of a document may be obtained from either the MODS title field, or from the TEIHDR caption. This is modeled as two tx_dlf_metadaformat that refer to the same tx_dlf_metadata but different tx_dlf_format.

This contains the xpath expressions on the model 'Metadata'.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

l10n_state text

 

parent_id integer

UID of the tx_dlf_metadata that is encoded by this metadata entry.

encoded integer

Encoding

UID of the tx_dlf_format in which this metadata entry is encoded.

xpath string

XPath (relative to //dmdSec/mdWrap/xmlData/root and with namespace) or JSONPath (relative to resource JSON object)

XPath/JSONPath expression to extract the metadata (relative to the data format root).

xpath_sorting string

XPath / JSONPath for sorting (optional)

XPath/JSONPath expression to extract sorting variant (suffixed _sorting) of the metadata.

subentries integer

 

mandatory smallint

Mandatory field?

tx_dlf_metadatasubentries: Metadata

Extbase domain model: Kitodo\Dlf\Domain\Model\MetadataSubentry

This specifies a way how a metadatum (tx_dlf_metadata) may be encoded in a specific data format (tx_dlf_format).

For instance, the title of a document may be obtained from either the MODS title field, or from the TEIHDR caption. This is modeled as two tx_dlf_metadaformat that refer to the same tx_dlf_metadata but different tx_dlf_format.

This contains the xpath expressions on the model 'Metadata'.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

parent_id integer

 

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

sys_language_uid integer

 

l18n_parent integer

 

l18n_diffsource blob

 

label string

Display Label

index_name string

Index Name

xpath string

XPath (relative to //dmdSec/mdWrap/xmlData/root and with namespace) or JSONPath (relative to resource JSON object)

default_value string

Default Value

wrap text

TypoScript-Wrap

tx_dlf_printer: Printer

Extbase domain model: Kitodo\Dlf\Domain\Model\Printer

(Basket Plugin) External printers for sending documents.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

deleted smallint

 

print string

CLI command(##fileName##)

label string

Label

tx_dlf_relations

Pivot table for many-to-many relations between tables. In particular, this is used to match documents and collections by using ident=docs_colls.

Field

Description

uid integer

 

uid_local integer

 

uid_foreign integer

 

tablenames string

 

sorting integer

 

sorting_foreign integer

 

ident string

An identifier to describe which tables are matched.

tx_dlf_solrcores: Solr Cores

Extbase domain model: Kitodo\Dlf\Domain\Model\SolrCore

Cores on the application-wide Solr instance that are available for indexing. They may be used, for example, as a parameter to the CLI indexing commands, and are referenced by tx_dlf_document.solrcore. In particular, this holds the index name of the used Solr core.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

 

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

label string

Display Label

Label of the core that is displayed in the backend.

index_name string

Solr Core

The actual name of the Solr core.

tx_dlf_structures: Structures

Extbase domain model: Kitodo\Dlf\Domain\Model\Structure

Domain model of 'Structure'.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

 

crdate integer

 

cruser_id integer

 

deleted smallint

 

sys_language_uid integer

Language

l18n_parent integer

Transl.Orig

l18n_diffsource blob

 

l10n_state text

 

hidden smallint

Hide

toplevel smallint

Toplevel Unit?

label string

Display Label

index_name string

Index Name

oai_name string

OAI-PMH Mapping

thumbnail integer

Get thumbnail from...

status smallint

Status

tx_dlf_tokens: Tokens

Extbase domain model: Kitodo\Dlf\Domain\Model\Token

Resumption tokens for OAI-PMH interface.

Field

Description

uid integer

The uid of the record. The uid is only unique in the context of the database table.

pid integer

The id of the page the record is "stored".

tstamp integer

Timestamp of the token used to determine if it has expired.

token string

The resumption token string.

options text

Data that is used to resume the previous request.

ident string

Originally an identifier for the kind of token ('oai'). Not used at the moment.

Validation

Validators

DOMDocumentValidationStack

Kitodo\Dlf\Validation\DOMDocumentValidationStack implementation of Kitodo\Dlf\Validation\AbstractDlfValidationStack for validating DOMDocument against the configurable validators.

The configuration is an array validator configurations each with following entries:

className

Fully qualified class name of validator class derived from Kitodo\Dlf\Validation\AbstractDlfValidator

configuration

Specific configuration of validator

XmlSchemasValidator

Kitodo\Dlf\Validation\XmlSchemasValidator combines the configured schemes into one schema and validates the provided DOMDocument against this.

The configuration is an array validator configurations each with following entries:

Key

Description

namespace

Specifies the URI of the namespace to import

schemaLocation

Specifies the URI to the schema for the imported namespace

SaxonXslToSvrlValidator

Kitodo\Dlf\Validation\SaxonXslToSvrlValidator validates the DOMDocument against an XSL Schematron and converts error output to validation errors.

To use the validator, the XSL Schematron must be available alongside the XSL processor as a JAR file, and the required Java version of the processor must be installed.

Key

Description

jar

Absolute path to the Saxon JAR file

xsl

Absolute path to the XSL Schematron

DOMDocumentValidation Middleware

Kitodo\Dlf\Validation\DOMDocumentValidation middleware must be used by setting the middleware parameter to dlf/domDocumentValidation. Additionally, the url parameter must contain the URL of the DOMDocument content to be validated, and the type parameter must specify the corresponding validation configuration type.

Configuration

The validation middleware can be configured through the plugin settings in TypoScript with the block called domDocumentValidation. Under this block, configuration sections (referred to as type) for different validations can be defined. When directly referencing the middleware or using the Validation Form, this type must be provided as the type parameter.

plugin.tx_dlf {
    settings {
        domDocumentValidation {
            typeA {
               validator {
                  ...
               },
               validatorStack {
                  ...
               },
               ...
            },
            typeB {
               ...
            },
            ...
Copied!

Validators derived from Kitodo\Dlf\Validation\AbstractDlfValidator can be configured here. This also includes the use of validation stack implementations derived from Kitodo\Dlf\Validation\AbstractDlfValidationStack, which use DOMDocument as the valueClassName for validation. This allows for multiple levels of nesting.

In the background of the middleware, the Kitodo\Dlf\Validation\DOMDocumentValidationStack is used, to which the configured validators are assigned.

For each validator, the title and description can be defined as XLF labels and are returned in the response according to the selected site language.

The description label can include placeholders. The syntax changes slightly in this case: a separate block is used for the description, consisting of the XLF label as the key and an additional block containing arguments. These arguments are then inserted into the placeholders within the label in the given order. The EXT: prefix can also be used as an argument value, which will be replaced with the corresponding extension path.

plugin.tx_dlf {
    settings {
       domDocumentValidation {
           typeA {
              10 {
                 title = LLL:EXT:.../locallang.xlf:title
                 description = LLL:EXT:.../locallang.xlf:description
              }
              ...
           },
           typeB {
                10 {
                    title = LLL:EXT:.../locallang.xlf:title
                    description {
                        key = LLL:EXT:.../locallang.xlf:description
                        arguments {
                            0 = EXT:...
                            1 = Test
                            ...
                        }
                    }
                    ...
Copied!

TypoScript Example

plugin.tx_dlf {
    settings {
        storagePid = {$config.storagePid}
        domDocumentValidation {
            dfgviewer {
                 10 {
                     title = LLL:EXT:dfgviewer/Resources/Private/Language/locallang_validation.xlf:validator.xmlschemas.title
                     description {
                         key = LLL:EXT:dfgviewer/Resources/Private/Language/locallang_validation.xlf:validator.xmlschemas.description
                         arguments {
                             0 = EXT:dfgviewer/Resources/Public/Xsd/Mets/1.12.1.xsd
                             1 = METS 1.12.1
                             2 = EXT:dfgviewer/Resources/Public/Xsd/Mods/3.8.xsd
                             3 = MODS 3.8
                         }
                     }
                     className = Kitodo\Dlf\Validation\XmlSchemasValidator
                     configuration {
                        mets {
                            namespace = http://www.loc.gov/METS/
                            schemaLocation = EXT:dfgviewer/Resources/Public/Xsd/Mets/1.12.1.xsd
                        }
                        mods {
                            namespace = http://www.loc.gov/mods/v3
                            schemaLocation = EXT:dfgviewer/Resources/Public/Xsd/Mods/3.8.xsd
                        }
                    }
                 },
                 ...
            }
            ...
Copied!

Embedded 3D Viewer

The model-viewer is installed as the built-in standard viewer and supports ‘glTF/GLB 3D models’ as the model file format. Alternatively you can use one or multiple custom viewer implementations or our reference implementations from the GitHub repository slub/dlf-3d-viewers. On this page, you will find all the information needed to configure and embed any 3D Viewer implementation for Kitodo.Presentation.

Setup

  • Add folder with name dlf_3d_viewers in your default storage
  • Add a subfolder with name of your custom 3D viewer (see Custom Viewer) e.g. 3dviewer or use one or more viewer folders of our reference implementation in GitHub Repository slub/dlf-3d-viewers.

Configuration

By default, the viewers from the folder dlf_3d_viewers are all active and can be accessed and tested via URL.

For this, only the parameter tx_dlf[viewer] with the encoded subfolder name of the viewer needs to be passed to the URL where the plugin plugin.tx_dlf_embedded3dViewer is rendered.

To render the model, the encoded URL to the METS document should be set using the parameter tx_dlf[id]. Alternatively, it is possible to define the model directly with an encoded URL via the parameter tx_dlf[model].

Automatic selection of the viewer

Under the configuration of the dlf extension, you will find a tab to configure embedded 3D viewer implementation for automatic selection of 3D viewer.

With the configuration field "Viewer model format mapping," you can define a list of considered viewers from the dlf_3d_viewers folder along with their associated model formats. If there are multiple viewers that support the same model format, you can decide here which one is responsible for the specific format.

Additionally, a default viewer can be set, which serves as a fallback for all model formats that have not been mapped.

Custom Viewer

Viewers can be added and customized depending on the use case. A viewer is a folder with the name of the viewer that contains a dlf-3d-viewer.yml file and at least one HTML file. A reference implementation of various 3D viewers for integration into Kitodo.Presentation can be found on GitHub in Repository slub/dlf-3d-viewers.

dlf-3d-viewer.yml

To configure the 3D viewer for Kitodo.Presentation, a dlf-3d-viewer.yml file must be present in the viewer directory.

Key

Description

base

Specify the name of the HTML file in which the viewer will be displayed. (Default is index.html)

supportedModelFormats (required)

Specify single or multiple supported model formats of the viewer.

Example

defaultStorage/dlf_3d_viewers/3dviewer/dlf-3d-viewer.yml
viewer:
 base: main.html
 supportedModelFormats:
   - glf
   - ply
Copied!

Placeholders

Placeholders can be used within the file which is define under the base key of dlf-3d-viewer.yml. The notation for placeholders is {{placeholderName}}. The following placeholders are available:

Name

Description

viewerPath

Path to the viewer directory located inside the dlf_3d_viewers folder. For example "fileadmin/dlf_3d_viewers/3dviewer/".

modelUrl

The fileserver where your resource is hosted. For example "https://example.com/my-model.glb".

modelPath

Part of the modelUrl where your resource is hosted. For example, if your resource is hosted at "https://example.com/my-model.glb", the value would be "https://example.com/static/models/".

modelResource

Resource part of the modelUrl with the filename to be loaded from the endpoint. For example, if your resource is hosted at "https://example.com/my-model.glb", the value would be "my-model.glb".