forked from digicademy/svsal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iiif-in.xql
19 lines (14 loc) · 1.07 KB
/
iiif-in.xql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
xquery version "3.1";
import module namespace config = "http://www.salamanca.school/xquery/config" at "modules/config.xqm";
import module namespace iiif = "http://www.salamanca.school/xquery/iiif" at "modules/iiif.xqm";
import module namespace console = "http://exist-db.org/xquery/console";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare namespace request = "http://exist-db.org/xquery/request";
declare namespace response = "http://exist-db.org/xquery/response";
declare option output:method "json";
declare option output:media-type "application/json";
let $facsDomain := $config:imageserver
let $canvasId := request:get-parameter('canvasId', $facsDomain || '/iiif/presentation/W0015/canvas/p1')
let $header-addition := response:set-header("Access-Control-Allow-Origin", "*")
let $debug := if ($config:debug = ("trace", "info")) then console:log("iiif resolver running, requested canvasId '" || $canvasId || "'.") else ()
return iiif:getPageId($canvasId)