Commit 941470e4 authored by Jean-Paul Smets's avatar Jean-Paul Smets

added setId


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@961 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bfcfaeee
...@@ -490,10 +490,22 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana ...@@ -490,10 +490,22 @@ class Base( CopyContainer, PortalContent, Base18, ActiveObject, ERP5PropertyMana
self.activate().updateRelatedContent(previous_relative_url, new_relative_url) self.activate().updateRelatedContent(previous_relative_url, new_relative_url)
#self.activate().recursiveImmediateReindexObject() # Required to update path / relative_url of subobjects #self.activate().recursiveImmediateReindexObject() # Required to update path / relative_url of subobjects
security.declareProtected( Permissions.ModifyPortalContent, 'setId' )
def setId(self, id, reindex = 1):
"""
changes id of an object by calling the Zope machine
"""
self.recursiveFlushActivity(invoke=1) # Do not rename until everything flushed
previous_relative_url = self.getRelativeUrl()
self.aq_parent.manage_renameObjects([self.id], [id])
new_relative_url = self.getRelativeUrl()
if reindex: self.flushActivity(invoke=1) # Required if we wish that news ids appear instantly
self.activate().updateRelatedContent(previous_relative_url, new_relative_url)
security.declareProtected( Permissions.ModifyPortalContent, 'updateRelatedContent' ) security.declareProtected( Permissions.ModifyPortalContent, 'updateRelatedContent' )
def updateRelatedContent(self, previous_category_url, new_category_url): def updateRelatedContent(self, previous_category_url, new_category_url):
""" """
updateRelatedContent is implemented by portal_categories
""" """
self._getCategoryTool().updateRelatedContent(self, previous_category_url, new_category_url) self._getCategoryTool().updateRelatedContent(self, previous_category_url, new_category_url)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment