gui refactoring, for web edition (#3890)

* put cl_gui_html_viewer behind an interface

* cleanup

* injectable html viewer

* method_parameter_names, exclude zif_abapgit_html_viewer

* fix whitespace

* public get_asset_manager

* Update abaplint.json

* add prefixes
This commit is contained in:
Lars Hvam 2020-09-16 12:39:23 +02:00 committed by GitHub
parent 225a3cb558
commit 9f396366cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 387 additions and 189 deletions

View File

@ -1,8 +1,11 @@
CLASS zcl_abapgit_gui DEFINITION
PUBLIC
FINAL .
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_services .
CONSTANTS:
BEGIN OF c_event_state,
not_handled TYPE i VALUE 0,
@ -14,54 +17,46 @@ CLASS zcl_abapgit_gui DEFINITION
go_back_to_bookmark TYPE i VALUE 6,
new_page_replacing TYPE i VALUE 7,
END OF c_event_state .
CONSTANTS:
BEGIN OF c_action,
go_home TYPE string VALUE 'go_home',
go_db TYPE string VALUE 'go_db',
END OF c_action.
INTERFACES zif_abapgit_gui_services.
END OF c_action .
METHODS go_home
RAISING
zcx_abapgit_exception.
zcx_abapgit_exception .
METHODS go_page
IMPORTING
ii_page TYPE REF TO zif_abapgit_gui_renderable
iv_clear_stack TYPE abap_bool DEFAULT abap_true
!ii_page TYPE REF TO zif_abapgit_gui_renderable
!iv_clear_stack TYPE abap_bool DEFAULT abap_true
RAISING
zcx_abapgit_exception.
zcx_abapgit_exception .
METHODS back
IMPORTING
iv_to_bookmark TYPE abap_bool DEFAULT abap_false
!iv_to_bookmark TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rv_exit) TYPE abap_bool
VALUE(rv_exit) TYPE abap_bool
RAISING
zcx_abapgit_exception.
METHODS on_event FOR EVENT sapevent OF cl_gui_html_viewer
zcx_abapgit_exception .
METHODS on_event
FOR EVENT sapevent OF zif_abapgit_html_viewer
IMPORTING
action
frame
getdata
postdata
query_table.
!action
!frame
!getdata
!postdata
!query_table .
METHODS constructor
IMPORTING
io_component TYPE REF TO object OPTIONAL
ii_asset_man TYPE REF TO zif_abapgit_gui_asset_manager OPTIONAL
ii_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl OPTIONAL
ii_html_processor TYPE REF TO zif_abapgit_gui_html_processor OPTIONAL
iv_rollback_on_error TYPE abap_bool DEFAULT abap_true
!io_component TYPE REF TO object OPTIONAL
!ii_asset_man TYPE REF TO zif_abapgit_gui_asset_manager OPTIONAL
!ii_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl OPTIONAL
!ii_html_processor TYPE REF TO zif_abapgit_gui_html_processor OPTIONAL
!iv_rollback_on_error TYPE abap_bool DEFAULT abap_true
RAISING
zcx_abapgit_exception.
METHODS free.
zcx_abapgit_exception .
METHODS free .
PROTECTED SECTION.
PRIVATE SECTION.
@ -69,51 +64,47 @@ CLASS zcl_abapgit_gui DEFINITION
BEGIN OF ty_page_stack,
page TYPE REF TO zif_abapgit_gui_renderable,
bookmark TYPE abap_bool,
END OF ty_page_stack.
END OF ty_page_stack .
DATA mv_rollback_on_error TYPE abap_bool .
DATA mi_cur_page TYPE REF TO zif_abapgit_gui_renderable .
DATA:
mv_rollback_on_error TYPE abap_bool,
mi_cur_page TYPE REF TO zif_abapgit_gui_renderable,
mt_stack TYPE STANDARD TABLE OF ty_page_stack,
mt_event_handlers TYPE STANDARD TABLE OF REF TO zif_abapgit_gui_event_handler,
mi_router TYPE REF TO zif_abapgit_gui_event_handler,
mi_asset_man TYPE REF TO zif_abapgit_gui_asset_manager,
mi_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl,
mi_html_processor TYPE REF TO zif_abapgit_gui_html_processor,
mo_html_viewer TYPE REF TO cl_gui_html_viewer,
mo_html_parts TYPE REF TO zcl_abapgit_html_parts.
METHODS startup
RAISING
zcx_abapgit_exception.
mt_stack TYPE STANDARD TABLE OF ty_page_stack .
DATA:
mt_event_handlers TYPE STANDARD TABLE OF REF TO zif_abapgit_gui_event_handler .
DATA mi_router TYPE REF TO zif_abapgit_gui_event_handler .
DATA mi_asset_man TYPE REF TO zif_abapgit_gui_asset_manager .
DATA mi_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl .
DATA mi_html_processor TYPE REF TO zif_abapgit_gui_html_processor .
DATA mi_html_viewer TYPE REF TO zif_abapgit_html_viewer .
DATA mo_html_parts TYPE REF TO zcl_abapgit_html_parts .
METHODS cache_html
IMPORTING
iv_text TYPE string
!iv_text TYPE string
RETURNING
VALUE(rv_url) TYPE w3url.
VALUE(rv_url) TYPE w3url .
METHODS startup
RAISING
zcx_abapgit_exception .
METHODS render
RAISING
zcx_abapgit_exception.
zcx_abapgit_exception .
METHODS call_page
IMPORTING
ii_page TYPE REF TO zif_abapgit_gui_renderable
iv_with_bookmark TYPE abap_bool DEFAULT abap_false
iv_replacing TYPE abap_bool DEFAULT abap_false
!ii_page TYPE REF TO zif_abapgit_gui_renderable
!iv_with_bookmark TYPE abap_bool DEFAULT abap_false
!iv_replacing TYPE abap_bool DEFAULT abap_false
RAISING
zcx_abapgit_exception.
zcx_abapgit_exception .
METHODS handle_action
IMPORTING
iv_action TYPE c
iv_getdata TYPE c OPTIONAL
it_postdata TYPE cnht_post_data_tab OPTIONAL.
!iv_action TYPE c
!iv_getdata TYPE c OPTIONAL
!it_postdata TYPE cnht_post_data_tab OPTIONAL .
METHODS handle_error
IMPORTING
ix_exception TYPE REF TO zcx_abapgit_exception.
!ix_exception TYPE REF TO zcx_abapgit_exception .
ENDCLASS.
@ -205,10 +196,10 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
METHOD free.
SET HANDLER me->on_event FOR mo_html_viewer ACTIVATION space.
mo_html_viewer->close_document( ).
mo_html_viewer->free( ).
FREE mo_html_viewer.
SET HANDLER me->on_event FOR mi_html_viewer ACTIVATION space.
mi_html_viewer->close_document( ).
mi_html_viewer->free( ).
FREE mi_html_viewer.
ENDMETHOD.
@ -345,9 +336,9 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
METHOD render.
DATA: lv_url TYPE w3url,
lv_html TYPE string,
li_html TYPE REF TO zif_abapgit_html.
DATA: lv_url TYPE w3url,
lv_html TYPE string,
li_html TYPE REF TO zif_abapgit_html.
IF mi_cur_page IS NOT BOUND.
zcx_abapgit_exception=>raise( 'GUI error: no current page' ).
@ -373,8 +364,8 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
ii_gui_services = me ).
ENDIF.
lv_url = cache_html( lv_html ).
mo_html_viewer->show_url( lv_url ).
lv_url = cache_html( lv_html ).
mi_html_viewer->show_url( lv_url ).
ENDMETHOD.
@ -387,27 +378,26 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
FIELD-SYMBOLS <ls_asset> LIKE LINE OF lt_assets.
CREATE OBJECT mo_html_viewer
EXPORTING
query_table_disabled = abap_true
parent = cl_gui_container=>screen0.
mi_html_viewer = zcl_abapgit_ui_factory=>get_html_viewer( ).
IF mi_asset_man IS BOUND.
lt_assets = mi_asset_man->get_all_assets( ).
LOOP AT lt_assets ASSIGNING <ls_asset> WHERE is_cacheable = abap_true.
zif_abapgit_gui_services~cache_asset( iv_xdata = <ls_asset>-content
iv_url = <ls_asset>-url
iv_type = <ls_asset>-type
iv_subtype = <ls_asset>-subtype ).
zif_abapgit_gui_services~cache_asset(
iv_xdata = <ls_asset>-content
iv_url = <ls_asset>-url
iv_type = <ls_asset>-type
iv_subtype = <ls_asset>-subtype ).
ENDLOOP.
ENDIF.
ls_event-eventid = mo_html_viewer->m_id_sapevent.
ls_event-eventid = mi_html_viewer->m_id_sapevent.
ls_event-appl_event = abap_true.
APPEND ls_event TO lt_events.
mo_html_viewer->set_registered_events( lt_events ).
SET HANDLER me->on_event FOR mo_html_viewer.
mi_html_viewer->set_registered_events( lt_events ).
SET HANDLER me->on_event FOR mi_html_viewer.
ENDMETHOD.
@ -428,15 +418,15 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
IMPORTING
et_tab = lt_html ).
mo_html_viewer->load_data(
mi_html_viewer->load_data(
EXPORTING
type = iv_type
subtype = iv_subtype
url = iv_url
iv_type = iv_type
iv_subtype = iv_subtype
iv_url = iv_url
IMPORTING
assigned_url = rv_url
ev_assigned_url = rv_url
CHANGING
data_table = lt_html
ct_data_table = lt_html
EXCEPTIONS
OTHERS = 1 ).
ELSE. " Raw input
@ -447,18 +437,18 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
ev_size = lv_size
et_bintab = lt_xdata ).
mo_html_viewer->load_data(
mi_html_viewer->load_data(
EXPORTING
type = iv_type
subtype = iv_subtype
size = lv_size
url = iv_url
iv_type = iv_type
iv_subtype = iv_subtype
iv_size = lv_size
iv_url = iv_url
IMPORTING
assigned_url = rv_url
ev_assigned_url = rv_url
CHANGING
data_table = lt_xdata
ct_data_table = lt_xdata
EXCEPTIONS
OTHERS = 1 ).
OTHERS = 1 ).
ENDIF.
ASSERT sy-subrc = 0. " Image data error

