diff --git a/data/doc/documentation.xml b/data/doc/documentation.xml index 4c0b4fb0..a41a0a86 100644 --- a/data/doc/documentation.xml +++ b/data/doc/documentation.xml @@ -4490,6 +4490,33 @@ declare function config:collection-config($collection as xs:string?, $docUri as For apps created with TEI Publisher 6 updating to 7 or 8 requires only small modifications. Migrating from earlier versions, like 4 or 5, requires more effort, and is described in futher sections. +
+ Upgrading from TEI Publisher 9.0 to 9.1 + This bug fix release is mainly relevant for Windows users running eXist-db directly (i.e. not via docker). The biggest change is the upgrade of + tei-publisher-lib: version 4.0.0 of the library introduced the possibility to directly reference variables and functions defined in TEI Publisher's main + configuration module (modules/config.xqm). While this is unproblematic in most environments, it causes a silent failure in windows + when compiling an ODD. The underlying reason is that config.xqm itself imports a large number of other modules, leading to + recursive imports, which eXist-db is currently unable to resolve properly on Windows. + In general, importing all of config.xqm into the ODD generated code is usually unnecessary as most of the settings are not needed and creates an + overhead. Version 4.0.1 of tei-publisher-lib therefore no longer imports config.xqm by default. Instead, you can configure the modules to be made + available via odd/configuration.xml (or resources/odd/configuration.xml). By default, TEI Publisher 9.1 imports the dedicated + modules/odd-global.xqm. + To update follow the generic instructions above. + + + If your ODD was using $global anywhere, copy modules/odd-global.xqm from TEI Publisher 9.1 into the corresponding location of your app. Open the + module to check if the settings still match your custom application (e.g. if data-root is correct). + + + Change your resources/odd/configuration.xml to include the module declaration: + + + + ... +]]> + + +
Upgrading from TEI Publisher 8 to 9 To upgrade a custom application generated with TEI Publisher 8 to version 9, we recommend to have the source code of both, TEI Publisher 9 and the diff --git a/modules/lib/api/generate.xql b/modules/lib/api/generate.xql index 5ba1fe80..9dbeb5eb 100644 --- a/modules/lib/api/generate.xql +++ b/modules/lib/api/generate.xql @@ -363,7 +363,7 @@ declare function deploy:expand($collection as xs:string, $resource as xs:string, declare function deploy:store-libs($target as xs:string, $userData as xs:string+, $permissions as xs:string) { let $path := $config:app-root || "/modules" - for $lib in ("map.xql", "facets.xql", "registers.xql", "annotation-config.xqm", "nlp-config.xqm", "iiif-config.xqm", xmldb:get-child-resources($path)[starts-with(., "navigation")], + for $lib in ("map.xql", "facets.xql", "registers.xql", "annotation-config.xqm", "nlp-config.xqm", "iiif-config.xqm", "odd-global.xqm", xmldb:get-child-resources($path)[starts-with(., "navigation")], xmldb:get-child-resources($path)[starts-with(., "query")]) return ( xmldb:copy-resource($path, $lib, $target || "/modules", $lib) diff --git a/modules/odd-global.xqm b/modules/odd-global.xqm new file mode 100644 index 00000000..871950cf --- /dev/null +++ b/modules/odd-global.xqm @@ -0,0 +1,31 @@ +xquery version "3.1"; + +module namespace config="http://e-editiones.org/tei-publisher/odd-global"; + +(: + Determine the application root collection from the current module load path. +:) +declare variable $config:app-root := + let $rawPath := system:get-module-load-path() + let $modulePath := + (: strip the xmldb: part :) + if (starts-with($rawPath, "xmldb:exist://")) then + if (starts-with($rawPath, "xmldb:exist://embedded-eXist-server")) then + substring($rawPath, 36) + else + substring($rawPath, 15) + else + $rawPath + return + substring-before($modulePath, "/modules") +; + +(:~ + : The root of the collection hierarchy containing data. + :) +declare variable $config:data-root := $config:app-root || "/data"; + +(:~ + : The root of the collection hierarchy containing registers data. + :) +declare variable $config:register-root := $config:data-root || "/registers"; \ No newline at end of file diff --git a/odd/configuration.xml b/odd/configuration.xml index 8e27152b..2d4573e9 100644 --- a/odd/configuration.xml +++ b/odd/configuration.xml @@ -10,6 +10,8 @@ The "odd" is defined by its name, without the .odd suffix. --> + + "article" diff --git a/templates/basic/resources/odd/configuration.xml b/templates/basic/resources/odd/configuration.xml index 63e6de84..0e58757e 100644 --- a/templates/basic/resources/odd/configuration.xml +++ b/templates/basic/resources/odd/configuration.xml @@ -13,6 +13,8 @@ to the modules/ collection. --> + +