Changeset 254 for MDService


Ignore:
Timestamp:
03/18/10 17:20:35 (14 years ago)
Author:
ljo
Message:

Preparing for other operations than queryModel: getCollections and searchRetrieve

Location:
MDService/trunk/xquery
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • MDService/trunk/xquery/cmd-model.xql

    r247 r254  
    1313
    1414declare function local:cmd-model() as item()* {
    15   let $action :=  request:get-parameter("operation", ""),
     15  let $operation :=  request:get-parameter("operation", $cmd-model:queryModel),
    1616    $cmd-index := request:get-parameter("q", "MDGroup/Actors/Actor"),
    1717    $cmd-index-path :=
     
    2323    $collection := fn:concat("/db/cmdi-mirror/", request:get-parameter("collection", "silang_data")),
    2424    $max-depth as xs:integer := xs:integer(request:get-parameter("maxdepth", 1))
    25 
    2625    return
     26      if ($operation eq $cmd-model:getCollections) then
     27        (: cmd-model:get-collections() :)
     28      else if ($operation eq $cmd-model:queryModel) then
    2729      if ($format eq "json") then
    2830        let $option := util:declare-option("exist:serialize", "method=text media-type=application/json")
    2931          return
    3032           (: json:xml-to-json( :) cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth) (:) :)
    31     else
    32       cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth)
     33      else
     34        cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth)
     35    else if ($operation eq $cmd-model:searchRetrieve) then
     36      (: cmd-model:search-retrieve() :)
     37    else
     38      <error>Unknown operation</error>
     39
    3340};
    3441
  • MDService/trunk/xquery/cmd-model.xqm

    r251 r254  
    1212declare variable $cmd-model:commonFreqsPath as xs:string := "/db/common/clarin/freqs";
    1313declare variable $cmd-model:cmdiMirrorPath as xs:string := "/db/cmdi-mirror";
     14
     15declare variable $cmd-model:getCollections as xs:string := "getCollections";
     16declare variable $cmd-model:queryModel as xs:string := "queryModel";
     17declare variable $cmd-model:searchRetrieve as xs:string := "searchRetrieve";
    1418
    1519declare variable $cmd-model:typeActorPath as xs:string := "MDGroup/Actors/Actor";
     
    3135  let $text-count-distinct := count(distinct-values($text-nodes))
    3236  return
    33         <Term path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}"  count_distinct_text="{$text-count-distinct}">
    34         { if ($depth > 0) then
     37        <Term path="{fn:concat("//", $path)}" count="{$path-count}" count_text="{$text-count}"  count_distinct_text="{$text-count-distinct}">{
     38          if ($depth > 0) then
    3539            for $elname in $subs[. != '']
    3640            return
Note: See TracChangeset for help on using the changeset viewer.