anchor.diff:               lines    TYPE tline_tab,
              END OF ty_data.
   
  -    METHODS: read
  -      RETURNING VALUE(rs_data) TYPE ty_data.
  +    METHODS deserialize_dsys
  +      IMPORTING
  +        io_xml TYPE REF TO zcl_abapgit_xml_input
  +      RAISING
  +        zcx_abapgit_exception.
  +
  +    METHODS get_master_lang
  +      RETURNING
  +        VALUE(rv_language) TYPE spras.
   
   ENDCLASS.
   
   
   
  -CLASS ZCL_ABAPGIT_OBJECT_DSYS IMPLEMENTATION.
  +CLASS zcl_abapgit_object_dsys IMPLEMENTATION.
   
   
     METHOD constructor.
  +
  +    DATA: lv_prefix    TYPE namespace,
  +          lv_bare_name TYPE progname.
   
       super->constructor( is_item = is_item
                           iv_language = iv_language ).
   
  -    mv_object  = ms_item-obj_name.
  -    mv_dokname = mv_object+4(*).
  -
  -  ENDMETHOD.
  -
  -
  -  METHOD read.
  -
  -    CALL FUNCTION 'DOCU_READ'
  -      EXPORTING
  -        id       = c_id
  -        langu    = mv_language
  -        object   = mv_object
  -        typ      = c_typ
  -        version  = c_version
  -      IMPORTING
  -        doktitle = rs_data-doctitle
  -        head     = rs_data-head
  -      TABLES
  -        line     = rs_data-lines.
  +    CALL FUNCTION 'RS_NAME_SPLIT_NAMESPACE'
  +      EXPORTING
  +        name_with_namespace    = ms_item-obj_name
  +      IMPORTING
  +        namespace              = lv_prefix
  +        name_without_namespace = lv_bare_name.
  +
  +    mv_doc_object = |{ lv_bare_name+0(4) }{ lv_prefix }{ lv_bare_name+4(*) }|.
   
     ENDMETHOD.
   
   
     METHOD zif_abapgit_object~changed_by.
  -    rv_user = read( )-head-tdluser.
  -    IF rv_user IS INITIAL.
  -      rv_user = c_user_unknown.
  -    ENDIF.
  +
  +    rv_user = zcl_abapgit_factory=>get_longtexts( )->changed_by(
  +      iv_object_name = mv_doc_object
  +      iv_longtext_id = c_id ).
  +
     ENDMETHOD.
   
   
     METHOD zif_abapgit_object~delete.
   
  -    CALL FUNCTION 'DOCU_DEL'
  -      EXPORTING
  -        id       = c_id
  -        langu    = mv_language
  -        object   = mv_object
  -        typ      = c_typ
  -      EXCEPTIONS
  -        ret_code = 1
  -        OTHERS   = 2.
  -
  -    IF sy-subrc <> 0.
  -      zcx_abapgit_exception=>raise( 'error from DOCU_DEL' ).
  -    ENDIF.
  +    zcl_abapgit_factory=>get_longtexts( )->delete(
  +      iv_object_name = mv_doc_object
  +      iv_longtext_id = c_id ).
   
     ENDMETHOD.
   
   
     METHOD zif_abapgit_object~deserialize.
   
  -    DATA: ls_data TYPE ty_data.
  -
  -    io_xml->read( EXPORTING iv_name = 'DSYS'
  -                  CHANGING cg_data = ls_data ).
  -
  -    CALL FUNCTION 'DOCU_UPDATE'
  -      EXPORTING
  -        head    = ls_data-head
  -        state   = 'A'
  -        typ     = c_typ
  -        version = c_version
  -      TABLES
  -        line    = ls_data-lines.
  +    DATA: ls_metadata TYPE zif_abapgit_definitions=>ty_metadata.
  +
  +    ls_metadata = io_xml->get_metadata( ).
  +
  +    CASE ls_metadata-version.
  +
  +      WHEN 'v1.0.0'.
  +        deserialize_dsys( io_xml ).
  +
  +      WHEN 'v2.0.0'.
  +        zcl_abapgit_factory=>get_longtexts( )->deserialize(
  +          io_xml             = io_xml
  +          iv_master_language = mv_language ).
  +
  +      WHEN OTHERS.
  +        zcx_abapgit_exception=>raise( 'unsupported DSYS version' ).
  +
  +    ENDCASE.
   
       tadir_insert( iv_package ).
   
  
positive.code:   METHOD zif_abapgit_object~get_metadata.
      rs_metadata = get_metadata( ).
      rs_metadata-delete_tadir = abap_true.
    ENDMETHOD.
  
  
  
negative.code: 
    METHOD zif_abapgit_object~serialize.
  
      io_xml->i18n_params( abap_false ).
  
      zcl_abapgit_factory=>get_longtexts( )->serialize(
        iv_object_name = mv_doc_object
        iv_longtext_id = c_id
        io_xml         = io_xml ).
  
    ENDMETHOD.
  
  
    METHOD deserialize_dsys.
  
      DATA: ls_data      TYPE ty_data,
            ls_docu_info TYPE dokil,
            lv_version   TYPE dokvers.
  
      io_xml->read( EXPORTING iv_name = 'DSYS'
                    CHANGING cg_data = ls_data ).
  
      CALL FUNCTION 'DOCU_INIT'
        EXPORTING
          id     = c_id
          langu  = mv_language
          object = mv_doc_object
          typ    = c_typ
        IMPORTING
          xdokil = ls_docu_info.
  
      lv_version = ls_docu_info-version.
  
      CALL FUNCTION 'DOCU_UPDATE'
        EXPORTING
          head    = ls_data-head
          state   = 'A'
          typ     = c_typ
          version = lv_version
        TABLES
          line    = ls_data-lines.
  
    ENDMETHOD.
  
  
    METHOD get_master_lang.
  
      DATA: lv_language TYPE spras.
  
      SELECT SINGLE langu FROM dokil INTO rv_language
        WHERE id = c_id
        AND object = mv_doc_object
        AND masterlang = abap_true.
  
      IF sy-subrc <> 0.
        rv_language = mv_language.
      ENDIF.
  
    ENDMETHOD.
  
  ENDCLASS.
  