supported obj types at debugpage #436

supported obj types at debugpage #436
native_only flag for is_supported
This commit is contained in:
sbcgua 2016-11-18 20:38:27 +02:00
parent 2be06d0657
commit 007d56afde
5 changed files with 69 additions and 27 deletions

View File

@ -8,6 +8,10 @@ Legend
+ : added
- : removed
2016-11-??
------------------
+ supported object list @debugpage
2016-11-12
------------------
+ brand new style for file diff display - local and remote statuses are independent and based on local/remote hash and saved state

View File

@ -1596,6 +1596,7 @@ CLASS lcl_objects DEFINITION FINAL.
CLASS-METHODS is_supported
IMPORTING is_item TYPE ty_item
iv_native_only TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(rv_bool) TYPE abap_bool.
CLASS-METHODS exists
@ -1618,10 +1619,11 @@ CLASS lcl_objects DEFINITION FINAL.
RAISING lcx_exception.
CLASS-METHODS create_object
IMPORTING is_item TYPE ty_item
iv_language TYPE spras
is_metadata TYPE ty_metadata OPTIONAL
RETURNING VALUE(ri_obj) TYPE REF TO lif_object
IMPORTING is_item TYPE ty_item
iv_language TYPE spras
is_metadata TYPE ty_metadata OPTIONAL
iv_native_only TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(ri_obj) TYPE REF TO lif_object
RAISING lcx_exception.
CLASS-METHODS

View File

@ -137,17 +137,18 @@ CLASS lcl_objects IMPLEMENTATION.
is_item = is_item
iv_language = iv_language.
CATCH cx_sy_create_object_error.
TRY.
* 2nd step, try looking for plugins
CREATE OBJECT ri_obj TYPE lcl_objects_bridge
EXPORTING
is_item = is_item.
CATCH cx_sy_create_object_error.
CONCATENATE 'Object type' is_item-obj_type 'not supported, serialize'
INTO lv_message
SEPARATED BY space. "#EC NOTEXT
lcx_exception=>raise( lv_message ).
ENDTRY.
lv_message = |Object type { is_item-obj_type } not supported, serialize|. "#EC NOTEXT
IF iv_native_only = abap_false.
TRY. " 2nd step, try looking for plugins
CREATE OBJECT ri_obj TYPE lcl_objects_bridge
EXPORTING
is_item = is_item.
CATCH cx_sy_create_object_error.
lcx_exception=>raise( lv_message ).
ENDTRY.
ELSE. " No native support? -> fail
lcx_exception=>raise( lv_message ).
ENDIF.
ENDTRY.
ENDMETHOD. "create_object
@ -168,8 +169,9 @@ CLASS lcl_objects IMPLEMENTATION.
METHOD is_supported.
TRY.
create_object( is_item = is_item
iv_language = gc_english ).
create_object( is_item = is_item
iv_language = gc_english
iv_native_only = iv_native_only ).
rv_bool = abap_true.
CATCH lcx_exception.
rv_bool = abap_false.

View File

@ -277,11 +277,8 @@ CLASS lcl_gui_page_super IMPLEMENTATION.
_add 'function debugOutput(text, dstID) {'. "#EC NOTEXT
_add ' var stdout = document.getElementById(dstID || "stdout");'. "#EC NOTEXT
_add ' if (stdout.innerHTML == "") {'. "#EC NOTEXT
_add ' stdout.innerHTML = text;'. "#EC NOTEXT
_add ' } else {'. "#EC NOTEXT
_add ' stdout.innerHTML = stdout.innerHTML + "<br>" + text;'. "#EC NOTEXT
_add ' }'. "#EC NOTEXT
_add ' var wrapped = "<p>" + text + "</p>";'. "#EC NOTEXT
_add ' stdout.innerHTML = stdout.innerHTML + wrapped;'. "#EC NOTEXT
_add '}'. "#EC NOTEXT
_add 'function submitForm(params, action) {'. "#EC NOTEXT

View File

@ -14,6 +14,8 @@ CLASS lcl_gui_page_debuginfo DEFINITION FINAL INHERITING FROM lcl_gui_page_super
PRIVATE SECTION.
METHODS render_debug_info
RETURNING VALUE(ro_html) TYPE REF TO lcl_html_helper.
METHODS render_supported_object_types
RETURNING VALUE(rv_html) TYPE string.
ENDCLASS. "lcl_gui_page_debuginfo
@ -25,7 +27,12 @@ CLASS lcl_gui_page_debuginfo IMPLEMENTATION.
ro_html->add( header( io_include_style = styles( ) ) ).
ro_html->add( title( 'DEBUG INFO' ) ).
ro_html->add( '<div id="debug_info" class="debug_container">' ).
ro_html->add( render_debug_info( ) ).
ro_html->add( render_supported_object_types( ) ).
ro_html->add( '</div>' ).
ro_html->add( footer( io_include_script = scripts( ) ) ).
ENDMETHOD.
@ -47,14 +54,41 @@ CLASS lcl_gui_page_debuginfo IMPLEMENTATION.
CREATE OBJECT ro_html.
ro_html->add( '<div id="debug_info" class="debug_container">' ).
ro_html->add( |abapGit version: { gc_abap_version }<br>| ).
ro_html->add( |XML version: { gc_xml_version }<br>| ).
ro_html->add( |GUI version: { lv_gui_version }| ).
ro_html->add( '</div>' ).
ro_html->add( |<p>abapGit version: { gc_abap_version }</p>| ).
ro_html->add( |<p>XML version: { gc_xml_version }</p>| ).
ro_html->add( |<p>GUI version: { lv_gui_version }</p>| ).
ENDMETHOD. "render_debug_info
METHOD render_supported_object_types.
DATA: lt_objects TYPE STANDARD TABLE OF ko100,
lv_list TYPE string,
ls_item TYPE ty_item.
FIELD-SYMBOLS <object> LIKE LINE OF lt_objects.
CALL FUNCTION 'TR_OBJECT_TABLE'
TABLES
wt_object_text = lt_objects
EXCEPTIONS
OTHERS = 1.
LOOP AT lt_objects ASSIGNING <object> WHERE pgmid = 'R3TR'.
ls_item-obj_type = <object>-object.
IF lcl_objects=>is_supported( is_item = ls_item iv_native_only = abap_true ) = abap_true.
IF lv_list IS INITIAL.
lv_list = ls_item-obj_type.
ELSE.
lv_list = lv_list && `, ` && ls_item-obj_type.
ENDIF.
ENDIF.
ENDLOOP.
rv_html = |</p>Supported objects: { lv_list }</p>|.
ENDMETHOD. " render_supported_object_types
METHOD styles.
CREATE OBJECT ro_html.
@ -66,6 +100,9 @@ CLASS lcl_gui_page_debuginfo IMPLEMENTATION.
_add ' color: #444;'.
_add ' font-family: Consolas, Courier, monospace;'.
_add '}'.
_add 'div.debug_container p {'.
_add ' margin: 0px;'.
_add '}'.
ENDMETHOD.