[Erp5-report] r36326 rafael - in /erp5/trunk/bt5/erp5_upgrader: SkinTemplateItem/portal_ski...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 14 22:42:09 CEST 2010


Author: rafael
Date: Mon Jun 14 22:42:06 2010
New Revision: 36326

URL: http://svn.erp5.org?rev=36326&view=rev
Log:
Added support to upgrade object classes using upgrader signature.

Added:
    erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_testUpgradeObjectClass.xml
    erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_upgradeObjectClass.xml
Modified:
    erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_senseFinalizeUpgrade.xml
    erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_upgradeFinalize.xml
    erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_getUpgraderSignature.xml
    erp5/trunk/bt5/erp5_upgrader/bt/revision

Modified: erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_senseFinalizeUpgrade.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_senseFinalizeUpgrade.xml?rev=36326&r1=36325&r2=36326&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_senseFinalizeUpgrade.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_senseFinalizeUpgrade.xml [utf8] Mon Jun 14 22:42:06 2010
@@ -81,6 +81,9 @@ if len(context.ERP5Site_upgradePortalTyp
 if len(context.ERP5Site_upgradeSecurity()) > 0: \n
   return True\n
 \n
+if len(context.ERP5Site_upgradeObjectClass()) > 0: \n
+  return True\n
+\n
 if len(context.ERP5Site_upgradeSQLCatalogFilter()) > 0: \n
   return True\n
 \n

Modified: erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_upgradeFinalize.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_upgradeFinalize.xml?rev=36326&r1=36325&r2=36326&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_upgradeFinalize.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/Alarm_upgradeFinalize.xml [utf8] Mon Jun 14 22:42:06 2010
@@ -102,6 +102,8 @@ message_list.extend(context.ERP5Site_upg
 \n
 message_list.extend(context.ERP5Site_upgradeSQLCatalogFilter(upgrade=1))\n
 \n
+message_list.extend(context.ERP5Site_upgradeObjectClass(upgrade=1))\n
+\n
 # Verify if there was any change previously and \n
 if len(message_list) > 0:\n
  message_list.extend(context.ERP5Site_upgradeSQLCatalog(upgrade=1))\n

Modified: erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_getUpgraderSignature.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_getUpgraderSignature.xml?rev=36326&r1=36325&r2=36326&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_getUpgraderSignature.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_getUpgraderSignature.xml [utf8] Mon Jun 14 22:42:06 2010
@@ -53,7 +53,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
+            <value> <string encoding="cdata"><![CDATA[
+
+"""\n
   The release signature is a kind of declarative\n
   specification of an upgrader.\n
 """\n
@@ -111,7 +113,6 @@ UPGRADABLE_BT5_ID_LIST = (\n
                         "erp5_mobile",\n
                         "erp5_ui_test_core",\n
                         "erp5_ui_test",\n
-                        "erp5_express_ui_test",\n
                          )\n
 \n
 # A list bt5 which are required for the upgrade\n
@@ -382,7 +383,8 @@ UPDATE_ROLE_PORTAL_TYPE_LIST = [ \'Perso
                                  \'Sale Trade Condition\',\n
                                  \'Gadget\',\n
                                  \'Knowledge Pad\',\n
-                                 \'Knowledge Box\' \n
+                                 \'Knowledge Box\', \n
+                                 \'Currency Exchange Line\'\n
                                ]\n
 \n
 # A property sheet expected to found into a Portal Type List.\n
@@ -395,6 +397,14 @@ KEEP_ORIGINAL_DICT = {\n
                \'portal_categories/function\',\n
               ),\n
 \n
+  \'erp5_dms\':(\'portal_workflow/processing_status_workflow\',\n
+              \'portal_categories/contributor\',\n
+              \'portal_skins/erp5_dms/Image_view/image_view\'\n
+             ),\n
+\n
+  \'erp5_base\':(\'portal_categories/specialise\',\n
+              ),\n
+\n
   \'erp5_trade\':(\'portal_workflow/delivery_tax_interaction_workflow\',\n
                 \'portal_workflow/tax_interaction_workflow\',\n
                 \'tax_module\',\n
@@ -414,11 +424,6 @@ KEEP_ORIGINAL_DICT = {\n
   \'erp5_wizard\':(\'portal_preferences/erp5_express_default_customer_preference\',\n
                 ),\n
 \n
-  \'erp5_express_ui_test\':(\'portal_type_roles/Person Module\',\n
-                          \'portal_type_roles/Person\',\n
-                          \'portal_type_roles/Organisation Module\',\n
-                ),\n
-\n
 }\n
 \n
 # Items which need validation at upgrade time\n
@@ -458,6 +463,11 @@ VALIDATION_DICT = {\n
                ),\n
 }\n
 \n
