From 0f6210f04d4e45366d111feeedaef2d30012f0e6 Mon Sep 17 00:00:00 2001
From: Roque Porchetto <roque.porchetto@nexedi.com>
Date: Fri, 6 Nov 2020 14:41:27 +0000
Subject: [PATCH] erp5_officejs: Notebook Download HTML action

---
 .../Notebook/notebook_download.xml            |   2 +-
 .../Notebook/notebook_download_html.xml       |  75 ++++
 ...officejs_notebook_editor_configuration.xml |   4 +-
 .../gadget_officejs_notebook_router.html.html |   5 +-
 .../gadget_officejs_notebook_router.html.xml  |   4 +-
 ...js_notebook_download_html_action_html.html |  18 +
 ...ejs_notebook_download_html_action_html.xml | 334 +++++++++++++++++
 ...ficejs_notebook_download_html_action_js.js |  98 +++++
 ...icejs_notebook_download_html_action_js.xml | 336 ++++++++++++++++++
 ...se_downloadHtmlDialogForNotebookEditor.xml | 137 +++++++
 .../gadget_field_action_js_script.xml         | 246 +++++++++++++
 .../my_text_content.xml                       | 251 +++++++++++++
 ...n_getNotebookEditorPrecacheManifestList.py |   6 +-
 ..._keep_last_workflow_history_only_path_list |   1 +
 .../bt/template_keep_workflow_path_list       |   1 +
 bt5/erp5_officejs/bt/template_path_list       |   5 +-
 16 files changed, 1513 insertions(+), 10 deletions(-)
 create mode 100644 bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download_html.xml
 create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.html
 create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.xml
 create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.js
 create mode 100644 bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.xml
 create mode 100644 bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor.xml
 create mode 100644 bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/gadget_field_action_js_script.xml
 create mode 100644 bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/my_text_content.xml

diff --git a/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download.xml b/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download.xml
index 5c8d681d1e..1f1e3d5b09 100644
--- a/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download.xml
@@ -54,7 +54,7 @@
         </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string>Download</string> </value>
+            <value> <string>Download Notebook</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download_html.xml b/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download_html.xml
new file mode 100644
index 0000000000..2c0630212a
--- /dev/null
+++ b/bt5/erp5_officejs/PathTemplateItem/portal_types/Notebook/notebook_download_html.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Action Information" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>action_permission</string> </key>
+            <value>
+              <tuple>
+                <string>Add portal content</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>action_type/object_jio_js_script</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>notebook_download_html</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Action Information</string> </value>
+        </item>
+        <item>
+            <key> <string>reference</string> </key>
+            <value> <string>notebook_download_html</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Download HTML</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="Expression" module="Products.CMFCore.Expression"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/Base_downloadHtmlDialogForNotebookEditor</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_editor_configuration.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_editor_configuration.xml
index be46c26efb..53eb2d04e0 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_editor_configuration.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_editor_configuration.xml
@@ -91,7 +91,7 @@
         <item>
             <key> <string>text_content</string> </key>
             <value> <string>CONFIGURATION MANIFEST\n
-# generated on Mon Oct 26 20:30:00 2020\n
+# generated on Thu Nov  5 19:40:05 2020\n
 CACHE:\n
 \n
 hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL05vdGVib29rIE1vZHVsZQ==\n
@@ -110,6 +110,8 @@ hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL05vdGVib29rL25vdGVib29rX2Rvd25
 hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfbm90ZWJvb2svQmFzZV9kb3dubG9hZERpYWxvZ0Zvck5vdGVib29rRWRpdG9y\n
 hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL05vdGVib29rL25vdGVib29rX2V4cG9ydA==\n
 hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfbm90ZWJvb2svQmFzZV9leHBvcnREaWFsb2dGb3JOb3RlYm9va0VkaXRvcg==\n
+hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL05vdGVib29rL25vdGVib29rX2Rvd25sb2FkX2h0bWw=\n
+hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfb2ZmaWNlanNfbm90ZWJvb2svQmFzZV9kb3dubG9hZEh0bWxEaWFsb2dGb3JOb3RlYm9va0VkaXRvcg==\n
 \n
 NETWORK:\n
 *</string> </value>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.html