View File

@ -0,0 +1,107 @@
CLASS zcl_abapgit_html_viewer_gui DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_html_viewer .
METHODS constructor .
PROTECTED SECTION.
DATA mo_html_viewer TYPE REF TO cl_gui_html_viewer .
METHODS on_event
FOR EVENT sapevent OF cl_gui_html_viewer
IMPORTING
!action
!frame
!getdata
!postdata
!query_table .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_HTML_VIEWER_GUI IMPLEMENTATION.
METHOD constructor.
DATA: lt_events TYPE cntl_simple_events,
ls_event LIKE LINE OF lt_events.
CREATE OBJECT mo_html_viewer
EXPORTING
query_table_disabled = abap_true
parent = cl_gui_container=>screen0.
ls_event-eventid = zif_abapgit_html_viewer=>m_id_sapevent.
ls_event-appl_event = abap_true.
APPEND ls_event TO lt_events.
mo_html_viewer->set_registered_events( lt_events ).
SET HANDLER me->on_event FOR mo_html_viewer.
ENDMETHOD.
METHOD on_event.
RAISE EVENT zif_abapgit_html_viewer~sapevent
EXPORTING
action = action
frame = frame
getdata = getdata
postdata = postdata
query_table = query_table.
ENDMETHOD.
METHOD zif_abapgit_html_viewer~close_document.
mo_html_viewer->close_document( ).
ENDMETHOD.
METHOD zif_abapgit_html_viewer~free.
mo_html_viewer->free( ).
ENDMETHOD.
METHOD zif_abapgit_html_viewer~load_data.
mo_html_viewer->load_data(
EXPORTING
url = iv_url
type = iv_type
subtype = iv_subtype
size = iv_size
IMPORTING
assigned_url = ev_assigned_url
CHANGING
data_table = ct_data_table ).
ENDMETHOD.
METHOD zif_abapgit_html_viewer~set_registered_events.
mo_html_viewer->set_registered_events( it_events ).
ENDMETHOD.
METHOD zif_abapgit_html_viewer~show_url.
mo_html_viewer->show_url( iv_url ).
ENDMETHOD.
ENDCLASS.

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_ABAPGIT_HTML_VIEWER_GUI</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abapGit - GUI HTML Viewer</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -5,6 +5,11 @@ CLASS zcl_abapgit_ui_factory DEFINITION
PUBLIC SECTION.
CLASS-METHODS get_asset_manager
RETURNING
VALUE(ri_asset_man) TYPE REF TO zif_abapgit_gui_asset_manager
RAISING
zcx_abapgit_exception .
CLASS-METHODS get_popups
RETURNING
VALUE(ri_popups) TYPE REF TO zif_abapgit_popups .
@ -27,21 +32,19 @@ CLASS zcl_abapgit_ui_factory DEFINITION
CLASS-METHODS get_frontend_services
RETURNING
VALUE(ri_fe_serv) TYPE REF TO zif_abapgit_frontend_services .
CLASS-METHODS get_html_viewer
RETURNING
VALUE(ri_viewer) TYPE REF TO zif_abapgit_html_viewer .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-DATA gi_popups TYPE REF TO zif_abapgit_popups .
CLASS-DATA gi_tag_popups TYPE REF TO zif_abapgit_tag_popups .
CLASS-DATA gi_gui_functions TYPE REF TO zif_abapgit_gui_functions .
CLASS-DATA gi_html_viewer TYPE REF TO zif_abapgit_html_viewer .
CLASS-DATA go_gui TYPE REF TO zcl_abapgit_gui .
CLASS-DATA gi_fe_services TYPE REF TO zif_abapgit_frontend_services .
CLASS-DATA gi_gui_services TYPE REF TO zif_abapgit_gui_services.
CLASS-METHODS init_asset_manager
RETURNING
VALUE(ro_asset_man) TYPE REF TO zcl_abapgit_gui_asset_manager
RAISING
zcx_abapgit_exception.
CLASS-DATA gi_gui_services TYPE REF TO zif_abapgit_gui_services .
ENDCLASS.
@ -49,6 +52,71 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
METHOD get_asset_manager.
DATA lo_buf TYPE REF TO lcl_string_buffer.
DATA lo_asset_man TYPE REF TO zcl_abapgit_gui_asset_manager.
CREATE OBJECT lo_buf.
CREATE OBJECT lo_asset_man.
" @@abapmerge include zabapgit_css_common.w3mi.data.css > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'css/common.css'
iv_type = 'text/css'
iv_mime_name = 'ZABAPGIT_CSS_COMMON'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_css_theme_default.w3mi.data.css > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'css/theme-default.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_DEFAULT'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_css_theme_dark.w3mi.data.css > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'css/theme-dark.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_DARK'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_css_theme_belize_blue.w3mi.data.css > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'css/theme-belize-blue.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_BELIZE_BLUE'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_js_common.w3mi.data.js > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'js/common.js'
iv_type = 'text/javascript'
iv_mime_name = 'ZABAPGIT_JS_COMMON'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_icon_font_css.w3mi.data.css > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'css/ag-icons.css'
iv_type = 'text/css'
iv_mime_name = 'ZABAPGIT_ICON_FONT_CSS'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include-base64 zabapgit_icon_font.w3mi.data.woff > lo_buf->add( '$$' ).
lo_asset_man->register_asset(
iv_url = 'font/ag-icons.woff'
iv_type = 'font/woff'
iv_mime_name = 'ZABAPGIT_ICON_FONT'
iv_base64 = lo_buf->join_and_flush( ) ).
ri_asset_man = lo_asset_man.
ENDMETHOD.
METHOD get_frontend_services.
IF gi_fe_services IS INITIAL.
@ -64,13 +132,13 @@ CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
DATA:
li_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl,
li_router TYPE REF TO zif_abapgit_gui_event_handler,
li_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
li_router TYPE REF TO zif_abapgit_gui_event_handler,
li_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
DATA lo_html_preprocessor TYPE REF TO zcl_abapgit_gui_html_processor.
IF go_gui IS INITIAL.
li_asset_man ?= init_asset_manager( ).
li_asset_man = get_asset_manager( ).
CREATE OBJECT lo_html_preprocessor EXPORTING ii_asset_man = li_asset_man.
lo_html_preprocessor->preserve_css( 'css/ag-icons.css' ).
@ -110,6 +178,18 @@ CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
ENDMETHOD.
METHOD get_html_viewer.
IF gi_html_viewer IS BOUND.
ri_viewer = gi_html_viewer.
RETURN.
ENDIF.
CREATE OBJECT ri_viewer TYPE zcl_abapgit_html_viewer_gui.
ENDMETHOD.
METHOD get_popups.
IF gi_popups IS INITIAL.
@ -130,66 +210,4 @@ CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
ri_tag_popups = gi_tag_popups.
ENDMETHOD.
METHOD init_asset_manager.
DATA lo_buf TYPE REF TO lcl_string_buffer.
CREATE OBJECT lo_buf.
CREATE OBJECT ro_asset_man.
" @@abapmerge include zabapgit_css_common.w3mi.data.css > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'css/common.css'
iv_type = 'text/css'
iv_mime_name = 'ZABAPGIT_CSS_COMMON'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_css_theme_default.w3mi.data.css > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'css/theme-default.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_DEFAULT'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_css_theme_dark.w3mi.data.css > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'css/theme-dark.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_DARK'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_css_theme_belize_blue.w3mi.data.css > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'css/theme-belize-blue.css'
iv_type = 'text/css'
iv_cachable = abap_false
iv_mime_name = 'ZABAPGIT_CSS_THEME_BELIZE_BLUE'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_js_common.w3mi.data.js > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'js/common.js'
iv_type = 'text/javascript'
iv_mime_name = 'ZABAPGIT_JS_COMMON'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include zabapgit_icon_font_css.w3mi.data.css > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'css/ag-icons.css'
iv_type = 'text/css'
iv_mime_name = 'ZABAPGIT_ICON_FONT_CSS'
iv_inline = lo_buf->join_w_newline_and_flush( ) ).
" @@abapmerge include-base64 zabapgit_icon_font.w3mi.data.woff > lo_buf->add( '$$' ).
ro_asset_man->register_asset(
iv_url = 'font/ag-icons.woff'
iv_type = 'font/woff'
iv_mime_name = 'ZABAPGIT_ICON_FONT'
iv_base64 = lo_buf->join_and_flush( ) ).
ENDMETHOD.
ENDCLASS.

