Skip to content
Snippets Groups Projects
Commit 6ea41e04 authored by Nikolaos Beer's avatar Nikolaos Beer
Browse files

Hide source image previews of restricted sources in annotation view, see #7

parent 1c673809
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@ import module namespace edition="http://www.edirom.de/xquery/edition" at "../xqm
import module namespace functx = "http://www.functx.com" at "../xqm/functx-1.0-nodoc-2007-01.xq";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace exist="http://exist.sourceforge.net/NS/exist";
declare namespace request="http://exist-db.org/xquery/request";
declare namespace mei="http://www.music-encoding.org/ns/mei";
......@@ -348,12 +350,23 @@ declare function local:toJSON($type as xs:string, $label as xs:string, $mdiv as
$page as xs:string?, $source as xs:string, $siglum as xs:string?, $digilibBaseParams as xs:string?,
$digilibSizeParams as xs:string?, $hiddenData as xs:string?, $content as xs:string?, $linkUri as xs:string?) as xs:string {
let $digilibURL := concat($digilibBaseParams, 'dw=600&dh=600', $digilibSizeParams)
let $single-serv-registerURL := doc('xmldb:exist:///db/apps/mriExistDBconf/config.xml')//conf:single-serv-registerURL/string()
let $singel-serv-resolveURL := doc('xmldb:exist:///db/apps/mriExistDBconf/config.xml')//conf:single-serv-resolveURL/string()
let $docuservURL := doc('xmldb:exist:///db/apps/mriExistDBconf/config.xml')//conf:docuservURL/string()
let $docuservURLinternal := doc('xmldb:exist:///db/apps/mriExistDBconf/config.xml')//conf:docuservURLinternal/string()
let $singleURL := if (matches($digilibBaseParams, 'music/editions'))
let $configResource := doc('xmldb:exist:///db/apps/mriExistDBconf/config.xml')
let $sourcesRestricted := doc($configResource//conf:sourcesRestricted/text())//mei:source/@corresp/string()
let $sourcesHidden := doc($configResource//conf:sourcesHidden/text())//mei:source/@corresp/string()
let $docuservLockedSourcePath := $configResource//conf:docuservLockedSourcePath/text()
let $docuservURL := $configResource//conf:docuservURL/string()
let $env := $configResource//conf:env/text()
let $digilibURL :=
if ($env = ('dev', 'stage'))
then (concat($digilibBaseParams, 'dw=600&dh=600', $digilibSizeParams))
else if (exists($sourcesRestricted) and not(functx:contains-any-of($digilibBaseParams, ($sourcesRestricted))))
then (concat($digilibBaseParams, 'dw=600&dh=600', $digilibSizeParams))
else (concat($docuservURL, $docuservLockedSourcePath, '?dw=600&dh=600&mo=fit'))
let $single-serv-registerURL := $configResource//conf:single-serv-registerURL/string()
let $singel-serv-resolveURL := $configResource//conf:single-serv-resolveURL/string()
let $docuservURLinternal := $configResource//conf:docuservURLinternal/string()
let $singleURL :=
if (matches($digilibBaseParams, 'music/editions'))
then
try {
(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment