Commit dc0d0065 authored by Nicolas Delaby's avatar Nicolas Delaby

use method to delete, and call generical method after add

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15154 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1be204b9
...@@ -244,11 +244,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -244,11 +244,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
#LOG('ERP5Conduit',0,'deleteNode, Unable to delete SubObject: %s' % str(sub_object_id)) #LOG('ERP5Conduit',0,'deleteNode, Unable to delete SubObject: %s' % str(sub_object_id))
pass pass
if object_id is not None: # We do have an object_id if object_id is not None: # We do have an object_id
try: self.deleteObject(object, object_id)
object._delObject(object_id)
except (AttributeError, KeyError):
#LOG('ERP5Conduit',0,'deleteNode, Unable to delete: %s' % str(object_id))
pass
# In the case where we have to delete an user role # In the case where we have to delete an user role
# If we are still there, this means the delete is for this node # If we are still there, this means the delete is for this node
elif xml.nodeName in self.XUPDATE_DEL: elif xml.nodeName in self.XUPDATE_DEL:
...@@ -266,6 +262,14 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -266,6 +262,14 @@ class ERP5Conduit(XMLSyncUtilsMixin):
object.manage_setLocalPermissions(permission) object.manage_setLocalPermissions(permission)
return conflict_list return conflict_list
security.declareProtected(Permissions.ModifyPortalContent, 'deleteObject')
def deleteObject(self, object, object_id):
try:
object._delObject(object_id)
except (AttributeError, KeyError):
#LOG('ERP5Conduit',0,'deleteObject, Unable to delete: %s' % str(object_id))
pass
security.declareProtected(Permissions.ModifyPortalContent, 'updateNode') security.declareProtected(Permissions.ModifyPortalContent, 'updateNode')
def updateNode(self, xml=None, object=None, previous_xml=None, force=0, def updateNode(self, xml=None, object=None, previous_xml=None, force=0,
simulate=0, **kw): simulate=0, **kw):
...@@ -788,13 +792,17 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -788,13 +792,17 @@ class ERP5Conduit(XMLSyncUtilsMixin):
self.editDocument(object=object,**args) self.editDocument(object=object,**args)
if hasattr(object,'manage_afterEdit'): if hasattr(object,'manage_afterEdit'):
object.manage_afterEdit() object.manage_afterEdit()
self.afterNewObject(object = object)
# Then we may create subobject # Then we may create subobject
for subnode in self.getElementNodeList(xml): for subnode in self.getElementNodeList(xml):
if subnode.nodeName in (self.xml_object_tag,): #,self.history_tag): if subnode.nodeName in (self.xml_object_tag,): #,self.history_tag):
self.addNode(object=object,xml=subnode) self.addNode(object=object,xml=subnode)
security.declareProtected(Permissions.AccessContentsInformation,'afterNewObject')
def afterNewObject(self, object):
pass
security.declareProtected(Permissions.AccessContentsInformation,'getStatusFromXml') security.declareProtected(Permissions.AccessContentsInformation,'getStatusFromXml')
def getStatusFromXml(self, xml): def getStatusFromXml(self, xml):
""" """
......
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