Changeset 831 for MDRepository


Ignore:
Timestamp:
11/02/10 15:25:34 (14 years ago)
Author:
ljo
Message:

cmd-model.xqm - fixing some small stuff before going on with changes.

File:
1 edited

Legend:

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

    r830 r831  
    7272:)
    7373declare 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),
    7676    $decoded-query := xdb:decode($xpath-query),
    7777    $sanitized-query := cmd-model:sanitize-query($decoded-query),
     
    8585    $result-seq := fn:subsequence($results, $start-item, $end-item),
    8686    $seq-count := fn:count($result-seq),
    87     $end-time := fn:current-dateTime(),
     87    $end-time := util:system-dateTime(),
    8888    $result-fragment :=
    8989    <searchRetrieveResponse>
     
    126126                        $coll-names-value := if (fn:empty($collections)) then () else attribute colls {fn:string-join($collections, ",")},
    127127                $result := element {$cmd-model:docTypeTerms} {
    128                                                                                                         $coll-names-value,
    129                                                                                                             attribute depth {$depth},                                                                                                     
    130                                                                                                             attribute created {fn:current-dateTime()},
    131                                                                                                             $entries 
    132                                                                                                 }
     128                  $coll-names-value,
     129                  attribute depth {$depth},
     130                  attribute created {fn:current-dateTime()},
     131                  $entries 
     132                }
    133133    return $result             
    134134};
     
    288288};
    289289
    290 (:  Store the collection listing for given collection.
     290(: 
     291  Store the collection listing for given collection.
    291292:)
    292293declare function cmd-model:store-in-cache($doc-name as xs:string, $data as node()) as item()* {
     
    296297  $stored-doc := fn:doc(concat($cmd-model:cachePath, "/", $doc-name))
    297298  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.
    308304:)
    309305declare 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.