| ?????svc??2011-12-28 09:58:38by ?? 将头dataset的submitUrl声明为一个svc文件,在此例中,svc文件如下: <?xml version="1.0" encoding="UTF-8"?> <a:service xmlns:a="http://www.aurora-framework.org/application" xmlns:p="uncertain.proc" trace="true"> <a:init-procedure> <batch-apply sourcepath="/parameter"> <p:switch test="@current_parameter/@_status"> <p:case value="update"> <a:model-update model="sys.sys_codes"/> <a:model-batch-update model="sys.sys_code_values" sourcePath="@current_parameter/result_ds"/> </p:case> <p:case value="insert"> <a:model-insert model="sys.sys_codes"/> <a:model-batch-update model="sys.sys_code_values" sourcePath="@current_parameter/result_ds"/> </p:case> <p:case value="delete"> <a:model-delete model="sys.sys_codes"/> <a:model-delete model="sys.sys_code_values_del"/> </p:case> </p:switch> </batch-apply> </a:init-procedure> <a:service-output output="/parameter"/> </a:service> 我们结合一次更新操作,来理解一下svc文件在这里的作用,界面 点击“保存”后的请求参数(已被格式化): _request_data : { "parameter" : [ { "code" : "TEST_EMERSON", "sys_flag" : "N", "enabled_flag" : "Y", "code_name" : "Emerson的测试code", "result_ds" : [ { "code_value" : "1", "code_value_name" : "优", "enabled_flag" : "Y", "_id" : 1064, "_status" : "insert" }, { "code_value" : "2", "code_value_name" : "良", "enabled_flag" : "Y", "_id" : 1065, "_status" : "insert" }, { "code_value" : "3", "code_value_name" : "中", "enabled_flag" : "Y", "_id" : 1066, "_status" : "insert" }, { "code_value" : "4", "code_value_name" : "差", "enabled_flag" : "Y", "_id" : 1067, "_status" : "insert" } ], "_id" : 1063, "_status" : "insert" } ] }
Demo Attachments |
Comments
6 Responses to the article