source: exist/trunk/xquery/molesList.xq @ 4427

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/trunk/xquery/molesList.xq
Revision 4427, 746 bytes checked in by cbyrom, 11 years ago (diff)

Upgrade the various 'list' xqueries - to nest all results in a single
root element - so that only one document need be retrieved to get all
results + adjust ndgDirectory to cope with processing the new results +
fix the various namespaces mentioned in the codebase to map to the
current atom/moles ones.

Line 
1(: This moles listing query returns all the moles DataEntity documents and their local identifiers within a specific TargetCollection and a particular type (default is dgDataEntity) :)
2declare default element namespace 'http://ndg.nerc.ac.uk/moles';
3declare variable $targetCollection as xs:string := 'TargetCollection';
4<docs>
5{
6for $DE in collection($targetCollection)/dgMetadata/dgMetadataRecord[exists(dgDataEntity)]
7let $f:=util:document-name($DE)
8return
9<dgMetadataRecord>
10{$DE/dgMetadataID/repositoryIdentifier}{$DE/dgMetadataID/localIdentifier}
11<repositoryID>{string($DE/dgMetadataID/localIdentifier)}</repositoryID>
12<fileName>{$f}</fileName>
13<created>{xmldb:created(util:collection-name($DE),$f)}</created>
14</dgMetadataRecord>
15}
16</docs>
Note: See TracBrowser for help on using the repository browser.