+#\n
+# Dictionary the expected filters for catalog. This is a usually determinated\n
+# by catalog.getFilterDict()\n
+#\n
+\n
 CATALOG_FILTER_DICT = { \n
    \'z_catalog_item_list\' : \'python: here.providesIMovement()\',\n
    \'z_catalog_predicate_category_list\': \'python: isPredicate\',\n
@@ -479,16 +489,42 @@ CATALOG_FILTER_DICT = { \n
    \'z_catalog_quantity_unit_conversion_list\': \'python: here.getPortalType() in here.getPortalResourceTypeList()\',\n
    \'z0_uncatalog_inventory_stock\': \'python: isInventoryMovement\'}\n
 \n
+\n
+#\n
+# List of Scripts to be run after upgrade is finished to determinate \n
+# the integrity and consistency of the instance.\n
+#\n
+\n
 INTEGRITY_VERIFICATION_SCRIPT_ID_LIST = (\'ERP5Site_verifyUpgradeIntegrity\',\n
                                          \'ERP5Site_verifyBT5UpgradeIntegrity\',\n
-                                         \'ERP5Site_verifyUserAuthentificationIntegrity\',\n
                                          \'ERP5Site_verifyMemcachedIntegrity\',\n
                                          \'ERP5Site_verifySQLCatalogFilterIntegrity\',\n
                                          \'ERP5Site_verifyActivityIntegrity\')\n
 \n
+# \n
+# Define the property and value ({\'property\' : \'value\', ...} to be set or created \n
+# into erp5 portal object.\n
+#\n
 ERP5_SITE_PROPERTY_DICT = {}\n
 \n
 \n
+#\n
+# Define instructions for migrate object class of a group of objects like:\n
+# ((    relative_url <- Folder Relative URL where the object is located.\n
+#   , \'script_to_run_before\' <- Script ID that will test if the \n
+#                               object can be migrated or not.\n
+#   , \'Products.ERP5Type.Document.FROM.CLASS\' <- Expected Class to be migrated\n
+#   , \'Products.ERP5Type.Document.TO.CLASS\'   <- Class to be Migrated.\n
+#   , \'script_to_run_after\' <- Script ID that will run after test it finished.\n
+# ), )\n
+# \n
+\n
+UPGRADE_OBJECT_CLASS_LIST = ( (\'portal_gadgets\', \n
+                          \'ERP5Site_testUpgradeObjectClass\',\n
+                          \'Products.ERP5Type.Document.Folder.Folder\', \n
+                          \'Products.ERP5Type.Document.Gadget.Gadget\', \n
+                          \'ERP5Site_testUpgradeObjectClass\'  ), )\n
+\n
 # Wrap everything into a dict\n
 signature_dict = {\n
    # Defines the default release for bt5\n
@@ -525,13 +561,17 @@ signature_dict = {\n
  , \'portal_type_property_sheet_list\' : PORTAL_TYPE_PROPERTY_SHEET_LIST\n
    # Provide a list of Properties Expected at ERP5Site portal\n
  , \'erp5_site_property_dict\' : ERP5_SITE_PROPERTY_DICT\n
+   # Provide a list of tuples with informations to upgrade object class\n
+ , \'upgrade_object_class_list\' : UPGRADE_OBJECT_CLASS_LIST\n
 }\n
 \n
 if item is not None:\n
   return signature_dict.get(item)\n
 else:\n
   return signature_dict\n
-</string> </value>
+
+
+]]></string> </value>
         </item>
         <item>
             <key> <string>_code</string> </key>
@@ -589,6 +629,7 @@ else:\n
                             <string>CATALOG_FILTER_DICT</string>
                             <string>INTEGRITY_VERIFICATION_SCRIPT_ID_LIST</string>
                             <string>ERP5_SITE_PROPERTY_DICT</string>
+                            <string>UPGRADE_OBJECT_CLASS_LIST</string>
                             <string>signature_dict</string>
                           </tuple>
                         </value>

Added: erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_testUpgradeObjectClass.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_testUpgradeObjectClass.xml?rev=36326&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_testUpgradeObjectClass.xml (added)
+++ erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_testUpgradeObjectClass.xml [utf8] Mon Jun 14 22:42:06 2010
@@ -0,0 +1,125 @@
+<?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>"""\n
+  Dummy script used by Upgrader Script\n
+"""\n
+return [ (upgrade_object.getRelativeUrl(), upgrade_object.getMetaType()) ]\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>upgrade_object</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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>upgrade_object</string>
+                            <string>_getattr_</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>ERP5Site_testUpgradeObjectClass</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_upgradeObjectClass.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_upgradeObjectClass.xml?rev=36326&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_upgradeObjectClass.xml (added)
+++ erp5/trunk/bt5/erp5_upgrader/SkinTemplateItem/portal_skins/erp5_upgrader/ERP5Site_upgradeObjectClass.xml [utf8] Mon Jun 14 22:42:06 2010
@@ -0,0 +1,163 @@
+<?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>"""\n
+  Migrate Object Classes based on upgrade signature\n
+"""\n
+class_signature_list = context.ERP5Site_getUpgraderSignature(\'upgrade_object_class_list\')\n
+\n
+portal = context.getPortalObject()\n
+message_list = []\n
+\n
+test_only = not upgrade\n
+\n
+for object_class in class_signature_list:\n
+  folder, test_before , from_class, to_class , test_after = object_class\n
+  folder_object = portal.restrictedTraverse(folder)\n
+  test_before_method = getattr(context, test_before )\n
+  test_after_method = getattr(context, test_after )\n
+  result = folder_object.upgradeObjectClass(test_before_method, \n
+                                            from_class, \n
+                                            to_class, \n
+                                            test_after_method, \n
+                                            test_only)\n
+  message_list.extend(result)\n
+\n
+return message_list\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>upgrade=0</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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>upgrade</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>class_signature_list</string>
+                            <string>portal</string>
+                            <string>message_list</string>
+                            <string>test_only</string>
+                            <string>_getiter_</string>
+                            <string>object_class</string>
+                            <string>folder</string>
+                            <string>test_before</string>
+                            <string>from_class</string>
+                            <string>to_class</string>
+                            <string>test_after</string>
+                            <string>folder_object</string>
+                            <string>getattr</string>
+                            <string>test_before_method</string>
+                            <string>test_after_method</string>
+                            <string>result</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <int>0</int>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>ERP5Site_upgradeObjectClass</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_upgrader/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_upgrader/bt/revision?rev=36326&r1=36325&r2=36326&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_upgrader/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_upgrader/bt/revision [utf8] Mon Jun 14 22:42:06 2010
@@ -1 +1 @@
-522
\ No newline at end of file
+527
\ No newline at end of file




More information about the Erp5-report mailing list