(self, xml=None, object=None, sub_object=None, reset=None,
              simulate=None, **kw)
return {'conflict_list':conflict_list, 'object': sub_object}
A node is added

    xml : the xml wich contains what we want to add

    object : from where we want to add something

    previous_xml : the previous xml of the object, if any

    force : apply updates even if there's a conflict

    This fucntion returns conflict_list, wich is of the form,
    [conflict1,conflict2,...] where conclict1 is of the form :
    [object.getPath(),keyword,local_and_actual_value,subscriber_value]
A node is added
A node is added
def addNode(self, xml=None, object=None, sub_object=None, reset=None,
              simulate=None, **kw):
    """
    A node is added

    xml : the xml wich contains what we want to add

    object : from where we want to add something

    previous_xml : the previous xml of the object, if any

    force : apply updates even if there's a conflict

    This fucntion returns conflict_list, wich is of the form,
    [conflict1,conflict2,...] where conclict1 is of the form :
    [object.getPath(),keyword,local_and_actual_value,subscriber_value]
    """
    conflict_list = []
    xml = self.convertToXml(xml)
    LOG('TioSafeBaseConduit.addNode', INFO, '\n%s' % etree.tostring(xml, pretty_print=True))
    if xml is None:
      return {'conflict_list': conflict_list, 'object': sub_object}
    # In the case where this new node is a object to add
    xpath_expression = xml.get('select')
    if xml.xpath('name()') in XUPDATE_INSERT_OR_ADD_LIST and\
           MARSHALLER_NAMESPACE_URI not in xml.nsmap.values():
      # change the context according select expression
      get_target_parent = xml.xpath('name()') in XUPDATE_INSERT_LIST
      context = self.getContextFromXpath(object, xpath_expression,
                                         get_target_parent=get_target_parent)
      for element in xml.findall('{%s}element' % xml.nsmap['xupdate']):
        xml = self.getElementFromXupdate(element)
        conflict_list += self.addNode(xml=xml, object=context, **kw)\
                                                              ['conflict_list']
    elif xml.xpath('local-name()') == self.xml_object_tag:
      sub_object = self._createContent(xml=xml,
                                      object=object,
                                      sub_object=sub_object,
                                      reset=reset,
                                      simulate=simulate,
                                      **kw)
    else:
      conflict_list += self.updateNode(xml=xml, object=object, reset=reset,
                                                       simulate=simulate, **kw)
    # We must returns the object created
    return {'conflict_list':conflict_list, 'object': sub_object}
def addNode ( self , xml = None , object = None , sub_object = None , reset = None , simulate = None , * * kw ) : conflict_list = [ ] xml = self . convertToXml ( xml ) LOG ( 'TioSafeBaseConduit.addNode' , INFO , '\n%s' % etree . tostring ( xml , pretty_print = True ) ) if xml is None : return { 'conflict_list' : conflict_list , 'object' : sub_object } # In the case where this new node is a object to add xpath_expression = xml . get ( 'select' ) if xml . xpath ( 'name()' ) in XUPDATE_INSERT_OR_ADD_LIST and MARSHALLER_NAMESPACE_URI not in xml . nsmap . values ( ) : # change the context according select expression get_target_parent = xml . xpath ( 'name()' ) in XUPDATE_INSERT_LIST context = self . getContextFromXpath ( object , xpath_expression , get_target_parent = get_target_parent ) for element in xml . findall ( '{%s}element' % xml . nsmap [ 'xupdate' ] ) : xml = self . getElementFromXupdate ( element ) conflict_list += self . addNode ( xml = xml , object = context , * * kw ) [ 'conflict_list' ] elif xml . xpath ( 'local-name()' ) == self . xml_object_tag : sub_object = self . _createContent ( xml = xml , object = object , sub_object = sub_object , reset = reset , simulate = simulate , * * kw ) else : conflict_list += self . updateNode ( xml = xml , object = object , reset = reset , simulate = simulate , * * kw ) # We must returns the object created return { 'conflict_list' : conflict_list , 'object' : sub_object }