From aa2dabc2fad39d27aabeff05ae5876c8017b8bab Mon Sep 17 00:00:00 2001 From: Peter Stadler Date: Thu, 7 Dec 2023 15:58:20 +0100 Subject: [PATCH] update database variable and update output options --- modules/tools/batch_transform.xq | 10 ++++++---- modules/tools/batch_transform_list.xq | 8 +++++--- modules/tools/batch_transform_settings.xq | 4 +++- modules/tools/list_incipit_graphics.xq | 8 ++++++-- modules/tools/list_source_provenance.xq | 8 ++++++-- modules/tools/list_text_incipits.xq | 8 ++++++-- modules/tools/location_index.xq | 10 +++++++--- modules/tools/name_index.xq | 8 ++++++-- modules/tools/name_index_step1.xq | 8 ++++++-- modules/tools/name_index_step2.xq | 8 ++++++-- modules/tools/opus_index.xq | 8 ++++++-- modules/tools/performance_city_index.xq | 8 ++++++-- modules/tools/provenance_index.xq | 8 ++++++-- modules/tools/select.xq | 10 ++++++---- modules/tools/select_generator.xq | 10 ++++++---- modules/tools/select_generator_cnw.xq | 8 ++++++-- modules/tools/text_author_index.xq | 8 ++++++-- modules/tools/title_index.xq | 8 ++++++-- 18 files changed, 105 insertions(+), 43 deletions(-) diff --git a/modules/tools/batch_transform.xq b/modules/tools/batch_transform.xq index f6d530c7..31dd4ac0 100644 --- a/modules/tools/batch_transform.xq +++ b/modules/tools/batch_transform.xq @@ -1,8 +1,5 @@ xquery version "1.0" encoding "UTF-8"; -import module namespace login="http://kb.dk/this/login" at "../login.xqm"; -import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; - declare namespace request="http://exist-db.org/xquery/request"; declare namespace response="http://exist-db.org/xquery/response"; declare namespace transform="http://exist-db.org/xquery/transform"; @@ -12,11 +9,16 @@ declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; declare namespace xdb="http://exist-db.org/xquery/xmldb"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace login="http://kb.dk/this/login" at "../login.xqm"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; + +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; declare variable $coll := request:get-parameter("coll", "") cast as xs:string; declare variable $query := request:get-parameter("query","") cast as xs:string; diff --git a/modules/tools/batch_transform_list.xq b/modules/tools/batch_transform_list.xq index c37d01ee..b4bc56dd 100644 --- a/modules/tools/batch_transform_list.xq +++ b/modules/tools/batch_transform_list.xq @@ -1,7 +1,5 @@ xquery version "1.0" encoding "UTF-8"; -import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; - declare namespace xl="http://www.w3.org/1999/xlink"; declare namespace request="http://exist-db.org/xquery/request"; declare namespace response="http://exist-db.org/xquery/response"; @@ -10,11 +8,15 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; + +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; declare variable $coll := request:get-parameter("coll","") cast as xs:string; declare variable $query := request:get-parameter("query","") cast as xs:string; diff --git a/modules/tools/batch_transform_settings.xq b/modules/tools/batch_transform_settings.xq index 16689bc9..9fb93c3a 100644 --- a/modules/tools/batch_transform_settings.xq +++ b/modules/tools/batch_transform_settings.xq @@ -1,10 +1,12 @@ xquery version "1.0" encoding "UTF-8"; declare namespace request="http://exist-db.org/xquery/request"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare option exist:serialize "method=xml media-type=text/html;charset=UTF-8"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; declare variable $coll := request:get-parameter("coll", "") cast as xs:string; declare variable $query := request:get-parameter("query","") cast as xs:string; diff --git a/modules/tools/list_incipit_graphics.xq b/modules/tools/list_incipit_graphics.xq index c045174c..8c5bb4fd 100644 --- a/modules/tools/list_incipit_graphics.xq +++ b/modules/tools/list_incipit_graphics.xq @@ -9,13 +9,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); (: desired resolution; MerMEId supports values "lowres", "hires", and "print" :) declare variable $resolution := request:get-parameter("res","lowres"); diff --git a/modules/tools/list_source_provenance.xq b/modules/tools/list_source_provenance.xq index 12cb5bc6..7c3ad9e8 100644 --- a/modules/tools/list_source_provenance.xq +++ b/modules/tools/list_source_provenance.xq @@ -9,13 +9,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); diff --git a/modules/tools/list_text_incipits.xq b/modules/tools/list_text_incipits.xq index 66280718..a8889e7c 100644 --- a/modules/tools/list_text_incipits.xq +++ b/modules/tools/list_text_incipits.xq @@ -9,13 +9,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); (: desired resolution; MerMEId supports values "lowres", "hires", and "print" :) declare variable $resolution := "lowres"; diff --git a/modules/tools/location_index.xq b/modules/tools/location_index.xq index 0f02dad1..5d1f925e 100644 --- a/modules/tools/location_index.xq +++ b/modules/tools/location_index.xq @@ -10,14 +10,18 @@ declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; declare namespace marc="http://www.loc.gov/MARC21/slim"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; -declare variable $rism_dir := "/db/rism_sigla"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; +declare variable $rism_dir := $config:app-root || "/rism_sigla"; declare variable $country_codes := doc(concat($rism_dir,'/RISM_country_codes.xml')); declare variable $collection := request:get-parameter("c",""); diff --git a/modules/tools/name_index.xq b/modules/tools/name_index.xq index 2d893ea9..7b56240d 100644 --- a/modules/tools/name_index.xq +++ b/modules/tools/name_index.xq @@ -11,13 +11,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); diff --git a/modules/tools/name_index_step1.xq b/modules/tools/name_index_step1.xq index fbc8c586..77a141d9 100644 --- a/modules/tools/name_index_step1.xq +++ b/modules/tools/name_index_step1.xq @@ -9,13 +9,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); diff --git a/modules/tools/name_index_step2.xq b/modules/tools/name_index_step2.xq index 85d95567..f756ac02 100644 --- a/modules/tools/name_index_step2.xq +++ b/modules/tools/name_index_step2.xq @@ -11,13 +11,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); declare variable $names := diff --git a/modules/tools/opus_index.xq b/modules/tools/opus_index.xq index 379b7752..745d11bf 100644 --- a/modules/tools/opus_index.xq +++ b/modules/tools/opus_index.xq @@ -7,13 +7,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); (: the separator used for opus sub-numbers, e.g. Opus 27:2 :) declare variable $separator := request:get-parameter("separator",":"); diff --git a/modules/tools/performance_city_index.xq b/modules/tools/performance_city_index.xq index 8af9889c..c475da18 100644 --- a/modules/tools/performance_city_index.xq +++ b/modules/tools/performance_city_index.xq @@ -10,13 +10,17 @@ declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; declare namespace marc="http://www.loc.gov/MARC21/slim"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); diff --git a/modules/tools/provenance_index.xq b/modules/tools/provenance_index.xq index d916e152..44ab9aaa 100644 --- a/modules/tools/provenance_index.xq +++ b/modules/tools/provenance_index.xq @@ -11,13 +11,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); declare variable $invert := request:get-parameter("invert","false"); diff --git a/modules/tools/select.xq b/modules/tools/select.xq index 1d9361fb..681801f6 100644 --- a/modules/tools/select.xq +++ b/modules/tools/select.xq @@ -5,8 +5,6 @@ xquery version "1.0" encoding "UTF-8"; declare namespace loop="http://kb.dk/this/getlist"; -import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; - declare namespace request="http://exist-db.org/xquery/request"; declare namespace response="http://exist-db.org/xquery/response"; declare namespace fn="http://www.w3.org/2005/xpath-functions"; @@ -14,13 +12,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; + +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; -declare variable $database := $config:data-public-root; +declare variable $database := $config:data-root; declare variable $coll := request:get-parameter("c","HartW"); diff --git a/modules/tools/select_generator.xq b/modules/tools/select_generator.xq index 96303789..15508659 100644 --- a/modules/tools/select_generator.xq +++ b/modules/tools/select_generator.xq @@ -3,8 +3,6 @@ xquery version "1.0" encoding "UTF-8"; (: A script to generate select boxes for searching by keys such as opus numbers numbers or names. :) (: The generated code needs to be cleaned manually, though :) -import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; - declare namespace loop="http://kb.dk/this/getlist"; declare namespace request="http://exist-db.org/xquery/request"; @@ -14,13 +12,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; + +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; -declare variable $database := $config:data-public-root; +declare variable $database := $config:data-root; declare variable $coll := request:get-parameter("c","HartW"); diff --git a/modules/tools/select_generator_cnw.xq b/modules/tools/select_generator_cnw.xq index c7112ca4..208b429e 100644 --- a/modules/tools/select_generator_cnw.xq +++ b/modules/tools/select_generator_cnw.xq @@ -12,13 +12,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/cnw/data"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare function loop:clean-names ($key as xs:string) as xs:string diff --git a/modules/tools/text_author_index.xq b/modules/tools/text_author_index.xq index 43db6c09..bf9f785b 100644 --- a/modules/tools/text_author_index.xq +++ b/modules/tools/text_author_index.xq @@ -11,13 +11,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c",""); diff --git a/modules/tools/title_index.xq b/modules/tools/title_index.xq index fa1fa085..4ace93ad 100644 --- a/modules/tools/title_index.xq +++ b/modules/tools/title_index.xq @@ -7,13 +7,17 @@ declare namespace file="http://exist-db.org/xquery/file"; declare namespace util="http://exist-db.org/xquery/util"; declare namespace ft="http://exist-db.org/xquery/lucene"; declare namespace ht="http://exist-db.org/xquery/httpclient"; +declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization"; declare namespace local="http://kb.dk/this/app"; declare namespace m="http://www.music-encoding.org/ns/mei"; -declare option exist:serialize "method=xml media-type=text/html"; +import module namespace config="https://github.com/edirom/mermeid/config" at "../config.xqm"; -declare variable $database := "/db/dcm"; +declare option output:method "xhtml5"; +declare option output:media-type "text/html"; + +declare variable $database := $config:data-root; declare variable $collection := request:get-parameter("c","");