Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configuration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<repositories>
<repository active="true" default="true">http://exist-db.org/exist/apps/public-repo</repository>
<repository active="true" default="true">https://exist-db.org/exist/apps/public-repo</repository>
</repositories>
<readonly>
<package>http://exist-db.org/apps/existdb-packageservice</package>
Expand Down
10 changes: 6 additions & 4 deletions modules/packages.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare option output:method "html5";
declare option output:media-type "text/html";

declare variable $packages:configuration := doc($config:app-root || "/configuration.xml");

declare variable $packages:repos := $packages:configuration//repository[@active='true'];
declare variable $packages:DEFAULTS := doc($config:app-root || "/defaults.xml")/apps;
declare variable $packages:ADMINAPPS := ["dashboard","backup"];
declare variable $packages:HIDE := ("dashboard");
Expand Down Expand Up @@ -282,11 +282,13 @@ declare function packages:get-package-meta($app as xs:string, $name as xs:string
(: should be private but there seems to be a bug :)
declare function packages:public-repo-contents($installed as element(repo-app)*) {
try {
let $url := $config:DEFAULT-REPO || "/public/apps.xml?version=" || packages:get-version() ||
for $pkgs in $packages:repos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rename this to $pkg as this will be an item() from the tuple stream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about $pkg-list I really would like to avoid using identical variable names for different things in the library

let $url := $pkgs || "/public/apps.xml?version=" || packages:get-version() ||
"&amp;source=" || util:system-property("product-source")
(: EXPath client module does not work properly. No idea why. :)
let $request :=
<http:request method="get" href="{$url}" timeout="10">
let $request := for $r in $url
return
<http:request method="get" href="{$r}" timeout="10">
<http:header name="Cache-Control" value="no-cache"/>
</http:request>
let $data := http:send-request($request)
Expand Down