Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
b292314b
Commit
b292314b
authored
Oct 04, 2019
by
Mathias Goebel
Browse files
add an API to test for available images for index data
parent
5cc60823
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/index-api.xqm
View file @
b292314b
...
...
@@ -4,7 +4,7 @@ xquery version "3.1";
: given page.
:
: @author Mathias Göbel
: @version 1.
0
: @version 1.
1
: @since 2.5.6
: :)
...
...
@@ -285,3 +285,25 @@ return
}
}
};
(:~
: Returns available image from TextGrid Repository
: @param $id the xml:id of an entity in the database
: @return an array of URIs
:)
declare
%rest:GET
%rest:path("/api/index/image/{$type}/{$id}")
%output:method("json")
%test:arg("id", "Arnoldi-Denkmal")
%test:assertTrue
function index:rendered-entity($type as xs:string, $id as xs:string)
as item()* {
let $request := <hc:request method="get" href="https://textgridlab.org/1.0/tgsearch-public/search/?q=(title:%22{$type}:{$id}%22)" />
let $tgsearch := hc:send-request($request)[2]
return
[
$tgsearch//tgmd:textgridUri/string()
]
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment