diff options
author | John Christopher Anderson <jchris@apache.org> | 2008-12-29 23:43:10 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2008-12-29 23:43:10 +0000 |
commit | 0eaf109d9d2c5bbda4a33d7c106c3a9f06f52d2a (patch) | |
tree | 759167072f99606fe082864c1ffe5068dae0e4f3 /src/couchdb/couch_query_servers.erl | |
parent | 46874e0e90a46fefe0a6f7e1ef574bb6a2fcaf78 (diff) |
merge form branch to trunk
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@730016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_query_servers.erl')
-rw-r--r-- | src/couchdb/couch_query_servers.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/couchdb/couch_query_servers.erl b/src/couchdb/couch_query_servers.erl index b694d5e3..c4ed5c8b 100644 --- a/src/couchdb/couch_query_servers.erl +++ b/src/couchdb/couch_query_servers.erl @@ -17,7 +17,7 @@ -export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2,code_change/3,stop/0]). -export([start_doc_map/2, map_docs/2, stop_doc_map/1]). --export([reduce/3, rereduce/3,validate_doc_update/5]). +-export([reduce/3, rereduce/3,validate_doc_update/5,render_doc_form/5]). % -export([test/0]). -include("couch_db.hrl"). @@ -122,6 +122,17 @@ validate_doc_update(Lang, FunSrc, EditDoc, DiskDoc, Ctx) -> ok = ret_os_process(Lang, Pid) end. +render_doc_form(Lang, FormSrc, Doc, Req, Db) -> + Pid = get_os_process(Lang), + JsonDoc = couch_doc:to_json_obj(Doc, [revs]), + JsonReq = couch_httpd_external:json_req_obj(Req, Db), + try couch_os_process:prompt(Pid, [<<"form">>, FormSrc, JsonDoc, JsonReq]) of + FormResp -> + FormResp + after + ok = ret_os_process(Lang, Pid) + end. + init([]) -> % read config and register for configuration changes |