View File

@ -1,29 +1,27 @@
CLASS zcl_abapgit_ui_injector DEFINITION
PUBLIC
CREATE PRIVATE.
CREATE PRIVATE .
PUBLIC SECTION.
CLASS-METHODS:
set_popups
IMPORTING
ii_popups TYPE REF TO zif_abapgit_popups,
set_tag_popups
IMPORTING
ii_tag_popups TYPE REF TO zif_abapgit_tag_popups,
set_gui_functions
IMPORTING
ii_gui_functions TYPE REF TO zif_abapgit_gui_functions,
set_gui_services
IMPORTING
ii_gui_services TYPE REF TO zif_abapgit_gui_services,
get_dummy_gui_services
RETURNING
VALUE(ri_gui_services) TYPE REF TO zif_abapgit_gui_services.
CLASS-METHODS set_popups
IMPORTING
!ii_popups TYPE REF TO zif_abapgit_popups .
CLASS-METHODS set_tag_popups
IMPORTING
!ii_tag_popups TYPE REF TO zif_abapgit_tag_popups .
CLASS-METHODS set_gui_functions
IMPORTING
!ii_gui_functions TYPE REF TO zif_abapgit_gui_functions .
CLASS-METHODS set_gui_services
IMPORTING
!ii_gui_services TYPE REF TO zif_abapgit_gui_services .
CLASS-METHODS get_dummy_gui_services
RETURNING
VALUE(ri_gui_services) TYPE REF TO zif_abapgit_gui_services .
CLASS-METHODS set_html_viewer
IMPORTING
!ii_html_viewer TYPE REF TO zif_abapgit_html_viewer .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
@ -54,6 +52,13 @@ CLASS ZCL_ABAPGIT_UI_INJECTOR IMPLEMENTATION.
ENDMETHOD.
METHOD set_html_viewer.
zcl_abapgit_ui_factory=>gi_html_viewer = ii_html_viewer.
ENDMETHOD.
METHOD set_popups.
zcl_abapgit_ui_factory=>gi_popups = ii_popups.

