Skip to content

Commit

Permalink
Move nonProxyMimeTypes to config
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Feb 16, 2023
1 parent a0d8004 commit c794dec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
19 changes: 4 additions & 15 deletions Classes/Common/Doc.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@ abstract class Doc
*/
public static $extKey = 'dlf';

/**
* MIME types that are excluded from PageViewProxy.
*
* TODO: Consider moving this to extension configuration
*
* @var string[]
* @access public
*/
public static $nonProxyMimeTypes = [
'application/vnd.kitodo.iiif',
'application/vnd.netfpx',
'application/vnd.kitodo.zoomify',
];

/**
* This holds the configuration for all supported metadata encodings
* @see loadFormats()
Expand Down Expand Up @@ -1388,9 +1374,12 @@ public function toArray($uriBuilder, array $config = [])
}
}

$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey);
$nonProxyMimeTypes = GeneralUtility::trimExplode(',', $extConf['nonProxyMimeTypes']);

// Only deliver static images via the internal PageViewProxy.
// (For IIP and IIIF, the viewer needs to build and access a separate metadata URL, see `getMetadataURL`.)
if (in_array($fileGrp, $proxyFileGroups) && !in_array($file['mimetype'], self::$nonProxyMimeTypes)) {
if (in_array($fileGrp, $proxyFileGroups) && !in_array($file['mimetype'], $nonProxyMimeTypes)) {
// Configure @action URL for form.
$file['url'] = $uriBuilder
->reset()
Expand Down
2 changes: 2 additions & 0 deletions Resources/Private/Language/Labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<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>
<label index="config.publishNewCollections">Publish new collections?: Should new collections automatically be published in the OAI-PMH interface? (default is "TRUE")</label>
<label index="config.unhideOnIndex">Unhide indexed documents?: Should hidden documents be unhidden when re-indexing them? (default is "FALSE")</label>
<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>
<label index="config.useExternalApisForMetadata">Use external APIs for getting metadata?: (default is "FALSE")</label>
<label index="config.fileGrpImages">Page fileGrps: comma-separated list of @USE attribute values ordered by increasing size (default is "DEFAULT,MAX")</label>
<label index="config.fileGrpThumbs">Thumbnail fileGrp: comma-separated list of @USE attribute values ordered by decreasing priority (default is "THUMBS")</label>
Expand Down Expand Up @@ -391,6 +392,7 @@
<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>
<label index="config.publishNewCollections">Neue Kollektionen publizieren?: Sollen neue Kollektionen automatisch in der OAI-PMH-Schnittstelle veröffentlicht werden? (Standard ist "TRUE")</label>
<label index="config.unhideOnIndex">Indexierte Dokumente einblenden?: Sollen ausgeblendete Dokumente bei der erneuten Indexierung wieder eingeblendet werden? (Standard ist "FALSE")</label>
<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>
<label index="config.useExternalApisForMetadata">Verwende externe APIs zum Abrufen von Metadaten?: (Standard ist "FALSE")</label>
<label index="config.fileGrpImages">Seiten fileGrps: Komma-getrennte Liste der @USE Attributwerte der Seitenansichten nach aufsteigender Größe sortiert (Standard ist "DEFAULT,MAX")</label>
<label index="config.fileGrpThumbs">Vorschau fileGrp: Komma-getrennte Liste der @USE Attributwerte der Vorschaubilder nach absteigender Priorität sortiert (Standard ist "THUMBS")</label>
Expand Down
2 changes: 2 additions & 0 deletions ext_conf_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ caching = 0
publishNewCollections = 1
# cat=Basic; type=boolean; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.unhideOnIndex
unhideOnIndex = 0
# cat=Basic; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.nonProxyMimeType
nonProxyMimeType = application/vnd.kitodo.iiif,application/vnd.netfpx,application/vnd.kitodo.zoomify
# cat=Basic; type=boolean; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.useExternalApisForMetadata
useExternalApisForMetadata = 0
# cat=Files; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.fileGrpImages
Expand Down

0 comments on commit c794dec

Please sign in to comment.