Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mynij
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
mynij
Commits
8fc8f5c6
Commit
8fc8f5c6
authored
Jan 15, 2021
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_mynij_search: Allow to import/export non zipped JSON index file
parent
fdec656c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
231 additions
and
22 deletions
+231
-22
bt5/erp5_web_mynij_search/SkinTemplateItem/portal_skins/erp5_mynij/Base_exportIndexMynijSearch.xml
...m/portal_skins/erp5_mynij/Base_exportIndexMynijSearch.xml
+1
-0
bt5/erp5_web_mynij_search/SkinTemplateItem/portal_skins/erp5_mynij/Base_exportIndexMynijSearch/my_zip_exported.xml
...rp5_mynij/Base_exportIndexMynijSearch/my_zip_exported.xml
+184
-0
bt5/erp5_web_mynij_search/SkinTemplateItem/portal_skins/erp5_mynij/action_mynij_search_import_export_index.js.js
.../erp5_mynij/action_mynij_search_import_export_index.js.js
+42
-18
bt5/erp5_web_mynij_search/bt/template_keep_last_workflow_history_only_path_list
...rch/bt/template_keep_last_workflow_history_only_path_list
+2
-2
bt5/erp5_web_mynij_search/bt/template_keep_workflow_path_list
...erp5_web_mynij_search/bt/template_keep_workflow_path_list
+2
-2
No files found.
bt5/erp5_web_mynij_search/SkinTemplateItem/portal_skins/erp5_mynij/Base_exportIndexMynijSearch.xml
View file @
8fc8f5c6
...
...
@@ -65,6 +65,7 @@
<string>
gadget_field_action_js_script
</string>
<string>
action_description
</string>
<string>
my_include_content
</string>
<string>
my_zip_exported
</string>
</list>
</value>
</item>
...
...
bt5/erp5_web_mynij_search/SkinTemplateItem/portal_skins/erp5_mynij/Base_exportIndexMynijSearch/my_zip_exported.xml
0 → 100644
View file @
8fc8f5c6
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"CheckBoxField"
module=
"Products.Formulator.StandardFields"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_zip_exported
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
<item>
<key>
<string>
required_not_found
</string>
</key>
<value>
<string>
This field is mandatory.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Zip index (can take longer)
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_mynij_search/SkinTemplateItem/portal_skins/erp5_mynij/action_mynij_search_import_export_index.js.js
View file @
8fc8f5c6
...
...
@@ -74,7 +74,7 @@
return
put_queue
;
})
.
declareMethod
(
"
exportIndex
"
,
function
(
index_doc
,
include_content
)
{
.
declareMethod
(
"
exportIndex
"
,
function
(
index_doc
,
include_content
,
zip
)
{
var
gadget
=
this
,
ids
,
map
,
...
...
@@ -121,6 +121,11 @@
page
:
result
};
if
(
!
zip
)
{
file_blob
=
new
Blob
([
JSON
.
stringify
(
file_dict
)],
{
type
:
"
application/json
"
});
return
gadget
.
downloadBlob
(
index_id
+
"
.json
"
,
file_blob
);
}
zip_file
=
new
JSZip
();
zip_file
.
file
(
index_id
+
"
.json
"
,
JSON
.
stringify
(
file_dict
));
zip_file
.
generateAsync
({
...
...
@@ -159,14 +164,15 @@
return
jIO
.
util
.
dataURItoBlob
(
dataurl
);
})
.
push
(
function
(
data
)
{
var
zip
=
new
JSZip
();
var
zip
;
if
(
data
.
type
===
"
application/zip
"
)
{
zip
=
new
JSZip
();
return
zip
.
loadAsync
(
data
)
.
then
(
function
(
data
){
return
zip
.
file
(
Object
.
keys
(
data
.
files
)[
0
]).
async
(
"
string
"
);
})
.
then
(
function
(
data
){
index_dict
=
JSON
.
parse
(
data
);
//console.log(data);
doc
.
title
=
index_dict
.
name
;
doc
.
links
=
index_dict
.
links
;
doc
.
status
=
"
built
"
;
...
...
@@ -176,6 +182,23 @@
index_dict
,
{});
});
}
else
if
(
data
.
type
===
"
application/json
"
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
jIO
.
util
.
readBlobAsText
(
data
,
"
application/json
"
);
})
.
push
(
function
(
evt
)
{
index_dict
=
JSON
.
parse
(
evt
.
target
.
result
);
doc
.
title
=
index_dict
.
name
;
doc
.
links
=
index_dict
.
links
;
doc
.
status
=
"
built
"
;
index_id
=
"
index-
"
+
doc
.
title
;
return
gadget
.
state
.
model_gadget
.
pushIndexBlob
(
index_id
,
index_dict
,
{});
});
}
})
.
push
(
function
()
{
return
gadget
.
putIndexPage
(
index_dict
.
page
);
...
...
@@ -325,7 +348,8 @@
redirect
:
redirect
};
}
return
gadget
.
exportIndex
(
index
,
content_dict
.
include_content
===
"
on
"
)
return
gadget
.
exportIndex
(
index
,
content_dict
.
include_content
===
"
on
"
,
content_dict
.
zip_exported
===
"
on
"
)
.
push
(
function
()
{
return
{
notify
:
{
...
...
bt5/erp5_web_mynij_search/bt/template_keep_last_workflow_history_only_path_list
View file @
8fc8f5c6
...
...
@@ -4,10 +4,10 @@ web_page_module/gadget_erp5_mynij_**
web_page_module/gadget_erp5_page_mynij_**
web_page_module/gadget_mynij_**
web_page_module/gadget_officejs_mynij_**
web_page_module/jszip_min_js
web_page_module/mynij-**
web_page_module/mynij_**
web_page_module/rss-parser.min.js.map
web_page_module/webtorrent_min_js
web_site_module/mynij_search
web_site_module/mynij_search/**
\ No newline at end of file
web_page_module/jszip_min_js
\ No newline at end of file
bt5/erp5_web_mynij_search/bt/template_keep_workflow_path_list
View file @
8fc8f5c6
...
...
@@ -4,10 +4,10 @@ web_page_module/gadget_erp5_mynij_**
web_page_module/gadget_erp5_page_mynij_**
web_page_module/gadget_mynij_**
web_page_module/gadget_officejs_mynij_**
web_page_module/jszip_min_js
web_page_module/mynij-**
web_page_module/mynij_**
web_page_module/rss-parser.min.js.map
web_page_module/webtorrent_min_js
web_site_module/mynij_search
web_site_module/mynij_search/**
\ No newline at end of file
web_page_module/jszip_min_js
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment