Skip to content

Commit 64c6835

Browse files
Move nonProxyMimeTypes to config
1 parent f2d9898 commit 64c6835

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

Classes/Common/Doc.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,6 @@ abstract class Doc
7575
*/
7676
public static $extKey = 'dlf';
7777

78-
/**
79-
* MIME types that are excluded from PageViewProxy.
80-
*
81-
* TODO: Consider moving this to extension configuration
82-
*
83-
* @var string[]
84-
* @access public
85-
*/
86-
public static $nonProxyMimeTypes = [
87-
'application/vnd.kitodo.iiif',
88-
'application/vnd.netfpx',
89-
'application/vnd.kitodo.zoomify',
90-
];
91-
9278
/**
9379
* This holds the configuration for all supported metadata encodings
9480
* @see loadFormats()
@@ -1388,9 +1374,12 @@ public function toArray($uriBuilder, array $config = [])
13881374
}
13891375
}
13901376

1377+
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey);
1378+
$nonProxyMimeTypes = GeneralUtility::trimExplode(',', $extConf['nonProxyMimeTypes']);
1379+
13911380
// Only deliver static images via the internal PageViewProxy.
13921381
// (For IIP and IIIF, the viewer needs to build and access a separate metadata URL, see `getMetadataURL`.)
1393-
if (in_array($fileGrp, $proxyFileGroups) && !in_array($file['mimetype'], self::$nonProxyMimeTypes)) {
1382+
if (in_array($fileGrp, $proxyFileGroups) && !in_array($file['mimetype'], $nonProxyMimeTypes)) {
13941383
// Configure @action URL for form.
13951384
$file['url'] = $uriBuilder
13961385
->reset()

Resources/Private/Language/Labels.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
<label index="config.caching">Cache parsed METS files / IIIF manifests: Caching improves performance a little bit but can result in a very large "fe_session_data" table (default is "FALSE")</label>
181181
<label index="config.publishNewCollections">Publish new collections?: Should new collections automatically be published in the OAI-PMH interface? (default is "TRUE")</label>
182182
<label index="config.unhideOnIndex">Unhide indexed documents?: Should hidden documents be unhidden when re-indexing them? (default is "FALSE")</label>
183+
<label index="config.nonProxyMimeType">Non proxy MIME types: comma-separated list (default is "application/vnd.kitodo.iiif,application/vnd.netfpx,application/vnd.kitodo.zoomify")</label>
183184
<label index="config.useExternalApisForMetadata">Use external APIs for getting metadata?: (default is "FALSE")</label>
184185
<label index="config.fileGrpImages">Page fileGrps: comma-separated list of @USE attribute values ordered by increasing size (default is "DEFAULT,MAX")</label>
185186
<label index="config.fileGrpThumbs">Thumbnail fileGrp: comma-separated list of @USE attribute values ordered by decreasing priority (default is "THUMBS")</label>
@@ -391,6 +392,7 @@
391392
<label index="config.caching">Eingelesene METS Dateien / IIIF-Manifeste zwischenspeichern: Dies kann die Geschwindigkeit geringfügig verbessern, führt aber zu einer sehr großen "fe_session_data" Tabelle (Standard ist "FALSE")</label>
392393
<label index="config.publishNewCollections">Neue Kollektionen publizieren?: Sollen neue Kollektionen automatisch in der OAI-PMH-Schnittstelle veröffentlicht werden? (Standard ist "TRUE")</label>
393394
<label index="config.unhideOnIndex">Indexierte Dokumente einblenden?: Sollen ausgeblendete Dokumente bei der erneuten Indexierung wieder eingeblendet werden? (Standard ist "FALSE")</label>
395+
<label index="config.nonProxyMimeType">MIME Typen ohne Proxy: Komma-getrennte Liste (Standard ist "application/vnd.kitodo.iiif,application/vnd.netfpx,application/vnd.kitodo.zoomify")</label>
394396
<label index="config.useExternalApisForMetadata">Verwende externe APIs zum Abrufen von Metadaten?: (Standard ist "FALSE")</label>
395397
<label index="config.fileGrpImages">Seiten fileGrps: Komma-getrennte Liste der @USE Attributwerte der Seitenansichten nach aufsteigender Größe sortiert (Standard ist "DEFAULT,MAX")</label>
396398
<label index="config.fileGrpThumbs">Vorschau fileGrp: Komma-getrennte Liste der @USE Attributwerte der Vorschaubilder nach absteigender Priorität sortiert (Standard ist "THUMBS")</label>

ext_conf_template.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ caching = 0
1212
publishNewCollections = 1
1313
# cat=Basic; type=boolean; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.unhideOnIndex
1414
unhideOnIndex = 0
15+
# cat=Basic; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.nonProxyMimeType
16+
nonProxyMimeType = application/vnd.kitodo.iiif,application/vnd.netfpx,application/vnd.kitodo.zoomify
1517
# cat=Basic; type=boolean; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.useExternalApisForMetadata
1618
useExternalApisForMetadata = 0
1719
# cat=Files; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.fileGrpImages

0 commit comments

Comments
 (0)