From 95f89e4918b1fa94a35c99ffcd68de6e23e6194f Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Fri, 14 May 2010 13:35:44 +0000
Subject: [PATCH] replace my_text_format field by my_content_type

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35348 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_web/Base_viewWebFieldLibrary.xml     |  1 +
 .../my_content_type.xml                       | 93 +++++++++++++++++++
 .../erp5_web/WebPage_viewEditor.xml           |  2 +-
 ...my_text_format.xml => my_content_type.xml} | 68 +-------------
 .../WebPage_viewFieldLibrary/text_content.xml | 45 ++++-----
 bt5/erp5_web/bt/revision                      |  2 +-
 6 files changed, 118 insertions(+), 93 deletions(-)
 create mode 100644 bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary/my_content_type.xml
 rename bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/{my_text_format.xml => my_content_type.xml} (52%)

diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary.xml
index 9e35956c43..4adffad469 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary.xml
@@ -111,6 +111,7 @@
                         <string>my_radio_field</string>
                         <string>my_title</string>
                         <string>my_editor_field</string>
+                        <string>my_content_type</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary/my_content_type.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary/my_content_type.xml
new file mode 100644
index 0000000000..31b5e8f9e2
--- /dev/null
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_viewWebFieldLibrary/my_content_type.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_content_type</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>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_content_type</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor.xml
index d45b0aad93..063fba57d3 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor.xml
@@ -81,7 +81,7 @@
                     <key> <string>left (Page Properties)</string> </key>
                     <value>
                       <list>
-                        <string>my_text_format</string>
+                        <string>my_content_type</string>
                         <string>my_text_content_substitution_mapping_method_id</string>
                       </list>
                     </value>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/my_text_format.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/my_content_type.xml
similarity index 52%
rename from bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/my_text_format.xml
rename to bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/my_content_type.xml
index c8103c63b4..45858e1f8a 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/my_text_format.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewEditor/my_content_type.xml
@@ -12,17 +12,12 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list>
-                <string>description</string>
-                <string>title</string>
-                <string>items</string>
-                <string>orientation</string>
-              </list>
+              <list/>
             </value>
         </item>
         <item>
             <key> <string>id</string> </key>
-            <value> <string>my_text_format</string> </value>
+            <value> <string>my_content_type</string> </value>
         </item>
         <item>
             <key> <string>message_values</string> </key>
@@ -66,12 +61,6 @@
                     <key> <string>form_id</string> </key>
                     <value> <string></string> </value>
                 </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-                    </value>
-                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
@@ -83,73 +72,22 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
-                <item>
-                    <key> <string>description</string> </key>
-                    <value> <string>The text format used by default</string> </value>
-                </item>
                 <item>
                     <key> <string>field_id</string> </key>
-                    <value> <string>my_radio_field</string> </value>
+                    <value> <string>my_content_type</string> </value>
                 </item>
                 <item>
                     <key> <string>form_id</string> </key>
                     <value> <string>Base_viewWebFieldLibrary</string> </value>
                 </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <list>
-                        <tuple>
-                          <string>HTML</string>
-                          <string>text/html</string>
-                        </tuple>
-                        <tuple>
-                          <string>Plain Text</string>
-                          <string>text/plain</string>
-                        </tuple>
-                        <tuple>
-                          <string>Structured Text</string>
-                          <string>text/structured</string>
-                        </tuple>
-                        <tuple>
-                          <string>reStructuredText</string>
-                          <string>text/x-rst</string>
-                        </tuple>
-                      </list>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>orientation</string> </key>
-                    <value> <string>horizontal</string> </value>
-                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string>Click to edit the target</string> </value>
                 </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string>Text Format</string> </value>
-                </item>
               </dictionary>
             </value>
         </item>
       </dictionary>
     </pickle>
   </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <tuple>
-        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_text</string> </key>
-            <value> <string>python: [(context.Base_translateString(x[0]), x[1]) for x in ((\'HTML\', \'text/html\'), (\'Plain Text\', \'text/plain\'), (\'reStructuredText\', \'text/x-rst\'))]</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
 </ZopeData>
diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewFieldLibrary/text_content.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewFieldLibrary/text_content.xml
index 2afccdef5a..70527dccab 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewFieldLibrary/text_content.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebPage_viewFieldLibrary/text_content.xml
@@ -13,11 +13,10 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>enabled</string>
                 <string>title</string>
-                <string>width</string>
                 <string>whitespace_preserve</string>
-                <string>default</string>
-                <string>enabled</string>
+                <string>width</string>
               </list>
             </value>
         </item>
@@ -59,16 +58,10 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
-                <item>
-                    <key> <string>default</string> </key>
-                    <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
-                    </value>
-                </item>
                 <item>
                     <key> <string>enabled</string> </key>
                     <value>
-                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
                     </value>
                 </item>
                 <item>
@@ -83,6 +76,18 @@
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>whitespace_preserve</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>width</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -90,6 +95,10 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string>my_text_content</string> </value>
@@ -121,22 +130,6 @@
     </pickle>
   </record>
   <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <tuple>
-        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_text</string> </key>
-            <value> <string>here/asStrippedHTML</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="3" aka="AAAAAAAAAAM=">
     <pickle>
       <tuple>
         <global name="TALESMethod" module="Products.Formulator.TALESField"/>
diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision
index b475567cd6..cebfe35138 100644
--- a/bt5/erp5_web/bt/revision
+++ b/bt5/erp5_web/bt/revision
@@ -1 +1 @@
-945
\ No newline at end of file
+946
\ No newline at end of file
-- 
2.30.9