From ca80e0995ef18d9068f69f55b77cc6f7195093ea Mon Sep 17 00:00:00 2001
From: Sebastian Kreisel <sebastian.kreisel@nexedi.com>
Date: Thu, 30 Nov 2017 17:19:26 +0100
Subject: [PATCH] erp5_web: Add missing BT configuration, such as actions,
 allow content type, etc

---
 .../Web%20JSON/notebook_jio_view.xml          | 85 +++++++++++++++++++
 .../portal_types/Web%20JSON/view.xml          | 85 +++++++++++++++++++
 .../portal_types/Web%20JSON/view_editor.xml   | 85 +++++++++++++++++++
 .../allowed_content_types.xml                 |  1 +
 .../property_sheet_list.xml                   |  3 +
 bt5/erp5_web/bt/template_action_path_list     |  3 +
 ...late_portal_type_allowed_content_type_list |  1 +
 .../template_portal_type_property_sheet_list  |  1 +
 8 files changed, 264 insertions(+)
 create mode 100644 bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/notebook_jio_view.xml
 create mode 100644 bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view.xml
 create mode 100644 bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view_editor.xml

diff --git a/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/notebook_jio_view.xml b/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/notebook_jio_view.xml
new file mode 100644
index 0000000000..9258f3da69
--- /dev/null
+++ b/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/notebook_jio_view.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>action_type/object_view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>notebook_jio_view</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Action Information</string> </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>4.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Notebook Jio View</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </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}/WebJSON_notebookJioView</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view.xml b/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view.xml
new file mode 100644
index 0000000000..7e8b75fbe7
--- /dev/null
+++ b/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>action_type/object_view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>view</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Action Information</string> </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>1.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>View</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </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}/WebJSON_view</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view_editor.xml b/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view_editor.xml
new file mode 100644
index 0000000000..e069012015
--- /dev/null
+++ b/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20JSON/view_editor.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>categories</string> </key>
+            <value>
+              <tuple>
+                <string>action_type/object_view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>view_editor</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>Modify portal content</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>portal_type</string> </key>
+            <value> <string>Action Information</string> </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>1.1</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Edit</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </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}/WebPage_viewEditor</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_web/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_web/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
index 86083984c3..8992957d55 100644
--- a/bt5/erp5_web/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
+++ b/bt5/erp5_web/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
@@ -3,6 +3,7 @@
   <item>Embedded File</item>
  </portal_type>
  <portal_type id="Web Page Module">
+  <item>Web JSON</item>
   <item>Web Page</item>
  </portal_type>
  <portal_type id="Web Section">
diff --git a/bt5/erp5_web/PortalTypePropertySheetTemplateItem/property_sheet_list.xml b/bt5/erp5_web/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
index 631a48423f..5c77f1d36b 100644
--- a/bt5/erp5_web/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
+++ b/bt5/erp5_web/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
@@ -1,4 +1,7 @@
 <property_sheet_list>
+ <portal_type id="Web JSON">
+  <item>TextDocument</item>
+ </portal_type>
  <portal_type id="Web Page">
   <item>Reference</item>
   <item>SortIndex</item>
diff --git a/bt5/erp5_web/bt/template_action_path_list b/bt5/erp5_web/bt/template_action_path_list
index 2676e10191..0108e558ea 100644
--- a/bt5/erp5_web/bt/template_action_path_list
+++ b/bt5/erp5_web/bt/template_action_path_list
@@ -1,5 +1,8 @@
 File | web_view
 Image | web_view
+Web JSON | notebook_jio_view
+Web JSON | view
+Web JSON | view_editor
 Web Page Module | list_ui
 Web Page Module | sort_on
 Web Page Module | view
diff --git a/bt5/erp5_web/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_web/bt/template_portal_type_allowed_content_type_list
index 4a8b3aa040..4d62dffedf 100644
--- a/bt5/erp5_web/bt/template_portal_type_allowed_content_type_list
+++ b/bt5/erp5_web/bt/template_portal_type_allowed_content_type_list
@@ -1,3 +1,4 @@
+Web Page Module | Web JSON
 Web Page Module | Web Page
 Web Page | Embedded File
 Web Section | File
diff --git a/bt5/erp5_web/bt/template_portal_type_property_sheet_list b/bt5/erp5_web/bt/template_portal_type_property_sheet_list
index ab3cd0f223..bf0a364d10 100644
--- a/bt5/erp5_web/bt/template_portal_type_property_sheet_list
+++ b/bt5/erp5_web/bt/template_portal_type_property_sheet_list
@@ -1,3 +1,4 @@
+Web JSON | TextDocument
 Web Page | Reference
 Web Page | SortIndex
 Web Section | SortIndex
-- 
2.30.9