anchor.diff:      CLASS-METHODS repo_srv
         RETURNING VALUE(ro_repo_srv) TYPE REF TO lcl_repo_srv.
   
  +    CLASS-METHODS db
  +      RETURNING VALUE(ro_db) TYPE REF TO lcl_persistence_db.
  +
     PRIVATE SECTION.
       CLASS-DATA: go_gui          TYPE REF TO lcl_gui,
                   go_current_user TYPE REF TO lcl_persistence_user,
  +                go_db           TYPE REF TO lcl_persistence_db,
                   go_repo_srv     TYPE REF TO lcl_repo_srv.
   
   ENDCLASS.   "lcl_app
  +
  +CLASS lcl_persistence_background DEFINITION FINAL.
  +
  +  PUBLIC SECTION.
  +
  +    CONSTANTS: BEGIN OF c_method,
  +                 nothing TYPE string VALUE 'nothing',
  +                 pull    TYPE string VALUE 'pull',
  +                 push    TYPE string VALUE 'push',
  +               END OF c_method.
  +
  +    TYPES: BEGIN OF ty_xml,
  +             method   TYPE string,
  +             username TYPE string,
  +             password TYPE string,
  +           END OF ty_xml.
  +
  +    TYPES: BEGIN OF ty_background,
  +             key TYPE lcl_persistence_db=>ty_value.
  +        INCLUDE TYPE ty_xml.
  +    TYPES: END OF ty_background.
  +    TYPES: tt_background TYPE STANDARD TABLE OF ty_background WITH DEFAULT KEY.
  +
  +    METHODS constructor.
  +
  +    METHODS list
  +      RETURNING VALUE(rt_list) TYPE tt_background
  +      RAISING   lcx_exception.
  +
  +    METHODS modify
  +      IMPORTING is_data TYPE ty_background
  +      RAISING   lcx_exception.
  +
  +    METHODS delete
  +      IMPORTING iv_key TYPE ty_background-key
  +      RAISING   lcx_exception.
  +
  +  PRIVATE SECTION.
  +    CONSTANTS c_type TYPE lcl_persistence_db=>ty_type VALUE 'BACKGROUND'.
  +
  +    DATA: mo_db TYPE REF TO lcl_persistence_db.
  +
  +    METHODS from_xml
  +      IMPORTING iv_string     TYPE string
  +      RETURNING VALUE(rs_xml) TYPE ty_xml
  +      RAISING   lcx_exception.
  +
  +    METHODS to_xml
  +      IMPORTING is_background    TYPE ty_background
  +      RETURNING VALUE(rv_string) TYPE string.
  +
  +ENDCLASS.     "lcl_persistence_background DEFINITION
  +
  +CLASS lcl_persistence_background IMPLEMENTATION.
  +
  +  METHOD constructor.
  +    mo_db = lcl_app=>db( ).
  +  ENDMETHOD.
  +
  +  METHOD list.
  +
  +    DATA: lt_list TYPE lcl_persistence_db=>tt_content,
  +          ls_xml  TYPE ty_xml.
  +
  +    FIELD-SYMBOLS: <ls_list>   LIKE LINE OF lt_list,
  +                   <ls_output> LIKE LINE OF rt_list.
  +
  +
  +    lt_list = mo_db->list_by_type( c_type ).
  +
  +    LOOP AT lt_list ASSIGNING <ls_list>.
  +      ls_xml = from_xml( <ls_list>-data_str ).
  +
  +      APPEND INITIAL LINE TO rt_list ASSIGNING <ls_output>.
  +      MOVE-CORRESPONDING ls_xml TO <ls_output>.
  +      <ls_output>-key = <ls_list>-value.
  +    ENDLOOP.
  +
  +  ENDMETHOD.
  +
  +  METHOD modify.
  +    mo_db->modify(
  +      iv_type  = c_type
  +      iv_value = is_data-key
  +      iv_data  = to_xml( is_data ) ).
  +  ENDMETHOD.
  +
  +  METHOD delete.
  +    TRY.
  +        mo_db->read( iv_type  = c_type
  +                     iv_value = iv_key ).
  +      CATCH lcx_not_found.
  +        RETURN.
  +    ENDTRY.
  +
  +    mo_db->delete( iv_type  = c_type
  +                   iv_value = iv_key ).
  +  ENDMETHOD.
  +
  +  METHOD from_xml.
  +    CALL TRANSFORMATION id
  +      OPTIONS value_handling = 'accept_data_loss'
  +      SOURCE XML iv_string
  +      RESULT data = rs_xml ##NO_TEXT.
  +  ENDMETHOD.
  +
  +  METHOD to_xml.
  +    DATA: ls_xml TYPE ty_xml.
  +
  +    MOVE-CORRESPONDING is_background TO ls_xml.
  +
  +    CALL TRANSFORMATION id
  +      SOURCE data = ls_xml
  +      RESULT XML rv_string.
  +  ENDMETHOD.
  +
  +ENDCLASS.         " lcl_persistence_background IMPLEMENTATION
   
   *----------------------------------------------------------------------*
   *       CLASS lcl_repo_online IMPLEMENTATION
  
positive.code: 
    ENDMETHOD.      "repo_srv
  
  ENDCLASS.   "lcl_app
  
  
  
negative.code: 
    METHOD lif_gui_page~render.
  
      DATA: lv_data TYPE lcl_persistence_db=>ty_content-data_str.
  
      TRY.
          lv_data = lcl_app=>db( )->read(
            iv_type  = ms_key-type
            iv_value = ms_key-value ).
        CATCH lcx_not_found ##NO_HANDLER.
      ENDTRY.
  
      lcl_app=>db( )->lock(
        iv_type  = ms_key-type
        iv_value = ms_key-value ).
  
  