index 309b6366d0..a52761284d 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.html
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.html
@@ -20,15 +20,14 @@
     <script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">notebook_module</script>
     <script data-renderjs-configuration="portal_skin_folder" type="text/x-renderjs-configuration">erp5_officejs_notebook</script>
     <script data-renderjs-configuration="app_view_reference" type="text/x-renderjs-configuration">notebook_editor_view</script>
-    <script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Notebook | notebook_editor_view', 'Notebook | notebook_preview', 'Notebook | notebook_editor_clone', 'Notebook | notebook_download', 'Notebook | notebook_export', 'Notebook Module | notebook_editor_view', 'Notebook Module | notebook_upload')</script>
+    <script data-renderjs-configuration="app_actions" type="text/x-renderjs-configuration">('Notebook | notebook_editor_view', 'Notebook | notebook_preview', 'Notebook | notebook_editor_clone', 'Notebook | notebook_download', 'Notebook | notebook_export', 'Notebook | notebook_download_html', 'Notebook Module | notebook_editor_view', 'Notebook Module | notebook_upload')</script>
     <script data-renderjs-configuration="app_allowed_sub_types" type="text/x-renderjs-configuration">('Notebook Module | Notebook',)</script>
     <script data-renderjs-configuration="notebook_module_dict" type="text/x-renderjs-configuration">{"front_page": 1, "editable": 0, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 1, "panel_action": 1, "previous_next_button": 0, "history_previous_link": 0, "title": "Notebooks", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
     <script data-renderjs-configuration="notebook_dict" type="text/x-renderjs-configuration"> {"front_page": 0, "editable": 1, "hide_add_button": 0, "jump_button": 0, "fast_input_button": 0, "export_button": 0, "filter_action": 0, "panel_action": 1, "previous_next_button": 1, "history_previous_link": 1, "title": "Notebook", "hide_listbox_buttons": 1, "blob_type": "", "blob_create_object_url": 0}</script>
     <script data-renderjs-configuration="upload_dict" type="text/x-renderjs-configuration">{"txt": "txt", "html": "html"}</script>
-    <script data-renderjs-configuration="conversion_dict" type="text/x-renderjs-configuration">{"txt": ["html", "pdf"]}</script>
     <script data-renderjs-configuration="file_extension" type="text/x-renderjs-configuration">txt</script>
     <script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
     <script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">82g9eir551nhovs</script>
     <div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
   </body>
-</html>
+</html>
\ No newline at end of file
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.xml
index 8e9281f3a0..f62b2b5777 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_notebook_router.html.xml
@@ -284,7 +284,7 @@
                   </item>
                   <item>
                       <key> <string>serial</string> </key>
-                      <value> <string>987.36555.54184.38826</string> </value>
+                      <value> <string>987.50905.4909.48759</string> </value>
                   </item>
                   <item>
                       <key> <string>state</string> </key>
@@ -302,7 +302,7 @@
                           </tuple>
                           <state>
                             <tuple>
-                              <float>1603744186.99</float>
+                              <float>1606414066.38</float>
                               <string>UTC</string>
                             </tuple>
                           </state>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.html b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.html
new file mode 100644
index 0000000000..35a01d3cf7
--- /dev/null
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.html
@@ -0,0 +1,18 @@
+<!doctype html>
+<html>
+  <head>
+
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+
+    <title>OfficeJS Notebook Download HTML Action</title>
+
+    <script src="rsvp.js"></script>
+    <script src="renderjs.js"></script>
+
+    <script src="notebook_download_html_action.js"></script>
+  </head>
+
+  <body>
+  </body>
+</html>
\ No newline at end of file
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.xml
new file mode 100644
index 0000000000..7d7fc9c754
--- /dev/null
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_html.xml
@@ -0,0 +1,334 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Web Page" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Change_local_roles_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_md5</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>notebook_download_html_action.html</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>officejs_notebook_download_html_action_html</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Web Page</string> </value>
+        </item>
+        <item>
+            <key> <string>short_title</string> </key>
+            <value> <string>Notebook Download Html Action</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>OfficeJS Notebook Download Html Action</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>001</string> </value>
+        </item>
+        <item>
+            <key> <string>workflow_history</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>document_publication_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>edit_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>processing_status_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_log</string> </key>
+            <value>
+              <list>
+                <dictionary>
+                  <item>
+                      <key> <string>action</string> </key>
+                      <value> <string>publish_alive</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>actor</string> </key>
+                      <value> <string>zope</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>comment</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>error_message</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>time</string> </key>
+                      <value>
+                        <object>
+                          <klass>
+                            <global name="DateTime" module="DateTime.DateTime"/>
+                          </klass>
+                          <tuple>
+                            <none/>
+                          </tuple>
+                          <state>
+                            <tuple>
+                              <float>1604604963.18</float>
+                              <string>UTC</string>
+                            </tuple>
+                          </state>
+                        </object>
+                      </value>
+                  </item>
+                  <item>
+                      <key> <string>validation_state</string> </key>
+                      <value> <string>published_alive</string> </value>
+                  </item>
+                </dictionary>
+              </list>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_log</string> </key>
+            <value>
+              <list>
+                <dictionary>
+                  <item>
+                      <key> <string>action</string> </key>
+                      <value> <string>edit</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>actor</string> </key>
+                      <value> <string>zope</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>comment</string> </key>
+                      <value>
+                        <none/>
+                      </value>
+                  </item>
+                  <item>
+                      <key> <string>error_message</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>serial</string> </key>
+                      <value> <string>987.50904.3484.6212</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>state</string> </key>
+                      <value> <string>current</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>time</string> </key>
+                      <value>
+                        <object>
+                          <klass>
+                            <global name="DateTime" module="DateTime.DateTime"/>
+                          </klass>
+                          <tuple>
+                            <none/>
+                          </tuple>
+                          <state>
+                            <tuple>
+                              <float>1604605153.9</float>
+                              <string>UTC</string>
+                            </tuple>
+                          </state>
+                        </object>
+                      </value>
+                  </item>
+                </dictionary>
+              </list>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_log</string> </key>
+            <value>
+              <list>
+                <dictionary>
+                  <item>
+                      <key> <string>action</string> </key>
+                      <value> <string>detect_converted_file</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>actor</string> </key>
+                      <value> <string>zope</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>comment</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>error_message</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>external_processing_state</string> </key>
+                      <value> <string>converted</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>serial</string> </key>
+                      <value> <string>0.0.0.0</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>time</string> </key>
+                      <value>
+                        <object>
+                          <klass>
+                            <global name="DateTime" module="DateTime.DateTime"/>
+                          </klass>
+                          <tuple>
+                            <none/>
+                          </tuple>
+                          <state>
+                            <tuple>
+                              <float>1604603956.8</float>
+                              <string>UTC</string>
+                            </tuple>
+                          </state>
+                        </object>
+                      </value>
+                  </item>
+                </dictionary>
+              </list>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.js
new file mode 100644
index 0000000000..1e982a28cd
--- /dev/null
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.js
@@ -0,0 +1,98 @@
+/*global window, document, rJS, RSVP, Blob, console */
+/*jslint nomen: true, indent: 2, maxerr: 3 */
+(function (window, document, rJS, RSVP, Blob, console) {
+  "use strict";
+
+  function downloadHTML(gadget, html_content, title) {
+    var element = gadget.element,
+      a = window.document.createElement("a"),
+      url = window.URL.createObjectURL(new Blob([html_content], {type: 'text/plain'})),
+      name_list = [title, "html"];
+    element.appendChild(a);
+    a.style = "display: none";
+    a.href = url;
+    a.download = name_list.join('.');
+    a.click();
+    element.removeChild(a);
+    window.URL.revokeObjectURL(url);
+  }
+
+  function removeScripts(head_inner_html) {
+    var div = document.createElement('div'), script_list, i;
+    div.innerHTML = head_inner_html;
+    script_list = div.getElementsByTagName('script');
+    i = script_list.length;
+    while (i--) {
+      script_list[i].parentNode.removeChild(script_list[i]);
+    }
+    return div.innerHTML;
+  }
+
+  rJS(window)
+
+    /////////////////////////////////////////////////////////////////
+    // Acquired methods
+    /////////////////////////////////////////////////////////////////
+
+    .declareAcquiredMethod("jio_get", "jio_get")
+
+    /////////////////////////////////////////////////////////////////
+    // declared methods
+    /////////////////////////////////////////////////////////////////
+
+    .declareMethod('preRenderDocument', function (parent_options) {
+      return this.jio_get(parent_options.jio_key);
+    })
+
+    .declareMethod('handleSubmit', function (content_dict, parent_options) {
+      var gadget = this,
+        notebook_html,
+        return_submit_dict = {};
+      return_submit_dict.redirect = {
+        command: 'display',
+        options: {
+          jio_key: parent_options.action_options.jio_key,
+          editable: true
+        }
+      };
+      return parent_options.gadget.getDeclaredGadget("fg")
+        .push(function (form_gadget) {
+          return form_gadget.getContent();
+        })
+        .push(function (content_dict) {
+          if (Object.keys(content_dict).length === 0) {
+            return_submit_dict.notify = {
+              message: "Wait until the notebook is fully executed",
+              status: "error"
+            };
+            delete return_submit_dict.redirect;
+            return return_submit_dict;
+          }
+          notebook_html = removeScripts(content_dict.text_content);
+          return new RSVP.Queue()
+            .push(function () {
+              return downloadHTML(gadget, notebook_html,
+                                  parent_options.doc.title);
+            })
+            .push(function () {
+              return return_submit_dict;
+            })
+            .push(undefined, function (error) {
+              console.log("ERROR:", error);
+              return_submit_dict.notify = {
+                message: "Failure exporting document",
+                status: "error"
+              };
+              return_submit_dict.redirect = {
+                command: 'display',
+                options: {
+                  jio_key: parent_options.action_options.jio_key,
+                  editable: true
+                }
+              };
+              return return_submit_dict;
+            });
+        });
+    });
+
+}(window, document, rJS, RSVP, Blob, console));
\ No newline at end of file
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.xml
new file mode 100644
index 0000000000..06aabba483
--- /dev/null
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/officejs_notebook_download_html_action_js.xml
@@ -0,0 +1,336 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="Web Script" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_Access_contents_information_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Add_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Change_local_roles_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_Modify_portal_content_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>_View_Permission</string> </key>
+            <value>
+              <tuple>
+                <string>Anonymous</string>
+                <string>Assignee</string>
+                <string>Assignor</string>
+                <string>Associate</string>
+                <string>Auditor</string>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_md5</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>content_type</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_reference</string> </key>
+            <value> <string>notebook_download_html_action.js</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>officejs_notebook_download_html_action_js</string> </value>
+        </item>
+        <item>
+            <key> <string>language</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Web Script</string> </value>
+        </item>
+        <item>
+            <key> <string>short_title</string> </key>
+            <value> <string>Notebook Download Html Action JS</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>OfficeJS Notebook Download Html Action JS</string> </value>
+        </item>
+        <item>
+            <key> <string>version</string> </key>
+            <value> <string>001</string> </value>
+        </item>
+        <item>
+            <key> <string>workflow_history</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <global name="PersistentMapping" module="Persistence.mapping"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>document_publication_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>edit_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>processing_status_workflow</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_log</string> </key>
+            <value>
+              <list>
+                <dictionary>
+                  <item>
+                      <key> <string>action</string> </key>
+                      <value> <string>publish_alive</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>actor</string> </key>
+                      <value> <string>zope</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>comment</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>error_message</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>time</string> </key>
+                      <value>
+                        <object>
+                          <klass>
+                            <global name="DateTime" module="DateTime.DateTime"/>
+                          </klass>
+                          <tuple>
+                            <none/>
+                          </tuple>
+                          <state>
+                            <tuple>
+                              <float>1604604970.05</float>
+                              <string>UTC</string>
+                            </tuple>
+                          </state>
+                        </object>
+                      </value>
+                  </item>
+                  <item>
+                      <key> <string>validation_state</string> </key>
+                      <value> <string>published_alive</string> </value>
+                  </item>
+                </dictionary>
+              </list>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="4" aka="AAAAAAAAAAQ=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_log</string> </key>
+            <value>
+              <list>
+                <dictionary>
+                  <item>
+                      <key> <string>action</string> </key>
+                      <value> <string>edit</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>actor</string> </key>
+                      <value> <string>zope</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>comment</string> </key>
+                      <value>
+                        <none/>
+                      </value>
+                  </item>
+                  <item>
+                      <key> <string>error_message</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>serial</string> </key>
+                      <value> <string>988.12762.62453.43076</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>state</string> </key>
+                      <value> <string>current</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>time</string> </key>
+                      <value>
+                        <object>
+                          <klass>
+                            <global name="DateTime" module="DateTime.DateTime"/>
+                          </klass>
+                          <tuple>
+                            <none/>
+                          </tuple>
+                          <state>
+                            <tuple>
+                              <float>1606248876.05</float>
+                              <string>UTC</string>
+                            </tuple>
+                          </state>
+                        </object>
+                      </value>
+                  </item>
+                </dictionary>
+              </list>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="5" aka="AAAAAAAAAAU=">
+    <pickle>
+      <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_log</string> </key>
+            <value>
+              <list>
+                <dictionary>
+                  <item>
+                      <key> <string>action</string> </key>
+                      <value> <string>detect_converted_file</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>actor</string> </key>
+                      <value> <string>zope</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>comment</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>error_message</string> </key>
+                      <value> <string></string> </value>
+                  </item>
+                  <item>
+                      <key> <string>external_processing_state</string> </key>
+                      <value> <string>converted</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>serial</string> </key>
+                      <value> <string>0.0.0.0</string> </value>
+                  </item>
+                  <item>
+                      <key> <string>time</string> </key>
+                      <value>
+                        <object>
+                          <klass>
+                            <global name="DateTime" module="DateTime.DateTime"/>
+                          </klass>
+                          <tuple>
+                            <none/>
+                          </tuple>
+                          <state>
+                            <tuple>
+                              <float>1604603983.03</float>
+                              <string>UTC</string>
+                            </tuple>
+                          </state>
+                        </object>
+                      </value>
+                  </item>
+                </dictionary>
+              </list>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor.xml
new file mode 100644
index 0000000000..2a58141698
--- /dev/null
+++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ERP5 Form" module="erp5.portal_type"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>action_title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>edit_order</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>encoding</string> </key>
+            <value> <string>UTF-8</string> </value>
+        </item>
+        <item>
+            <key> <string>enctype</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>group_list</string> </key>
+            <value>
+              <list>
+                <string>left</string>
+                <string>right</string>
+                <string>center</string>
+                <string>bottom</string>
+                <string>hidden</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>groups</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>bottom</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>center</string> </key>
+                    <value>
+                      <list>
+                        <string>my_text_content</string>
+                      </list>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>left</string> </key>
+                    <value>
+                      <list>
+                        <string>gadget_field_action_js_script</string>
+                      </list>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>right</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Base_downloadHtmlDialogForNotebookEditor</string> </value>
+        </item>
+        <item>
+            <key> <string>method</string> </key>
+            <value> <string>POST</string> </value>
+        </item>
+        <item>
+            <key> <string>name</string> </key>
+            <value> <string>TextEditor_cloneDocument</string> </value>
+        </item>
+        <item>
+            <key> <string>pt</string> </key>
+            <value> <string>form_dialog</string> </value>
+        </item>
+        <item>
+            <key> <string>row_length</string> </key>
+            <value> <int>4</int> </value>
+        </item>
+        <item>
+            <key> <string>stored_encoding</string> </key>
+            <value> <string>UTF-8</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Download HTML</string> </value>
+        </item>
+        <item>
+            <key> <string>unicode_mode</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>update_action</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>update_action_title</string> </key>
+            <value> <string></string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/gadget_field_action_js_script.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/gadget_field_action_js_script.xml
new file mode 100644
index 0000000000..7116bc7b00
--- /dev/null
+++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/gadget_field_action_js_script.xml
@@ -0,0 +1,246 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>gadget_field_action_js_script</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>no_validator</string> </key>
+                    <value> <string>Does not support this operation.</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>data_url</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>gadget_url</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>js_sandbox</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>renderjs_extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_form_id</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>data_url</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>gadget_url</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>js_sandbox</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>renderjs_extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_form_id</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>data_url</string> </key>
+                    <value> <int>0</int> </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> <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>gadget_url</string> </key>
+                    <value> <string>notebook_download_html_action.html</string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>js_sandbox</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>renderjs_extra</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>gadget_field_action_js_script</string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/my_text_content.xml b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/my_text_content.xml
new file mode 100644
index 0000000000..8382ac136d
--- /dev/null
+++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/Base_downloadHtmlDialogForNotebookEditor/my_text_content.xml
@@ -0,0 +1,251 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_text_content</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>no_validator</string> </key>
+                    <value> <string>Does not support this operation.</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>data_url</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>gadget_url</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>js_sandbox</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>renderjs_extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_form_id</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>data_url</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>gadget_url</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>js_sandbox</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>renderjs_extra</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_form_id</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>data_url</string> </key>
+                    <value> <int>0</int> </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> <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>gadget_url</string> </key>
+                    <value> <string>gadget_editor.html</string> </value>
+                </item>
+                <item>
+                    <key> <string>hidden</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>js_sandbox</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>renderjs_extra</string> </key>
+                    <value>
+                      <list>
+                        <tuple>
+                          <string>{"editor": "jsmd_editor", "maximize": true, "run": true}</string>
+                          <string>{"editor": "jsmd_editor", "maximize": true, "run": true}</string>
+                        </tuple>
+                      </list>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Preview</string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>validator_form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/WebSection_getNotebookEditorPrecacheManifestList.py b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/WebSection_getNotebookEditorPrecacheManifestList.py
index ef26b5fcfe..713b1f44e4 100644
--- a/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/WebSection_getNotebookEditorPrecacheManifestList.py
+++ b/bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_notebook/WebSection_getNotebookEditorPrecacheManifestList.py
@@ -24,6 +24,7 @@ url_list = [
   "pyodide.asm.data",
   "pyodide.asm.wasm",
   "pandas.js",
+  "pandas.data",
   "pyodide.asm.html",
   "pyparsing.data",
   "pyparsing.js",
@@ -41,8 +42,11 @@ url_list = [
   "notebook_preview_view.js",
   "notebook_export_action.html",
   "notebook_export_action.js",
+  "notebook_download_html_action.html",
+  "notebook_download_html_action.js",
   "interface.css",
-  "paged.polyfill.js"
+  "paged.polyfill.js",
+  "gadget_officejs_notebook_editor.configuration"
 ]
 
 return url_list
diff --git a/bt5/erp5_officejs/bt/template_keep_last_workflow_history_only_path_list b/bt5/erp5_officejs/bt/template_keep_last_workflow_history_only_path_list
index 35e321727b..df6c8a92d2 100644
--- a/bt5/erp5_officejs/bt/template_keep_last_workflow_history_only_path_list
+++ b/bt5/erp5_officejs/bt/template_keep_last_workflow_history_only_path_list
@@ -29,6 +29,7 @@ web_site_module/officejs_cribjs/**
 web_site_module/officejs_drive_app
 web_site_module/officejs_drive_app/**
 web_site_module/officejs_export
+portal_types/Notebook/notebook_download_html
 web_site_module/officejs_notebook
 web_site_module/officejs_notebook/**
 web_site_module/officejs_pdf_viewer
diff --git a/bt5/erp5_officejs/bt/template_keep_workflow_path_list b/bt5/erp5_officejs/bt/template_keep_workflow_path_list
index b464dc58f4..34774301a8 100644
--- a/bt5/erp5_officejs/bt/template_keep_workflow_path_list
+++ b/bt5/erp5_officejs/bt/template_keep_workflow_path_list
@@ -29,6 +29,7 @@ web_site_module/officejs_cribjs/**
 web_site_module/officejs_drive_app
 web_site_module/officejs_drive_app/**
 web_site_module/officejs_export
+portal_types/Notebook/notebook_download_html
 web_site_module/officejs_notebook
 web_site_module/officejs_notebook/**
 web_site_module/officejs_pdf_viewer
diff --git a/bt5/erp5_officejs/bt/template_path_list b/bt5/erp5_officejs/bt/template_path_list
index 5b60d81587..507cf73f3d 100644
--- a/bt5/erp5_officejs/bt/template_path_list
+++ b/bt5/erp5_officejs/bt/template_path_list
@@ -9,10 +9,11 @@ portal_types/Document Module/pdf_viewer_view
 portal_types/Notebook Module/notebook_editor_view
 portal_types/Notebook Module/notebook_upload
 portal_types/Notebook/notebook_download
+portal_types/Notebook/notebook_download_html
 portal_types/Notebook/notebook_editor_clone
 portal_types/Notebook/notebook_editor_view
-portal_types/Notebook/notebook_preview
 portal_types/Notebook/notebook_export
+portal_types/Notebook/notebook_preview
 portal_types/PDF/pdf_viewer_clone
 portal_types/PDF/pdf_viewer_view
 portal_types/Test Page Module/slideshow_editor_view
@@ -65,4 +66,4 @@ web_site_module/officejs_text_editor/**
 web_site_module/officejs_todomvc
 web_site_module/officejs_wallsearch
 web_site_module/officejs_wallsearch/**
-web_site_module/officejs_whiteboard
+web_site_module/officejs_whiteboard
\ No newline at end of file
-- 
2.30.9