Skip to content

Commit

Permalink
update document for xresconv-gui 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Sep 7, 2019
1 parent 2bc7a9c commit a168f85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions source/sample/xresconv_conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<xresloader_path desc="xresloader地址,相对于当前xml的目录">../target/xresloader-1.4.3.jar</xresloader_path>

<proto desc="协议类型,对应xresloader的-p选项">protobuf</proto>
<output_type desc="输出类型,对应xresloader的-t选项">json</output_type>
<output_type desc="输出类型,-t选项,支持多个同时配置多种输出">bin</output_type>
<output_type desc="多种输出时可以额外定义某个节点的重命名规则" rename="/(?i)\.bin$/\.json/">json</output_type>
<proto_file desc="协议描述文件,对应xresloader的-f选项">proto_v3/kind.pb</proto_file>

<output_dir desc="输出目录,对应xresloader的-o选项"></output_dir>
<data_src_dir desc="数据源(Excel查找)目录,对应xresloader的-d选项"></data_src_dir>
<data_version desc="数据版本号,对应xresloader的--data-version选项,留空则自动生成">1.0.0.0</data_version>

<rename desc="重命名规则,正则表达式:/搜索模式/替换内容/,对应xresloader的-n选项">/(?i)\.bin$/\.json/</rename>
<rename desc="重命名规则,正则表达式:/搜索模式/替换内容/,对应xresloader的-n选项, 如果在output_type里设置了rename,以output_type里的rename为准,否则使用这里的全局配置" placeholder="/(?i)\.bin$/\.json/"></rename>

<!-- java_option标签是传递给java -jar的java选项 -->
<java_option desc="java附加选项">这里的选项会在运行xresloader-*.jar时附加到java控制参数列表中</java_option>
Expand Down
24 changes: 14 additions & 10 deletions source/users/xresconv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ GUI批量转表工具的特殊事件
.. code-block:: javascript
{
work_dir: "工作目录",
work_dir: "工作目录(要求版本>=2.2.0)",
configure_file: "载入的配置文件路径(要求版本>=2.2.0)",
item_data: {
id: "条目ID",
file: "数据源文件",
Expand All @@ -66,7 +67,10 @@ GUI批量转表工具的特殊事件
desc: "描述信息",
scheme_data: {"元数据Key": "元数据Value"}
},
configure_file: "载入的配置文件路径"
alert_warning: function(content, title, options) {}, // (要求版本>=2.2.0) 警告弹框, options 结构是 {yes: 点击是按钮回调, no: 点击否按钮回调, on_close: 关闭后回调}
alert_error: function(content, title) {}, // (要求版本>=2.2.0) 错误弹框
log_info: function (content) {}, // (要求版本>=2.2.0) 打印info日志
log_error: function (content) {} // (要求版本>=2.2.0) 打印info日志
}
这个结构。在 GUI工具 `xresconv-gui`_ 显示每个条目的时候会运行这个函数并传入上述结构,在函数里我们可以通过改变 ``name`` 和 ``desc`` 来改变 GUI工具 `xresconv-gui`_ 工具的显示内容。
Expand All @@ -81,18 +85,18 @@ GUI批量转表工具的特殊事件
{
work_dir: "执行xresloader的工作目录",
configure_file: "载入的配置文件路径",
configure_file: "载入的配置文件路径(要求版本>=2.2.0)",
xresloader_path: "xresloader目录",
global_options: {"全局选项": "VALUE"},
selected_nodes: ["选中要执行转表的节点集合"],
run_seq: "执行序号",
alert_warning: function(content, title, options) {}, // 警告弹框, options 结构是 {yes: 点击是按钮回调, no: 点击否按钮回调, on_close: 关闭后回调}
alert_error: function(content, title) {}, // 错误弹框
log_info: function (content) {}, // 打印info日志
log_error: function (content) {}, // 打印info日志
resolve: function (value) {}, // 通知上层执行结束,相当于Promise的resolve
reject: function(reason) {}, // 通知上层执行失败,相当于Promise的reject
require: function (name) {} // 相当于 nodejs的 require(name) 用于导入nodejs 模块
alert_warning: function(content, title, options) {}, // 警告弹框, options 结构是 {yes: 点击是按钮回调, no: 点击否按钮回调, on_close: 关闭后回调}
alert_error: function(content, title) {}, // 错误弹框
log_info: function (content) {}, // 打印info日志
log_error: function (content) {}, // 打印info日志
resolve: function (value) {}, // 通知上层执行结束,相当于Promise的resolve
reject: function(reason) {}, // 通知上层执行失败,相当于Promise的reject
require: function (name) {} // 相当于 nodejs的 require(name) 用于导入nodejs 模块
}
在 `批量转表配置模板仓库-xresconv-conf <xresconv-conf>`_ 中的 ``sample.xml`` 文件中也有示例。

0 comments on commit a168f85

Please sign in to comment.