(self, document=None, xml=None, source_tag='source',
      destination_tag='destination', category='')
This method build the XML of the arrow.
This method build the XML of the arrow.
This method build the XML of the arrow .
def _setArrowTag(self, document=None, xml=None, source_tag='source',
      destination_tag='destination', category=''):
    """ This method build the XML of the arrow. """
    # only work on the data of the document and not on its parent's data
    document = aq_base(document)
    sync_list = self.getTioSafeSynchronizationObjectList(object_type="Person")

    # create the arrow tag and set if exist source and destination
    arrow = etree.SubElement(xml, 'arrow', type=category)
    arrow_list = [(source_tag, 'source'), (destination_tag, 'destination')]
    for prop, tag in arrow_list:
      if getattr(document, prop, None) is not None:
        movement = etree.SubElement(arrow, tag)
        object_id = getattr(document, prop)
        if object_id != 'default_node':
          for sync in sync_list:
            try:
              brain_node = sync.getObjectFromId(object_id)
              node_gid = brain_node.getGid()
              break
            except (ValueError, AttributeError):
              # This is not a document, might be a category, or the gid previously built
              # pass it anyway in xml
              node_gid = None

          if node_gid is None:
            node_gid = self.getDefaultUnknownNodeGID()
          movement.text = node_gid
        else:
          movement.text = self.getDefaultOrganisationGID()
def _setArrowTag ( self , document = None , xml = None , source_tag = 'source' , destination_tag = 'destination' , category = '' ) : # only work on the data of the document and not on its parent's data document = aq_base ( document ) sync_list = self . getTioSafeSynchronizationObjectList ( object_type = "Person" ) # create the arrow tag and set if exist source and destination arrow = etree . SubElement ( xml , 'arrow' , type = category ) arrow_list = [ ( source_tag , 'source' ) , ( destination_tag , 'destination' ) ] for prop , tag in arrow_list : if getattr ( document , prop , None ) is not None : movement = etree . SubElement ( arrow , tag ) object_id = getattr ( document , prop ) if object_id != 'default_node' : for sync in sync_list : try : brain_node = sync . getObjectFromId ( object_id ) node_gid = brain_node . getGid ( ) break except ( ValueError , AttributeError ) : # This is not a document, might be a category, or the gid previously built # pass it anyway in xml node_gid = None if node_gid is None : node_gid = self . getDefaultUnknownNodeGID ( ) movement . text = node_gid else : movement . text = self . getDefaultOrganisationGID ( )