Changeset 256 for MDService


Ignore:
Timestamp:
03/18/10 18:12:29 (14 years ago)
Author:
ljo
Message:

Refactoring queryModel

Location:
MDService/trunk/xquery
Files:
2 edited

Legend:

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

    r255 r256  
    2727        (:cmd-model:get-collections() :) <error>Unimplemented</error>
    2828      else if ($operation eq $cmd-model:queryModel) then
    29       if ($format eq "json") then
    30         let $option := util:declare-option("exist:serialize", "method=text media-type=application/json")
    31           return
    32            (: json:xml-to-json( :) 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)
     29        cmd-model:query-model($cmd-index-path, $collection, $format, $max-depth)
    3530    else if ($operation eq $cmd-model:searchRetrieve) then
    3631      (: cmd-model:search-retrieve() :) <error>Unimplemented</error>
  • MDService/trunk/xquery/cmd-model.xqm

    r254 r256  
    173173  $cmd-model:docTypeTerms
    174174};
     175
     176(:~
     177  API function queryModel.
     178:)
     179declare function cmd-model:query-model($cmd-index-path as xs:string, $collection as xs:string+, $format as xs:string, $max-depth as xs:integer) as node() {
     180      if ($format eq "json") then
     181        let $option := util:declare-option("exist:serialize", "method=text media-type=application/json")
     182          return
     183           (: json:xml-to-json( :) cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth) (:) :)
     184      else
     185        cmd-model:get-result-doc($collection, $cmd-index-path, $max-depth)
     186};
Note: See TracChangeset for help on using the changeset viewer.