From 1f475772925b68eb411b1f83caa5f48301c47faf Mon Sep 17 00:00:00 2001
From: Vincent Bechu <vincent.bechu@nexedi.com>
Date: Thu, 5 Oct 2017 15:16:12 +0000
Subject: [PATCH] [OfficeJS] Add dateupdater storage on top of all officejs
 storage

And adapt cache
---
 .../web_page_module/gadget_officejs_bookmark_view_js.js     | 1 -
 .../web_page_module/gadget_officejs_bookmark_view_js.xml    | 4 ++--
 .../web_page_module/gadget_officejs_jio_js.js               | 5 +++++
 .../web_page_module/gadget_officejs_jio_js.xml              | 6 +++---
 .../web_page_module/gadget_officejs_jio_pdf_view_js.js      | 1 -
 .../web_page_module/gadget_officejs_jio_pdf_view_js.xml     | 4 ++--
 .../gadget_officejs_jio_web_illustration_view_js.js         | 1 -
 .../gadget_officejs_jio_web_illustration_view_js.xml        | 4 ++--
 .../web_page_module/gadget_officejs_jio_web_page_view_js.js | 1 -
 .../gadget_officejs_jio_web_page_view_js.xml                | 4 ++--
 .../web_page_module/gadget_image_editor_officejs_view_js.js | 1 -
 .../gadget_image_editor_officejs_view_js.xml                | 4 ++--
 .../web_page_module/gadget_web_table_view_js.js             | 1 -
 .../web_page_module/gadget_web_table_view_js.xml            | 4 ++--
 .../gadget_ooffice_jio_presentation_view_js.js              | 1 -
 .../gadget_ooffice_jio_presentation_view_js.xml             | 4 ++--
 .../gadget_ooffice_jio_spreadsheet_view_js.js               | 1 -
 .../gadget_ooffice_jio_spreadsheet_view_js.xml              | 4 ++--
 .../web_page_module/gadget_ooffice_jio_text_view_js.js      | 1 -
 .../web_page_module/gadget_ooffice_jio_text_view_js.xml     | 4 ++--
 20 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.js
index 2434829c03..222e5de6bb 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.js
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.js
@@ -50,7 +50,6 @@
             doc = gadget.state.doc;
             doc.text_content = content.text_content;
           }
-          doc.modification_date = (new Date()).toUTCString();
           return gadget.jio_put(gadget.state.jio_key, doc);
         })
         .push(function () {
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.xml
index 629f0db9cf..8247b7ee81 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_bookmark_view_js.xml
@@ -236,7 +236,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37006.38613.44356</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -254,7 +254,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195115.29</float>
+                        <float>1507216731.96</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js
index 6b939c82f2..86be8d4f0b 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.js
@@ -70,6 +70,11 @@
       if (jio_options === undefined) {
         return;
       }
+      jio_options = {
+        type: 'dateupdater',
+        sub_storage: jio_options,
+        property_list: ['modification_date']
+      };
       try {
         this.state_parameter_dict.jio_storage = jIO.createJIO(jio_options);
       } catch (error) {
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml
index 4624f29c8c..df7055f795 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_js.xml
@@ -222,7 +222,7 @@
             </item>
             <item>
                 <key> <string>actor</string> </key>
-                <value> <string>zope</string> </value>
+                <value> <string>vincent</string> </value>
             </item>
             <item>
                 <key> <string>comment</string> </key>
@@ -236,7 +236,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.14325.54663.48878</string> </value>
+                <value> <string>962.36985.29761.10359</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -254,7 +254,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1505921031.1</float>
+                        <float>1507216488.77</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.js
index f5f0313397..41e63d0311 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.js
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.js
@@ -49,7 +49,6 @@
                 return gadget.jio_putAttachment(gadget.state.doc.jio_key, "data", blob);
               });
           }
