Changeset 831 for MDRepository
- Timestamp:
- 11/02/10 15:25:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MDRepository/trunk/xquery/cmd-model.xqm
r830 r831 72 72 :) 73 73 declare function cmd-model:search-retrieve($xpath-query as xs:string, $collections as xs:string+, $format as xs:string, $start-item as xs:integer, $end-item as xs:integer) as item()* { 74 let $start-time := fn:current-dateTime(),75 $collection := collection($cmd-model:cmdiMirrorPath),74 let $start-time := util:system-dateTime(), 75 $collection := collection($cmd-model:cmdiMirrorPath), 76 76 $decoded-query := xdb:decode($xpath-query), 77 77 $sanitized-query := cmd-model:sanitize-query($decoded-query), … … 85 85 $result-seq := fn:subsequence($results, $start-item, $end-item), 86 86 $seq-count := fn:count($result-seq), 87 $end-time := fn:current-dateTime(),87 $end-time := util:system-dateTime(), 88 88 $result-fragment := 89 89 <searchRetrieveResponse> … … 126 126 $coll-names-value := if (fn:empty($collections)) then () else attribute colls {fn:string-join($collections, ",")}, 127 127 $result := element {$cmd-model:docTypeTerms} { 128 129 attribute depth {$depth},130 131 132 128 $coll-names-value, 129 attribute depth {$depth}, 130 attribute created {fn:current-dateTime()}, 131 $entries 132 } 133 133 return $result 134 134 }; … … 288 288 }; 289 289 290 (: Store the collection listing for given collection. 290 (: 291 Store the collection listing for given collection. 291 292 :) 292 293 declare function cmd-model:store-in-cache($doc-name as xs:string, $data as node()) as item()* { … … 296 297 $stored-doc := fn:doc(concat($cmd-model:cachePath, "/", $doc-name)) 297 298 return $stored-doc 298 (: moved to get-collection 299 $coll-count := update value $stored-doc/Collections/@count with sum($stored-doc//c[not(c)]/@cnt) 300 return 301 for $i in $stored-doc//c[c][@cnt eq "-1"] 302 return update value $i/@cnt with sum($i//c[not(c)]/@cnt) 303 :) 304 }; 305 306 (: 307 Create document name with md5-hash for selected collections (or types) for reuse. 299 }; 300 301 (: 302 Create document name with md5-hash for selected collections (or types) 303 for reuse. 308 304 :) 309 305 declare function cmd-model:gen-cache-id($type-name as xs:string, $keys as xs:string+, $depth as xs:string) as xs:string {
Note: See TracChangeset
for help on using the changeset viewer.