CLASS zcl_abapgit_gui_page_db_edit DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_page FINAL CREATE PUBLIC . PUBLIC SECTION. METHODS constructor IMPORTING !is_key TYPE zif_abapgit_persistence=>ty_content . METHODS zif_abapgit_gui_page~on_event REDEFINITION . PROTECTED SECTION. METHODS render_content REDEFINITION . PRIVATE SECTION. CONSTANTS: BEGIN OF gc_action, update TYPE string VALUE 'update', END OF gc_action . DATA ms_key TYPE zif_abapgit_persistence=>ty_content . CLASS-METHODS update IMPORTING !is_content TYPE zif_abapgit_persistence=>ty_content RAISING zcx_abapgit_exception . ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_DB_EDIT IMPLEMENTATION. METHOD constructor. super->constructor( ). ms_key = is_key. ms_control-page_title = 'CONFIG EDIT'. ENDMETHOD. METHOD render_content. DATA: lv_data TYPE zif_abapgit_persistence=>ty_content-data_str, lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar. TRY. lv_data = zcl_abapgit_persistence_db=>get_instance( )->read( iv_type = ms_key-type iv_value = ms_key-value ). CATCH zcx_abapgit_not_found ##NO_HANDLER. ENDTRY. zcl_abapgit_persistence_db=>get_instance( )->lock( iv_type = ms_key-type iv_value = ms_key-value ). lv_data = escape( val = zcl_abapgit_xml_pretty=>print( lv_data ) format = cl_abap_format=>e_html_attr ). CREATE OBJECT ro_html. CREATE OBJECT lo_toolbar. lo_toolbar->add( iv_act = 'submitFormById(''db_form'');' iv_txt = 'Save' iv_typ = zif_abapgit_definitions=>gc_action_type-onclick iv_opt = zif_abapgit_definitions=>gc_html_opt-strong ) ##NO_TEXT. ro_html->add( '
' ). ro_html->add( zcl_abapgit_gui_page_db_dis=>render_record_banner( ms_key ) ). ro_html->add( ' | ' ). ro_html->add( lo_toolbar->render( iv_right = abap_true ) ). ro_html->add( ' |