[Erp5-report] r42728 nicolas.dumazet - in /erp5/trunk/products/ERP5: ./ Interactor/
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jan 28 09:46:59 CET 2011
Author: nicolas.dumazet
Date: Fri Jan 28 09:46:58 2011
New Revision: 42728
URL: http://svn.erp5.org?rev=42728&view=rev
Log:
_aq_reset is now only a subset of resetDynamicDocuments:
we need to update generated portal types as well
Added:
erp5/trunk/products/ERP5/Interactor/PortalTypeClassInteractor.py
- copied, changed from r42244, erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py
Removed:
erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py
Modified:
erp5/trunk/products/ERP5/Interaction.py
Modified: erp5/trunk/products/ERP5/Interaction.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Interaction.py?rev=42728&r1=42727&r2=42728&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Interaction.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Interaction.py [utf8] Fri Jan 28 09:46:58 2011
@@ -35,7 +35,6 @@ from Products.DCWorkflow.Expression impo
from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD
from Products.ERP5 import _dtmldir
-from Products.ERP5Type.Base import _aq_reset
class InteractionDefinition (SimpleItem):
meta_type = 'Workflow Interaction'
@@ -164,8 +163,8 @@ class InteractionDefinition (SimpleItem)
self.actbox_name = str(actbox_name)
self.actbox_url = str(actbox_url)
self.actbox_category = str(actbox_category)
- # reset _aq_dynamic method cache.
- _aq_reset()
+ # reset cached methods
+ self.getPortalObject().portal_types.resetDynamicDocuments()
if REQUEST is not None:
return self.manage_properties(REQUEST, 'Properties changed.')
Removed: erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py?rev=42727&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py (removed)
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Copyright (c) 2007-2009 Nexedi SA and Contributors. All Rights Reserved.
-# Jean-Paul Smets-Solanes <jp at nexedi.com>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-from Products.ERP5Type.Interactor.Interactor import Interactor
-from Products.ERP5Type.Base import _aq_reset
-
-class AqDynamicInteractor(Interactor):
- """
- This interactor handles all the calls to _aq_dynamic
- which must be trigerred whenever some parts of ERP5
- are modified and require to generate again accessors
- and dynamic properties.
- """
- def install(self):
- from Products.CMFCore.WorkflowTool import WorkflowTool
- self.on(WorkflowTool.manage_changeWorkflows).doAfter(self.resetAqDynamic)
- from Products.DCWorkflow.Transitions import Transitions
- self.on(Transitions.addTransition).doAfter(self.resetAqDynamic)
- self.on(Transitions.deleteTransitions).doAfter(self.resetAqDynamic)
- from Products.DCWorkflow.Transitions import TransitionDefinition
- self.on(TransitionDefinition.setProperties).doAfter(self.resetAqDynamic)
- from Products.DCWorkflow.Variables import Variables
- self.on(Variables.setStateVar).doAfter(self.resetAqDynamic)
- from Products.Localizer.Localizer import Localizer
- self.on(Localizer.add_language).doAfter(self.resetAqDynamic)
- self.on(Localizer.del_language).doAfter(self.resetAqDynamic)
-
- def resetAqDynamic(self, *args, **kw):
- """
- Reset _aq_dynamic
- """
- _aq_reset()
Copied: erp5/trunk/products/ERP5/Interactor/PortalTypeClassInteractor.py (from r42244, erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py)
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Interactor/PortalTypeClassInteractor.py?p2=erp5/trunk/products/ERP5/Interactor/PortalTypeClassInteractor.py&p1=erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py&r1=42244&r2=42728&rev=42728&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Interactor/AqDynamicInteractor.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Interactor/PortalTypeClassInteractor.py [utf8] Fri Jan 28 09:46:58 2011
@@ -28,31 +28,33 @@
##############################################################################
from Products.ERP5Type.Interactor.Interactor import Interactor
-from Products.ERP5Type.Base import _aq_reset
-class AqDynamicInteractor(Interactor):
+class PortalTypeClassInteractor(Interactor):
"""
- This interactor handles all the calls to _aq_dynamic
- which must be trigerred whenever some parts of ERP5
+ This interactor handles all the calls to resetDynamicDocuments
+ which must be trigered whenever some parts of ERP5
are modified and require to generate again accessors
and dynamic properties.
"""
def install(self):
from Products.CMFCore.WorkflowTool import WorkflowTool
- self.on(WorkflowTool.manage_changeWorkflows).doAfter(self.resetAqDynamic)
+ self.on(WorkflowTool.manage_changeWorkflows).doAfter(self.resetDynamic)
from Products.DCWorkflow.Transitions import Transitions
- self.on(Transitions.addTransition).doAfter(self.resetAqDynamic)
- self.on(Transitions.deleteTransitions).doAfter(self.resetAqDynamic)
+ self.on(Transitions.addTransition).doAfter(self.resetDynamic)
+ self.on(Transitions.deleteTransitions).doAfter(self.resetDynamic)
from Products.DCWorkflow.Transitions import TransitionDefinition
- self.on(TransitionDefinition.setProperties).doAfter(self.resetAqDynamic)
+ self.on(TransitionDefinition.setProperties).doAfter(self.resetDynamic)
from Products.DCWorkflow.Variables import Variables
- self.on(Variables.setStateVar).doAfter(self.resetAqDynamic)
+ self.on(Variables.setStateVar).doAfter(self.resetDynamic)
from Products.Localizer.Localizer import Localizer
- self.on(Localizer.add_language).doAfter(self.resetAqDynamic)
- self.on(Localizer.del_language).doAfter(self.resetAqDynamic)
+ self.on(Localizer.add_language).doAfter(self.resetDynamic)
+ self.on(Localizer.del_language).doAfter(self.resetDynamic)
- def resetAqDynamic(self, *args, **kw):
+ def resetDynamic(self, method_call_object, *args, **kw):
"""
- Reset _aq_dynamic
+ Call resetDynamicDocuments
"""
- _aq_reset()
+ portal = method_call_object.instance.getPortalObject()
+ types_tool = getattr(portal, 'portal_types', None)
+ if types_tool is not None:
+ types_tool.resetDynamicDocuments()
More information about the Erp5-report
mailing list