parameters: (self, xml=None, object=None, object_id=None, **kw)
return_statement: return []
docstring: This method manage the deletion of a node as well as the deletion
      of one property
docstring_summary: This method manage the deletion of a node as well as the deletion
      of one property
docstring_tokens: This method manage the deletion of a node as well as the deletion of one property
function: def deleteNode(self, xml=None, object=None, object_id=None, **kw): # pylint: disable=redefined-builtin
      """
      This method manage the deletion of a node as well as the deletion
      of one property
      """
      #LOG('ERP5Conduit.deleteNode', INFO, 'object path:%s' % object.getPath())
      #LOG('ERP5Conduit deleteNode', INFO, 'object_id:%r' % object_id)
      if object_id is not None:
        self._deleteContent(object=object, object_id=object_id, **kw)
        return []
      xml = self.convertToXml(xml)
      #LOG('ERP5Conduit deleteNode', INFO, etree.tostring(xml, pretty_print=True))
      xpath_expression = xml.get('select')
      #LOG('ERP5Conduit xpath_expression', INFO, xpath_expression)
      context_to_delete = self.getContextFromXpath(object, xpath_expression)
      if 'workflow_action' in xpath_expression:
        # /erp5/object[@gid='313730']/../workflow_action[@id=SHA(TIME + ACTOR)]
        wf_action_id = EXTRACT_ID_FROM_XPATH.findall(xpath_expression)[-1][-1]
        def deleteWorkflowNode():
          for wf_id, wf_history_tuple in object.workflow_history.iteritems():
            for wf_history_index, wf_history in enumerate(wf_history_tuple):
              if sha1(wf_id + str(wf_history['time']) +
                         wf_history['actor']).hexdigest() == wf_action_id:
                object.workflow_history[wf_id] = (
                  object.workflow_history[wf_id][:wf_history_index] +
                  object.workflow_history[wf_id][wf_history_index + 1:])
  
                return True
  
          return False
  
        deleteWorkflowNode()
  
      elif context_to_delete != object:
        self._deleteContent(object=context_to_delete.getParentValue(),
                                             object_id=context_to_delete.getId(),
                            **kw)
      else:
        #same context
        if [role for role in LOCAL_ROLE_LIST if role in xpath_expression]:
          user = EXTRACT_ID_FROM_XPATH.findall(xpath_expression)[-1][3]
          #LOG('ERP5Conduit.deleteNode local_role: ', INFO, 'user: %r' % user)
          if LOCAL_ROLE_TAG in xpath_expression:
            object.manage_delLocalRoles([user])
          elif LOCAL_GROUP_TAG in xpath_expression:
            object.manage_delLocalGroupRoles([user])
        if LOCAL_PERMISSION_TAG in xpath_expression:
          permission = EXTRACT_ID_FROM_XPATH.findall(xpath_expression)[-1][3]
          #LOG('ERP5Conduit.deleteNode permission: ', INFO,
                                                   #'permission: %r' % permission)
          object.manage_setLocalPermissions(permission)
      return []
function_tokens: def deleteNode ( self , xml = None , object = None , object_id = None , * * kw ) : # pylint: disable=redefined-builtin #LOG('ERP5Conduit.deleteNode', INFO, 'object path:%s' % object.getPath()) #LOG('ERP5Conduit deleteNode', INFO, 'object_id:%r' % object_id) if object_id is not None : self . _deleteContent ( object = object , object_id = object_id , * * kw ) return [ ] xml = self . convertToXml ( xml ) #LOG('ERP5Conduit deleteNode', INFO, etree.tostring(xml, pretty_print=True)) xpath_expression = xml . get ( 'select' ) #LOG('ERP5Conduit xpath_expression', INFO, xpath_expression) context_to_delete = self . getContextFromXpath ( object , xpath_expression ) if 'workflow_action' in xpath_expression : # /erp5/object[@gid='313730']/../workflow_action[@id=SHA(TIME + ACTOR)] wf_action_id = EXTRACT_ID_FROM_XPATH . findall ( xpath_expression ) [ - 1 ] [ - 1 ] def deleteWorkflowNode ( ) : for wf_id , wf_history_tuple in object . workflow_history . iteritems ( ) : for wf_history_index , wf_history in enumerate ( wf_history_tuple ) : if sha1 ( wf_id + str ( wf_history [ 'time' ] ) + wf_history [ 'actor' ] ) . hexdigest ( ) == wf_action_id : object . workflow_history [ wf_id ] = ( object . workflow_history [ wf_id ] [ : wf_history_index ] + object . workflow_history [ wf_id ] [ wf_history_index + 1 : ] ) return True return False deleteWorkflowNode ( ) elif context_to_delete != object : self . _deleteContent ( object = context_to_delete . getParentValue ( ) , object_id = context_to_delete . getId ( ) , * * kw ) else : #same context if [ role for role in LOCAL_ROLE_LIST if role in xpath_expression ] : user = EXTRACT_ID_FROM_XPATH . findall ( xpath_expression ) [ - 1 ] [ 3 ] #LOG('ERP5Conduit.deleteNode local_role: ', INFO, 'user: %r' % user) if LOCAL_ROLE_TAG in xpath_expression : object . manage_delLocalRoles ( [ user ] ) elif LOCAL_GROUP_TAG in xpath_expression : object . manage_delLocalGroupRoles ( [ user ] ) if LOCAL_PERMISSION_TAG in xpath_expression : permission = EXTRACT_ID_FROM_XPATH . findall ( xpath_expression ) [ - 1 ] [ 3 ] #LOG('ERP5Conduit.deleteNode permission: ', INFO, #'permission: %r' % permission) object . manage_setLocalPermissions ( permission ) return [ ]