Skip to content

Commit

Permalink
Update app.xql
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 authored Feb 1, 2021
1 parent f52d303 commit 6bb8b34
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modules/app.xql
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,15 @@ declare function app:firstDoc($node as node(), $model as map(*)) {
};

(:~
: fetches html snippets from ACDH's imprint service; Make sure you'll have $app:redmineBaseUrl and $app:redmineID set
:)
: fetches html snippets from ACDH's imprint service; Make sure you'll have $app:redmineBaseUrl and $app:redmineID set, you can pass in a 'lang' param as URL-param to switch between "de" (default) and "en"a
:)
declare function app:fetchImprint($node as node(), $model as map(*)) {
let $url := $app:redmineBaseUrl||$app:redmineID
let $request :=
<http:request href="{$url}" method="GET"/>
let $response := http:send-request($request)
return $response[2]
let $lang := request:get-parameter("lang", "de")
let $url := $app:redmineBaseUrl||$app:redmineID||"&amp;outputLang="||$lang
let $payload :=
<div>
{doc($url)}
</div>

return $payload
};

0 comments on commit 6bb8b34

Please sign in to comment.