From a6fd1df81fc2628fcc54caa307173a99549979d2 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Tue, 13 Dec 2011 16:27:18 +0200
Subject: [PATCH] Move "Web Page" adjustments that affect other ERP5 web themes
 here.

---
 .../portal_types/Web%20Page/view.xml          | 81 ++++++++++++++++
 .../portal_types/Web%20Page/view_editor.xml   | 79 +++++++++++++++
 .../portal_types/Web%20Page/web_view.xml      | 96 +++++++++++++++++++
 .../workflow_chain_type.xml                   |  6 ++
 bt5/erp5_web_ung_theme/bt/change_log          |  5 +-
 bt5/erp5_web_ung_theme/bt/description         |  3 +-
 bt5/erp5_web_ung_theme/bt/revision            |  2 +-
 .../bt/template_action_path_list              |  3 +
 .../template_portal_type_workflow_chain_list  |  6 ++
 9 files changed, 278 insertions(+), 3 deletions(-)
 create mode 100644 bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view.xml
 create mode 100644 bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view_editor.xml
 create mode 100644 bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/web_view.xml
 create mode 100644 bt5/erp5_web_ung_theme/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
 create mode 100644 bt5/erp5_web_ung_theme/bt/template_action_path_list
 create mode 100644 bt5/erp5_web_ung_theme/bt/template_portal_type_workflow_chain_list

diff --git a/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view.xml b/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view.xml
new file mode 100644
index 0000000000..92dd57bbaa
--- /dev/null
+++ b/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view.xml
@@ -0,0 +1,81 @@
+<?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>priority</string> </key>
+            <value> <float>3.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}/WebPage_view</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view_editor.xml b/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view_editor.xml
new file mode 100644
index 0000000000..e8077dcddf
--- /dev/null
+++ b/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/view_editor.xml
@@ -0,0 +1,79 @@
+<?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> <string encoding="base64">Cg==</string> </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>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_ung_theme/ActionTemplateItem/portal_types/Web%20Page/web_view.xml b/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/web_view.xml
new file mode 100644
index 0000000000..44e528a490
--- /dev/null
+++ b/bt5/erp5_web_ung_theme/ActionTemplateItem/portal_types/Web%20Page/web_view.xml
@@ -0,0 +1,96 @@
+<?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_web_view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_web_view</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+            </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>web_view</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>0.9</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Web 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}/WebPage_viewEditor</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <global name="Expression" module="Products.CMFCore.Expression"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python:object is not None and object.isWebMode()  and not object.isEditableMode()</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_web_ung_theme/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/bt5/erp5_web_ung_theme/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
new file mode 100644
index 0000000000..7a7845dc2c
--- /dev/null
+++ b/bt5/erp5_web_ung_theme/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
@@ -0,0 +1,6 @@
+<workflow_chain>
+ <chain>
+  <type>Web Page</type>
+  <workflow>-document_publication_workflow, document_conversion_interaction_workflow, document_security_interaction_workflow, edit_workflow, processing_status_workflow, ung_document_publication_workflow</workflow>
+ </chain>
+</workflow_chain>
\ No newline at end of file
diff --git a/bt5/erp5_web_ung_theme/bt/change_log b/bt5/erp5_web_ung_theme/bt/change_log
index d56e10c010..08dad6e98c 100644
--- a/bt5/erp5_web_ung_theme/bt/change_log
+++ b/bt5/erp5_web_ung_theme/bt/change_log
@@ -1,3 +1,6 @@
+2012-12-13 Ivan
+* Move "Web Page" adjustments that affect other ERP5 web themes here.
+
 2011-11-15 tatuya
 * Follow Gadget objects default validation sate changing, now they are public.
 
@@ -126,4 +129,4 @@
 * Added ERP5 Form to show contents allowed in UNG WebSite and added new styles to listbox
 
 2010-10-14 gabriel
-* Clean up the bt5 because all fields were moved to erp5_web_ung_core
+* Clean up the bt5 because all fields were moved to erp5_web_ung_core
\ No newline at end of file
diff --git a/bt5/erp5_web_ung_theme/bt/description b/bt5/erp5_web_ung_theme/bt/description
index 6692258a2a..9e9f3c1c24 100644
--- a/bt5/erp5_web_ung_theme/bt/description
+++ b/bt5/erp5_web_ung_theme/bt/description
@@ -1 +1,2 @@
-The UNG Theme for ERP5. 
\ No newline at end of file
+The UNG Theme for ERP5. 
+Note: currently this bt5 heavily modifies Web Page portal type which might affect other ERP5 web themes.
\ No newline at end of file
diff --git a/bt5/erp5_web_ung_theme/bt/revision b/bt5/erp5_web_ung_theme/bt/revision
index 61ab674d69..eb8f2fa1ae 100644
--- a/bt5/erp5_web_ung_theme/bt/revision
+++ b/bt5/erp5_web_ung_theme/bt/revision
@@ -1 +1 @@
-378
+379
\ No newline at end of file
diff --git a/bt5/erp5_web_ung_theme/bt/template_action_path_list b/bt5/erp5_web_ung_theme/bt/template_action_path_list
new file mode 100644
index 0000000000..be9d0677af
--- /dev/null
+++ b/bt5/erp5_web_ung_theme/bt/template_action_path_list
@@ -0,0 +1,3 @@
+Web Page | view
+Web Page | view_editor
+Web Page | web_view
\ No newline at end of file
diff --git a/bt5/erp5_web_ung_theme/bt/template_portal_type_workflow_chain_list b/bt5/erp5_web_ung_theme/bt/template_portal_type_workflow_chain_list
new file mode 100644
index 0000000000..cacbd2ce1d
--- /dev/null
+++ b/bt5/erp5_web_ung_theme/bt/template_portal_type_workflow_chain_list
@@ -0,0 +1,6 @@
+Web Page | -document_publication_workflow
+Web Page | document_conversion_interaction_workflow
+Web Page | document_security_interaction_workflow
+Web Page | edit_workflow
+Web Page | processing_status_workflow
+Web Page | ung_document_publication_workflow
\ No newline at end of file
-- 
2.30.9