From 764501e7287deb618da51d0c9d8c71b5d1df420a Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Sat, 23 Feb 2019 13:11:17 -0500 Subject: [PATCH 1/3] [bugfix] Fix display of older versions of apps --- modules/app.xql | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/app.xql b/modules/app.xql index b9af900..942d70b 100644 --- a/modules/app.xql +++ b/modules/app.xql @@ -17,7 +17,7 @@ declare function app:list-packages($node as node(), $model as map(*), $mode as x let $show-details := false() order by lower-case($app/title) return - app:package-to-list-item($app, $show-details) + app:package-to-list-item($app, $app/version, $show-details) }; declare function app:view-package($node as node(), $model as map(*), $mode as xs:string?) { @@ -47,10 +47,11 @@ declare function app:view-package($node as node(), $model as map(*), $mode as xs let $app-versions := ($app, $app/other/version) let $compatible-xar := app:find-version($app-versions, $procVersion, (), (), (), ()) let $package := $app-versions[@path eq $compatible-xar] + let $version := ($package/@version, $package/version)[1] let $show-details := true() return - if (exists($package)) then - app:package-to-list-item($package, $show-details) + if (exists($app)) then + app:package-to-list-item($app, $version, $show-details) else ( response:set-status-code(404), @@ -61,7 +62,7 @@ declare function app:view-package($node as node(), $model as map(*), $mode as xs ) }; -declare function app:package-to-list-item($app as element(app), $show-details as xs:boolean) { +declare function app:package-to-list-item($app as element(app), $version as xs:string, $show-details as xs:boolean) { let $repoURL := concat(substring-before(request:get-uri(), "public-repo/"), "public-repo/") let $icon := if ($app/icon) then @@ -71,8 +72,10 @@ declare function app:package-to-list-item($app as element(app), $show-details as $repoURL || "public/" || $app/icon[1] else $repoURL || "resources/images/package.png" - let $download-url := concat($repoURL, "public/", $app/@path) - let $required-exist-version := $app/requires[@processor eq "http://exist-db.org"]/(@version, @semver-min)[1] + let $path := ($app//version[@version eq $version]/@path, $app/@path)[1] + let $requires := ($app//version[@version eq $version]/requires, $app/requires)[1] + let $download-url := concat($repoURL, "public/", $path) + let $required-exist-version := $requires[@processor eq "http://exist-db.org"]/(@version, @semver-min)[1] let $info-url := concat($repoURL, "packages/", $app/abbrev[not(@type eq "legacy")], ".html", if ($required-exist-version) then @@ -105,7 +108,7 @@ declare function app:package-to-list-item($app as element(app), $show-details as Version: - { $app/version/text() } + { $version } Size: @@ -115,7 +118,7 @@ declare function app:package-to-list-item($app as element(app), $show-details as if ($app/requires) then Requirement: - eXist-db { if ($app/requires) then app:requires-to-english($app/requires) else () } + eXist-db { if ($requires) then app:requires-to-english($requires) else () } else () @@ -147,7 +150,7 @@ declare function app:package-to-list-item($app as element(app), $show-details as } Download: - {$app/@path/string()} + {$path/string()} { if ($app/other/version) then @@ -194,9 +197,9 @@ declare function app:package-to-list-item($app as element(app), $show-details as

{$app/description/text()}
- Version {$app/version/text()} { - if ($app/requires) then - concat(" (Requires eXist-db ", app:requires-to-english($app/requires), ".)") + Version {$version/string()} { + if ($requires) then + concat(" (Requires eXist-db ", app:requires-to-english($requires), ".)") else () } From 0ac6e000c94a877158dcc6799cb0373c70d1160f Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Sat, 23 Feb 2019 13:11:35 -0500 Subject: [PATCH 2/3] [bugfix] Increase timeout to 5 min --- modules/view.xql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/view.xql b/modules/view.xql index 8d2736b..9337bba 100644 --- a/modules/view.xql +++ b/modules/view.xql @@ -7,7 +7,7 @@ import module namespace app="http://exist-db.org/xquery/app" at "app.xql"; declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization"; -declare option exist:timeout "40000"; +declare option exist:timeout "300000"; declare option output:method "html5"; declare option output:media-type "text/html"; From 635196bc90d4165b677e57b90d2ce9bf7eb1e39f Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Sat, 23 Feb 2019 13:11:44 -0500 Subject: [PATCH 3/3] Prepare v0.7.2 --- build.properties | 2 +- repo.xml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 8d6a92d..8d6d306 100644 --- a/build.properties +++ b/build.properties @@ -4,4 +4,4 @@ # project.name=public-repo -project.version=0.7.1 +project.version=0.7.2 diff --git a/repo.xml b/repo.xml index ac5d647..22559ed 100644 --- a/repo.xml +++ b/repo.xml @@ -12,6 +12,12 @@ post-install.xql + +

+