[Erp5-report] r16944 - in /erp5/trunk/products/ERP5: Document/ PropertySheet/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 10 23:15:08 CEST 2007


Author: yo
Date: Wed Oct 10 23:15:07 2007
New Revision: 16944

URL: http://svn.erp5.org?rev=16944&view=rev
Log:
Add support for tools.

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py
    erp5/trunk/products/ERP5/PropertySheet/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=16944&r1=16943&r2=16944&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Wed Oct 10 23:15:07 2007
@@ -965,6 +965,14 @@
         self._objects[relative_url] = obj
         obj.wl_clearLocks()
 
+class ToolTemplateItem(PathTemplateItem):
+  """This class is used only for making a distinction between other objects
+  and tools, because tools may not be backed up."""
+  def _backupObject(self, action, trashbin, container_path, object_id, **kw):
+    """Fake as if a trashbin is not available."""
+    return PathTemplateItem._backupObject(self, action, None, container_path,
+                                          object_id, **kw)
+
 class PreferenceTemplateItem(PathTemplateItem):
   """
   This class is used to store preference objects
@@ -3917,6 +3925,7 @@
       '_extension_item',
       '_test_item',
       '_role_item',
+      '_tool_item',
       '_message_translation_item',
       '_workflow_item',
       '_site_property_item',
@@ -4091,6 +4100,9 @@
       self._local_roles_item = \
           LocalRolesTemplateItem(
                self.getTemplateLocalRolesList())
+      self._tool_item = \
+          ToolTemplateItem(
+               self.getTemplateToolIdList())
 
       # Build each part
       for item_name in self._item_name_list:
@@ -4572,6 +4584,13 @@
       ordered list
       """
       return self._getOrderedList('template_message_translation')
+
+    def getTemplateToolIdList(self):
+      """
+      We have to set this method because we want an
+      ordered list
+      """
+      return self._getOrderedList('template_tool_id')
 
     security.declareProtected(Permissions.ManagePortal, 'export')
     def export(self, path=None, local=0, **kw):
@@ -4703,6 +4722,9 @@
       self._local_roles_item = \
           LocalRolesTemplateItem(
                self.getTemplateLocalRolesList())
+      self._tool_item = \
+          ToolTemplateItem(
+               self.getTemplateToolIdList())
 
       for item_name in self._item_name_list:
         getattr(self, item_name).importFile(bta)
@@ -4785,6 +4807,7 @@
         'CatalogRequestKey' : '_catalog_request_key_item',
         'CatalogMultivalueKey' : '_catalog_multivalue_key_item',
         'CatalogTopicKey' : '_catalog_topic_key_item',
+        'Tool': '_tool_item',
         }
 
       object_id = REQUEST.object_id
@@ -4827,7 +4850,7 @@
       # XXX Bad naming
       item_list_1 = ['_product_item', '_workflow_item', '_portal_type_item',
                      '_category_item', '_path_item', '_preference_tem',
-                     '_skin_item', '_action_item',]
+                     '_skin_item', '_action_item', '_tool_item', ]
 
       # Not considered as objects by Zope (will be exported into XML manually)
       # XXX Bad naming

Modified: erp5/trunk/products/ERP5/PropertySheet/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/PropertySheet/BusinessTemplate.py?rev=16944&r1=16943&r2=16944&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/PropertySheet/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/PropertySheet/BusinessTemplate.py Wed Oct 10 23:15:07 2007
@@ -197,6 +197,11 @@
       'default'     : () },
     { 'id'          : 'template_portal_type_roles',
       'description' : 'A list of ERP5Types for which we want to add the roles in the template',
+      'type'        : 'lines',
+      'mode'        : 'w',
+      'default'     : () },
+    { 'id'          : 'template_tool_id',
+      'description' : 'A list of Tool ids used by this template',
       'type'        : 'lines',
       'mode'        : 'w',
       'default'     : () },




More information about the Erp5-report mailing list