Commit 7a20dbff authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: Add support to export only current index definition data

parent 175c9113
......@@ -62,7 +62,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -62,7 +62,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -62,7 +62,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -62,7 +62,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -62,7 +62,7 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -112,6 +112,7 @@ hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfbXluaWovTXluaWpTZWFyY2h
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL015bmlqIFNlYXJjaCBDb2xsZWN0aW9uIE1vZHVsZS9teW5pal9zZWFyY2hfaW1wb3J0X2xpc3Q=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfbXluaWovTXluaWpTZWFyY2hDb2xsZWN0aW9uX2V4cG9ydEluZGV4TGlzdA==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL015bmlqIFNlYXJjaCBDb2xsZWN0aW9uIE1vZHVsZS9teW5pal9zZWFyY2hfZXhwb3J0X2xpc3Q=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL015bmlqIFNlYXJjaCBDb2xsZWN0aW9uL215bmlqX2luZGV4X2V4cG9ydF9zb3VyY2U=\n
\n
\n
NETWORK:\n
......@@ -248,7 +249,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.8769.41803.23517</string> </value>
<value> <string>989.8909.25966.48384</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +267,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1609863203.76</float>
<float>1610986157.68</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -15,7 +15,7 @@
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">mynij_search_collection_module</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Mynij Search Collection</script>
<script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_mynij</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Mynij Search Collection Module | mynij_search_view', 'Mynij Search Collection Module | mynij_index_import', 'Mynij Search Collection Module | mynij_search_import_file', 'Mynij Search Collection Module | mynij_search_import_list', 'Mynij Search Collection Module | mynij_search_export_list', 'Mynij Search Collection | mynij_search_view', 'Mynij Search Collection | mynij_search_build_index', 'Mynij Search Collection | mynij_index_export_file')</script>
<script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Mynij Search Collection Module | mynij_search_view', 'Mynij Search Collection Module | mynij_index_import', 'Mynij Search Collection Module | mynij_search_import_file', 'Mynij Search Collection Module | mynij_search_import_list', 'Mynij Search Collection Module | mynij_search_export_list', 'Mynij Search Collection | mynij_search_view', 'Mynij Search Collection | mynij_search_build_index', 'Mynij Search Collection | mynij_index_export_file', 'Mynij Search Collection | mynij_index_export_source')</script>
<script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Mynij Search Collection Module | Mynij Search Collection',)</script>
<script data-renderjs-configuration="mynij_search_collection_module_dict" type="text/x-renderjs-configuration">{"title": "Mynij Search", "filter_action": 1, "hide_add_button": 0, "history_previous_link": 1}</script>
<script data-renderjs-configuration="mynij_search_collection_dict" type="text/x-renderjs-configuration">{"title": "Mynij Search", "editable": 1, "history_previous_link": 1}</script>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.8910.36396.20462</string> </value>
<value> <string>989.27611.47592.53162</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1610722711.08</float>
<float>1610985868.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -246,6 +246,7 @@
})
.push(function(index_list){
var i,
file_blob,
built = false,
index = parent_options.doc,
redirect = {
......@@ -258,6 +259,21 @@
};
if (content_dict.export_collection === "on") {
if (index) {
file_blob = new Blob([JSON.stringify([{
title: index.title,
links: index.links}])], {type : "application/json"});
return gadget.downloadBlob(index.title + ".json", file_blob)
.push(function () {
return {
notify: {
message: "Index '" + index.title + "' definition Exported.",
status: "success"
},
redirect: redirect
};
});
}
return gadget.jio_allDocs({query: 'portal_type:"Mynij Search Collection"',
select_list: ["title", "links"]})
.push(function (results) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment