Lace2
Lace2 copied to clipboard
refactor code pertaining to package identification
dc:identifier is not a good key, since it isn't present in other packages, requiring a non-optimized search through them. Instead, use code like:
xquery version "3.1";
import module namespace apputil="http://exist-db.org/xquery/apps";
import module namespace repo="http://exist-db.org/xquery/repo";
let $root := repo:get-root()
let $uri := "http://heml.mta.ca/Lace/Images/actaphilippietac00bonnuoft"
return $root || apputil:resolve($uri)
apputil:scan-repo($callback as function(*)) as item()* looks promising. Scan all repos for those that have a meta.xml file, that in turn has dc:identifier, etc.
Doing a TRACE level logging in eXist really shows what's what.