-          doc.modification_date = (new Date()).toISOString();
         })
         .push(function () {
           return gadget.jio_put(gadget.state.jio_key, doc);
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml
index c841f4df23..12beca4458 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_pdf_view_js.xml
@@ -233,7 +233,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37007.2490.4437</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -251,7 +251,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195142.2</float>
+                        <float>1507216751.29</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.js
index 563dfb0cef..3713d8e00d 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.js
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.js
@@ -46,7 +46,6 @@
             doc = gadget.state.doc;
             doc.text_content = content.text_content;
           }
-          doc.modification_date = (new Date()).toISOString();
           return gadget.jio_put(gadget.state.jio_key, doc);
         })
         .push(function () {
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.xml
index 776725e810..0283c1507b 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_illustration_view_js.xml
@@ -273,7 +273,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37007.62049.31914</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -291,7 +291,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195196.76</float>
+                        <float>1507216794.53</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.js b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.js
index e5814a7aaf..0a6093d74a 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.js
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.js
@@ -46,7 +46,6 @@
             doc = gadget.state.doc;
             doc.text_content = content.text_content;
           }
-          doc.modification_date = (new Date()).toISOString();
           return gadget.jio_put(gadget.state.jio_key, doc);
         })
         .push(function () {
diff --git a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.xml b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.xml
index e12c7f390b..d72502ae2a 100644
--- a/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.xml
+++ b/bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_jio_web_page_view_js.xml
@@ -232,7 +232,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37008.9624.51234</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -250,7 +250,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195208.76</float>
+                        <float>1507216802.33</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.js b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.js
index f930184153..fea3cf5f37 100644
--- a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.js
+++ b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.js
@@ -52,7 +52,6 @@
                 return gadget.jio_putAttachment(gadget.state.jio_key, "data", blob);
               });
           }
-          doc.modification_date = (new Date()).toISOString();
         })
         .push(function () {
           return gadget.jio_put(gadget.state.jio_key, doc);
diff --git a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.xml b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.xml
index 8fc4ca9456..e099b84c58 100644
--- a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.xml
+++ b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_image_editor_officejs_view_js.xml
@@ -235,7 +235,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37006.51899.60586</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -253,7 +253,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195127.46</float>
+                        <float>1507216742.11</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.js b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.js
index 5b3b6db46e..04e319bf4d 100644
--- a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.js
+++ b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.js
@@ -46,7 +46,6 @@
             doc = gadget.state.doc;
             doc.text_content = content.text_content;
           }
-          doc.modification_date = (new Date()).toISOString();
           return gadget.jio_put(gadget.state.jio_key, doc);
         })
         .push(function () {
diff --git a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.xml b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.xml
index 50e8084932..612e822e86 100644
--- a/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.xml
+++ b/bt5/erp5_officejs_jquery_app/PathTemplateItem/web_page_module/gadget_web_table_view_js.xml
@@ -227,7 +227,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37008.22150.56354</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -245,7 +245,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195220.23</float>
+                        <float>1507216811.32</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.js b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.js
index 31615fea95..dc3dc282be 100644
--- a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.js
+++ b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.js
@@ -52,7 +52,6 @@
               jIO.util.dataURItoBlob(content.text_content)
             );
           }
-          doc.modification_date = (new Date()).toISOString();
         })
         .push(function () {
           return gadget.jio_put(gadget.state.jio_key, doc);
diff --git a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.xml b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.xml
index ce9b9f8541..f1e3910d3f 100644
--- a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.xml
+++ b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_presentation_view_js.xml
@@ -233,7 +233,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37007.20027.35498</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -251,7 +251,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195158.28</float>
+                        <float>1507216762.23</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.js b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.js
index d46c48e491..bec734b9d0 100644
--- a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.js
+++ b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.js
@@ -52,7 +52,6 @@
               jIO.util.dataURItoBlob(content.text_content)
             );
           }
-          doc.modification_date = (new Date()).toISOString();
         })
         .push(function () {
           return gadget.jio_put(gadget.state.jio_key, doc);
diff --git a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.xml b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.xml
index 6f882fbd74..3bd470e6ca 100644
--- a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.xml
+++ b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_spreadsheet_view_js.xml
@@ -233,7 +233,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37007.35052.50005</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -251,7 +251,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195172.04</float>
+                        <float>1507216770.69</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
diff --git a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.js b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.js
index c7b80a8726..a56d2676ea 100644
--- a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.js
+++ b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.js
@@ -52,7 +52,6 @@
               jIO.util.dataURItoBlob(content.text_content)
             );
           }
-          doc.modification_date = (new Date()).toISOString();
         })
         .push(function () {
           return gadget.jio_put(gadget.state.jio_key, doc);
diff --git a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.xml b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.xml
index fa8b7900f4..d1f808c642 100644
--- a/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.xml
+++ b/bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_jio_text_view_js.xml
@@ -233,7 +233,7 @@
             </item>
             <item>
                 <key> <string>serial</string> </key>
-                <value> <string>962.36985.29761.10359</string> </value>
+                <value> <string>962.37007.50396.49885</string> </value>
             </item>
             <item>
                 <key> <string>state</string> </key>
@@ -251,7 +251,7 @@
                     </tuple>
                     <state>
                       <tuple>
-                        <float>1507195186.09</float>
+                        <float>1507216779.66</float>
                         <string>UTC</string>
                       </tuple>
                     </state>
-- 
2.30.9