View File

@ -0,0 +1,47 @@
INTERFACE zif_abapgit_html_viewer
PUBLIC .
CONSTANTS m_id_sapevent TYPE i VALUE 1 ##NO_TEXT.
EVENTS sapevent
EXPORTING
VALUE(action) TYPE c OPTIONAL
VALUE(frame) TYPE c OPTIONAL
VALUE(getdata) TYPE c OPTIONAL
VALUE(postdata) TYPE cnht_post_data_tab OPTIONAL
VALUE(query_table) TYPE cnht_query_table OPTIONAL .
METHODS load_data
IMPORTING
!iv_url TYPE c OPTIONAL
!iv_type TYPE c DEFAULT 'text'
!iv_subtype TYPE c DEFAULT 'html'
!iv_size TYPE i DEFAULT 0
EXPORTING
!ev_assigned_url TYPE c
CHANGING
!ct_data_table TYPE STANDARD TABLE
EXCEPTIONS
dp_invalid_parameter
dp_error_general
cntl_error
html_syntax_notcorrect .
METHODS set_registered_events
IMPORTING
!it_events TYPE cntl_simple_events
EXCEPTIONS
cntl_error
cntl_system_error
illegal_event_combination .
METHODS show_url
IMPORTING
!iv_url TYPE c
EXCEPTIONS
cntl_error
cnht_error_not_allowed
cnht_error_parameter
dp_error_general .
METHODS free .
METHODS close_document .
ENDINTERFACE.

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOINTERF>
<CLSNAME>ZIF_ABAPGIT_HTML_VIEWER</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abapGit - HTML Viewer</DESCRIPT>
<EXPOSURE>2</EXPOSURE>
<STATE>1</STATE>
<UNICODE>X</UNICODE>
</VSEOINTERF>
</asx:values>
</asx:abap>
</abapGit>