mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 20:32:26 +08:00
ENHO: interface enhancement support
This commit is contained in:
parent
404a082f80
commit
5a6a3476f4
|
@ -442,6 +442,101 @@ CLASS lcl_object_enho_hook IMPLEMENTATION.
|
|||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_object_enho_interface DEFINITION.
|
||||
|
||||
PUBLIC SECTION.
|
||||
METHODS:
|
||||
constructor
|
||||
IMPORTING
|
||||
is_item TYPE ty_item
|
||||
io_files TYPE REF TO lcl_objects_files.
|
||||
INTERFACES: lif_object_enho.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA: ms_item TYPE ty_item,
|
||||
mo_files TYPE REF TO lcl_objects_files.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_object_enho_interface IMPLEMENTATION.
|
||||
|
||||
METHOD constructor.
|
||||
ms_item = is_item.
|
||||
mo_files = io_files.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_enho~serialize.
|
||||
|
||||
DATA: lo_enh_intf TYPE REF TO cl_enh_tool_intf,
|
||||
lv_class TYPE seoclsname,
|
||||
lv_shorttext TYPE string.
|
||||
|
||||
|
||||
lo_enh_intf ?= ii_enh_tool.
|
||||
|
||||
lv_shorttext = lo_enh_intf->if_enh_object_docu~get_shorttext( ).
|
||||
lo_enh_intf->get_class( IMPORTING class_name = lv_class ).
|
||||
|
||||
io_xml->add( iv_name = 'TOOL'
|
||||
ig_data = ii_enh_tool->get_tool( ) ).
|
||||
io_xml->add( ig_data = lv_shorttext
|
||||
iv_name = 'SHORTTEXT' ).
|
||||
io_xml->add( iv_name = 'CLASS'
|
||||
ig_data = lv_class ).
|
||||
|
||||
lcl_object_enho_clif=>serialize(
|
||||
io_xml = io_xml
|
||||
io_clif = lo_enh_intf ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_enho~deserialize.
|
||||
|
||||
DATA: lo_enh_intf TYPE REF TO cl_enh_tool_intf,
|
||||
lt_source TYPE rswsourcet,
|
||||
li_tool TYPE REF TO if_enh_tool,
|
||||
lv_shorttext TYPE string,
|
||||
lv_class TYPE seoclsname,
|
||||
lv_enhname TYPE enhname,
|
||||
lv_package TYPE devclass.
|
||||
|
||||
|
||||
io_xml->read( EXPORTING iv_name = 'SHORTTEXT'
|
||||
CHANGING cg_data = lv_shorttext ).
|
||||
io_xml->read( EXPORTING iv_name = 'CLASS'
|
||||
CHANGING cg_data = lv_class ).
|
||||
|
||||
lv_enhname = ms_item-obj_name.
|
||||
lv_package = iv_package.
|
||||
TRY.
|
||||
cl_enh_factory=>create_enhancement(
|
||||
EXPORTING
|
||||
enhname = lv_enhname
|
||||
enhtype = ''
|
||||
enhtooltype = cl_enh_tool_intf=>tooltype
|
||||
IMPORTING
|
||||
enhancement = li_tool
|
||||
CHANGING
|
||||
devclass = lv_package ).
|
||||
lo_enh_intf ?= li_tool.
|
||||
|
||||
lo_enh_intf->if_enh_object_docu~set_shorttext( lv_shorttext ).
|
||||
lo_enh_intf->set_class( lv_class ).
|
||||
|
||||
lcl_object_enho_clif=>deserialize(
|
||||
io_xml = io_xml
|
||||
io_clif = lo_enh_intf ).
|
||||
|
||||
lo_enh_intf->if_enh_object~save( ).
|
||||
lo_enh_intf->if_enh_object~unlock( ).
|
||||
CATCH cx_enh_root.
|
||||
lcx_exception=>raise( 'error deserializing ENHO interface' ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_object_enho_class DEFINITION.
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
@ -676,9 +771,13 @@ CLASS lcl_object_enho IMPLEMENTATION.
|
|||
EXPORTING
|
||||
is_item = ms_item
|
||||
io_files = mo_files.
|
||||
WHEN cl_enh_tool_intf=>tooltype.
|
||||
CREATE OBJECT ri_enho TYPE lcl_object_enho_interface
|
||||
EXPORTING
|
||||
is_item = ms_item
|
||||
io_files = mo_files.
|
||||
* ToDo:
|
||||
* WHEN 'ENHFUGRDATA'. "cl_enh_tool_fugr
|
||||
* WHEN cl_enh_tool_intf=>tooltype.
|
||||
* WHEN cl_wdr_cfg_enhancement=>tooltype.
|
||||
* WHEN 'ENHWDYN'. "cl_enh_tool_wdy
|
||||
WHEN OTHERS.
|
||||
|
|
Loading…
Reference in New Issue
Block a user