Changeset 705 for MDRepository


Ignore:
Timestamp:
09/19/10 13:12:21 (14 years ago)
Author:
vronk
Message:

tried to rework collection-context-handling in queryModel and searchRetrieve; seems to work, but needs check..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MDRepository/trunk/xquery/cmd-model.xqm

    r701 r705  
    4242
    4343declare function cmd-model:elem-r($collection as xs:string, $path as xs:string, $max-depth as xs:integer, $depth as xs:integer) as element() {
    44   let $path-nodes := util:eval(fn:concat("collection('", $collection, "')//", $path))
     44  (: let $path-nodes := util:eval(fn:concat("collection('", $collection, "')//", $path)) :)
     45  let $path-nodes := for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')//CMD[.//IsPartOf='", xdb:decode($coll) ,"']"))
    4546  let $path-count := count($path-nodes)
    4647   
     
    181182    $dummy := xdb:login($cmd-model:cmdiDatabaseURI, $clarin-writer//write-user/text(), $clarin-writer//write-user-cred/text())
    182183    return
    183         xdb:store($cmd-model:commonFreqsPath, cmd-model:make-compound-doc-name($coll-names, $type-name, xs:string($depth)), cmd-model:make-doc-element-of-type($type-name, $coll-names, $entries, $depth))
     184        xdb:store($cmd-model:commonFreqsPath, cmd-model:make-compound-doc-name($coll-names, $type-name, xs:string($depth)), cmd-model:make-doc-element-of-type($type-name, $coll-names, $entries, xs:string($depth)))
    184185};
    185186
     
    314315:)
    315316declare function cmd-model:search-retrieve($cql-query as xs:string, $collection as xs:string+, $format as xs:string, $start-item as xs:integer, $end-item as xs:integer) as item()* {
    316   let $results := for $coll in $collection return util:eval(fn:concat("collection('", xdb:decode($coll), "')", xdb:decode($cql-query), "/ancestor::CMD")),
     317  (:  let $results := for $coll in $collection return util:eval(fn:concat("collection('", xdb:decode($coll), "')", xdb:decode($cql-query), "/ancestor::CMD")), :)
     318        let $results := for $coll in $collection return util:eval(fn:concat("collection('", $cmd-model:cmdiMirrorPath, "')", xdb:decode($cql-query), "/ancestor::CMD", "[.//IsPartOf='", xdb:decode($coll) ,"']")),
    317319    $result-count := fn:count($results),
    318320    $result-seq := fn:subsequence($results, $start-item, $end-item),
Note: See TracChangeset for help on using the changeset viewer.