From 347ca8f60d0a09f0c357895f688e55111ac1c873 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Mon, 1 Feb 2010 13:53:11 +0000
Subject: [PATCH] remove some useless scripts. Make all resource using
 Resource_init script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32143 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_types/Apparel%20Assortment.xml     |   2 +-
 .../portal_types/Apparel%20Cloth.xml          |   2 +-
 .../portal_types/Apparel%20Colour%20Range.xml |   2 +-
 .../portal_types/Apparel%20Component.xml      |   2 +-
 .../portal_types/Apparel%20Fabric%20Item.xml  |  28 ++--
 .../portal_types/Apparel%20Model.xml          |   2 +-
 .../portal_types/Apparel%20Shape.xml          |   2 +-
 .../erp5_apparel/ApparelFabricItem_init.xml   | 125 -----------------
 .../erp5_apparel/ApparelFabric_initScript.xml |   1 -
 .../ApparelResource_initScript.xml            | 125 -----------------
 .../portal_skins/erp5_apparel/Use_init.xml    | 130 ------------------
 bt5/erp5_apparel/bt/revision                  |   2 +-
 12 files changed, 25 insertions(+), 398 deletions(-)
 delete mode 100644 bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabricItem_init.xml
 delete mode 100644 bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelResource_initScript.xml
 delete mode 100644 bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Use_init.xml

diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Assortment.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Assortment.xml
index 2624514e72..4ba0b27a86 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Assortment.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Assortment.xml
@@ -68,7 +68,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>Use_init</string> </value>
+            <value> <string>Resource_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Cloth.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Cloth.xml
index 6fd856ca0e..bd9826aeb9 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Cloth.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Cloth.xml
@@ -65,7 +65,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>ApparelResource_initScript</string> </value>
+            <value> <string>Resource_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Colour%20Range.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Colour%20Range.xml
index 8a824d3e21..1bfbc755a6 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Colour%20Range.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Colour%20Range.xml
@@ -68,7 +68,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>ApparelResource_initScript</string> </value>
+            <value> <string>Resource_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Component.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Component.xml
index c19110cfb8..5d50036670 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Component.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Component.xml
@@ -78,7 +78,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>ApparelResource_initScript</string> </value>
+            <value> <string>Resource_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Fabric%20Item.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Fabric%20Item.xml
index 2b5b8c1be1..8e5d736703 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Fabric%20Item.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Fabric%20Item.xml
@@ -48,15 +48,15 @@
         </item>
         <item>
             <key> <string>description</string> </key>
-            <value> <string>        A Document can contain text that can be formatted using\n
-        *Structured Text* or *HTML*. Text can be automatically translated\n
-        through the use of \'message catalogs\'.\n
-\n
-        A Document is a terminating leaf\n
-        in the OFS. It can not contain anything.\n
-\n
-        Document inherits from XMLObject and can\n
-        be synchronized accross multiple sites.\n
+            <value> <string>        A Document can contain text that can be formatted using\r\n
+        *Structured Text* or *HTML*. Text can be automatically translated\r\n
+        through the use of \'message catalogs\'.\r\n
+\r\n
+        A Document is a terminating leaf\r\n
+        in the OFS. It can not contain anything.\r\n
+\r\n
+        Document inherits from XMLObject and can\r\n
+        be synchronized accross multiple sites.\r\n
 </string> </value>
         </item>
         <item>
@@ -85,7 +85,15 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>ApparelFabricItem_init</string> </value>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>permission</string> </key>
+            <value>
+              <none/>
+            </value>
         </item>
         <item>
             <key> <string>title</string> </key>
diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Model.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Model.xml
index 9921580ea0..2ff911faae 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Model.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Model.xml
@@ -78,7 +78,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>ApparelResource_initScript</string> </value>
+            <value> <string>Resource_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
diff --git a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Shape.xml b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Shape.xml
index 28577d0da8..c985e25897 100644
--- a/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Shape.xml
+++ b/bt5/erp5_apparel/PortalTypeTemplateItem/portal_types/Apparel%20Shape.xml
@@ -65,7 +65,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string>ApparelResource_initScript</string> </value>
+            <value> <string>Resource_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabricItem_init.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabricItem_init.xml
deleted file mode 100644
index f2195bd26b..0000000000
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabricItem_init.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>context.edit(\n
-  title=context.getId()\n
-)\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>**kw</string> </value>
-        </item>
-        <item>
-            <key> <string>errors</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_code</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>co_argcount</string> </key>
-                        <value> <int>0</int> </value>
-                    </item>
-                    <item>
-                        <key> <string>co_varnames</string> </key>
-                        <value>
-                          <tuple>
-                            <string>kw</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                          </tuple>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_defaults</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>ApparelFabricItem_init</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_initScript.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_initScript.xml
index ac06321f1a..7a95b4f80f 100644
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_initScript.xml
+++ b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelFabric_initScript.xml
@@ -54,7 +54,6 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>context.setQuantityUnitList([\'length/meter\', \'area/squarecent\'])\n
-context.Use_init()\n
 context.Resource_init()\n
 </string> </value>
         </item>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelResource_initScript.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelResource_initScript.xml
deleted file mode 100644
index f09bd273ac..0000000000
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelResource_initScript.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>context.Use_init()\n
-context.Resource_init()\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>*args, **kw</string> </value>
-        </item>
-        <item>
-            <key> <string>errors</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_code</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>co_argcount</string> </key>
-                        <value> <int>0</int> </value>
-                    </item>
-                    <item>
-                        <key> <string>co_varnames</string> </key>
-                        <value>
-                          <tuple>
-                            <string>args</string>
-                            <string>kw</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                          </tuple>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_defaults</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>ApparelResource_initScript</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Use_init.xml b/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Use_init.xml
deleted file mode 100644
index c0f8c238ab..0000000000
--- a/bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/Use_init.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>portal_type = context.getPortalType().lower().replace(\' \', \'_\')\n
-\n
-use_list = context.portal_preferences.getPreference(\'preferred_%s_use_list\' % portal_type)\n
-if use_list:\n
-  context.edit(use_list=use_list)\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_code</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>*args, **kw</string> </value>
-        </item>
-        <item>
-            <key> <string>errors</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_code</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>co_argcount</string> </key>
-                        <value> <int>0</int> </value>
-                    </item>
-                    <item>
-                        <key> <string>co_varnames</string> </key>
-                        <value>
-                          <tuple>
-                            <string>args</string>
-                            <string>kw</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                            <string>portal_type</string>
-                            <string>use_list</string>
-                          </tuple>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>func_defaults</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>Use_init</string> </value>
-        </item>
-        <item>
-            <key> <string>warnings</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_apparel/bt/revision b/bt5/erp5_apparel/bt/revision
index b8e817d4f8..ae4d10b425 100644
--- a/bt5/erp5_apparel/bt/revision
+++ b/bt5/erp5_apparel/bt/revision
@@ -1 +1 @@
-255
\ No newline at end of file
+256
\ No newline at end of file
-- 
2.30.9