mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 04:08:27 +08:00
new user exit: change allowed object types (#6173)
This commit is contained in:
parent
a997a72eb1
commit
8ae35648e4
|
@ -93,6 +93,18 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD zif_abapgit_exit~change_supported_object_types.
|
||||||
|
|
||||||
|
IF gi_exit IS NOT INITIAL.
|
||||||
|
TRY.
|
||||||
|
gi_exit->change_supported_object_types( CHANGING ct_types = ct_types ).
|
||||||
|
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
||||||
|
ENDTRY.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_exit~change_proxy_authentication.
|
METHOD zif_abapgit_exit~change_proxy_authentication.
|
||||||
|
|
||||||
IF gi_exit IS NOT INITIAL.
|
IF gi_exit IS NOT INITIAL.
|
||||||
|
@ -207,6 +219,23 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD zif_abapgit_exit~determine_transport_request.
|
||||||
|
|
||||||
|
IF gi_exit IS NOT INITIAL.
|
||||||
|
TRY.
|
||||||
|
gi_exit->determine_transport_request(
|
||||||
|
EXPORTING
|
||||||
|
io_repo = io_repo
|
||||||
|
iv_transport_type = iv_transport_type
|
||||||
|
CHANGING
|
||||||
|
cv_transport_request = cv_transport_request ).
|
||||||
|
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
||||||
|
ENDTRY.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_exit~get_ci_tests.
|
METHOD zif_abapgit_exit~get_ci_tests.
|
||||||
|
|
||||||
IF gi_exit IS NOT INITIAL.
|
IF gi_exit IS NOT INITIAL.
|
||||||
|
@ -299,6 +328,21 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD zif_abapgit_exit~validate_before_push.
|
||||||
|
|
||||||
|
IF gi_exit IS NOT INITIAL.
|
||||||
|
TRY.
|
||||||
|
gi_exit->validate_before_push(
|
||||||
|
is_comment = is_comment
|
||||||
|
io_stage = io_stage
|
||||||
|
io_repo = io_repo ).
|
||||||
|
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
||||||
|
ENDTRY.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_exit~wall_message_list.
|
METHOD zif_abapgit_exit~wall_message_list.
|
||||||
|
|
||||||
IF gi_exit IS NOT INITIAL.
|
IF gi_exit IS NOT INITIAL.
|
||||||
|
@ -323,36 +367,4 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_exit~determine_transport_request.
|
|
||||||
|
|
||||||
IF gi_exit IS NOT INITIAL.
|
|
||||||
TRY.
|
|
||||||
gi_exit->determine_transport_request(
|
|
||||||
EXPORTING
|
|
||||||
io_repo = io_repo
|
|
||||||
iv_transport_type = iv_transport_type
|
|
||||||
CHANGING
|
|
||||||
cv_transport_request = cv_transport_request ).
|
|
||||||
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
|
||||||
ENDTRY.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_exit~validate_before_push.
|
|
||||||
|
|
||||||
IF gi_exit IS NOT INITIAL.
|
|
||||||
TRY.
|
|
||||||
gi_exit->validate_before_push(
|
|
||||||
is_comment = is_comment
|
|
||||||
io_stage = io_stage
|
|
||||||
io_repo = io_repo ).
|
|
||||||
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
|
||||||
ENDTRY.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
INTERFACE zif_abapgit_exit
|
INTERFACE zif_abapgit_exit
|
||||||
PUBLIC.
|
PUBLIC .
|
||||||
|
|
||||||
|
|
||||||
TYPES:
|
TYPES:
|
||||||
BEGIN OF ty_ci_repo,
|
BEGIN OF ty_ci_repo,
|
||||||
name TYPE string,
|
name TYPE string,
|
||||||
clone_url TYPE string,
|
clone_url TYPE string,
|
||||||
END OF ty_ci_repo.
|
END OF ty_ci_repo .
|
||||||
TYPES:
|
TYPES:
|
||||||
ty_ci_repos TYPE TABLE OF ty_ci_repo.
|
ty_ci_repos TYPE TABLE OF ty_ci_repo .
|
||||||
|
TYPES:
|
||||||
|
ty_object_types TYPE STANDARD TABLE OF tadir-object WITH DEFAULT KEY .
|
||||||
|
|
||||||
|
METHODS change_supported_object_types
|
||||||
|
CHANGING
|
||||||
|
!ct_types TYPE ty_object_types .
|
||||||
METHODS adjust_display_commit_url
|
METHODS adjust_display_commit_url
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_repo_url TYPE csequence
|
!iv_repo_url TYPE csequence
|
||||||
|
@ -18,55 +24,46 @@ INTERFACE zif_abapgit_exit
|
||||||
CHANGING
|
CHANGING
|
||||||
!cv_display_url TYPE csequence
|
!cv_display_url TYPE csequence
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception .
|
||||||
|
|
||||||
METHODS adjust_display_filename
|
METHODS adjust_display_filename
|
||||||
IMPORTING
|
IMPORTING
|
||||||
iv_filename TYPE string
|
!iv_filename TYPE string
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rv_filename) TYPE string.
|
VALUE(rv_filename) TYPE string .
|
||||||
|
|
||||||
METHODS allow_sap_objects
|
METHODS allow_sap_objects
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rv_allowed) TYPE abap_bool.
|
VALUE(rv_allowed) TYPE abap_bool .
|
||||||
|
|
||||||
METHODS change_local_host
|
METHODS change_local_host
|
||||||
CHANGING
|
CHANGING
|
||||||
!ct_hosts TYPE zif_abapgit_definitions=>ty_string_tt.
|
!ct_hosts TYPE zif_abapgit_definitions=>ty_string_tt .
|
||||||
|
|
||||||
METHODS change_proxy_authentication
|
METHODS change_proxy_authentication
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_repo_url TYPE csequence
|
!iv_repo_url TYPE csequence
|
||||||
CHANGING
|
CHANGING
|
||||||
!cv_proxy_authentication TYPE abap_bool.
|
!cv_proxy_authentication TYPE abap_bool .
|
||||||
|
|
||||||
METHODS change_proxy_port
|
METHODS change_proxy_port
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_repo_url TYPE csequence
|
!iv_repo_url TYPE csequence
|
||||||
CHANGING
|
CHANGING
|
||||||
!cv_proxy_port TYPE string.
|
!cv_proxy_port TYPE string .
|
||||||
|
|
||||||
METHODS change_proxy_url
|
METHODS change_proxy_url
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_repo_url TYPE csequence
|
!iv_repo_url TYPE csequence
|
||||||
CHANGING
|
CHANGING
|
||||||
!cv_proxy_url TYPE string.
|
!cv_proxy_url TYPE string .
|
||||||
|
|
||||||
METHODS change_tadir
|
METHODS change_tadir
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_package TYPE devclass
|
!iv_package TYPE devclass
|
||||||
!ii_log TYPE REF TO zif_abapgit_log
|
!ii_log TYPE REF TO zif_abapgit_log
|
||||||
CHANGING
|
CHANGING
|
||||||
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
|
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt .
|
||||||
|
|
||||||
METHODS create_http_client
|
METHODS create_http_client
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_url TYPE string
|
!iv_url TYPE string
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(ri_client) TYPE REF TO if_http_client
|
VALUE(ri_client) TYPE REF TO if_http_client
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception .
|
||||||
|
|
||||||
METHODS custom_serialize_abap_clif
|
METHODS custom_serialize_abap_clif
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_class_key TYPE seoclskey
|
!is_class_key TYPE seoclskey
|
||||||
|
@ -74,43 +71,36 @@ INTERFACE zif_abapgit_exit
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt
|
VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception .
|
||||||
|
|
||||||
METHODS deserialize_postprocess
|
METHODS deserialize_postprocess
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_step TYPE zif_abapgit_objects=>ty_step_data
|
!is_step TYPE zif_abapgit_objects=>ty_step_data
|
||||||
!ii_log TYPE REF TO zif_abapgit_log.
|
!ii_log TYPE REF TO zif_abapgit_log .
|
||||||
|
|
||||||
METHODS determine_transport_request
|
METHODS determine_transport_request
|
||||||
IMPORTING
|
IMPORTING
|
||||||
io_repo TYPE REF TO zcl_abapgit_repo
|
!io_repo TYPE REF TO zcl_abapgit_repo
|
||||||
iv_transport_type TYPE zif_abapgit_definitions=>ty_transport_type
|
!iv_transport_type TYPE zif_abapgit_definitions=>ty_transport_type
|
||||||
CHANGING
|
CHANGING
|
||||||
cv_transport_request TYPE trkorr.
|
!cv_transport_request TYPE trkorr .
|
||||||
|
|
||||||
METHODS get_ci_tests
|
METHODS get_ci_tests
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_object TYPE tadir-object
|
!iv_object TYPE tadir-object
|
||||||
CHANGING
|
CHANGING
|
||||||
!ct_ci_repos TYPE ty_ci_repos.
|
!ct_ci_repos TYPE ty_ci_repos .
|
||||||
|
|
||||||
METHODS get_ssl_id
|
METHODS get_ssl_id
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rv_ssl_id) TYPE ssfapplssl.
|
VALUE(rv_ssl_id) TYPE ssfapplssl .
|
||||||
|
|
||||||
METHODS http_client
|
METHODS http_client
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_url TYPE string
|
!iv_url TYPE string
|
||||||
!ii_client TYPE REF TO if_http_client.
|
!ii_client TYPE REF TO if_http_client .
|
||||||
|
|
||||||
METHODS on_event
|
METHODS on_event
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!ii_event TYPE REF TO zif_abapgit_gui_event
|
!ii_event TYPE REF TO zif_abapgit_gui_event
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
|
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception .
|
||||||
|
|
||||||
METHODS pre_calculate_repo_status
|
METHODS pre_calculate_repo_status
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
|
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
|
||||||
|
@ -118,30 +108,25 @@ INTERFACE zif_abapgit_exit
|
||||||
!ct_local TYPE zif_abapgit_definitions=>ty_files_item_tt
|
!ct_local TYPE zif_abapgit_definitions=>ty_files_item_tt
|
||||||
!ct_remote TYPE zif_abapgit_git_definitions=>ty_files_tt
|
!ct_remote TYPE zif_abapgit_git_definitions=>ty_files_tt
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception .
|
||||||
|
|
||||||
METHODS serialize_postprocess
|
METHODS serialize_postprocess
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_package TYPE devclass
|
!iv_package TYPE devclass
|
||||||
!ii_log TYPE REF TO zif_abapgit_log
|
!ii_log TYPE REF TO zif_abapgit_log
|
||||||
CHANGING
|
CHANGING
|
||||||
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt.
|
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt .
|
||||||
|
|
||||||
METHODS validate_before_push
|
METHODS validate_before_push
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_comment TYPE zif_abapgit_git_definitions=>ty_comment
|
!is_comment TYPE zif_abapgit_git_definitions=>ty_comment
|
||||||
!io_stage TYPE REF TO zcl_abapgit_stage
|
!io_stage TYPE REF TO zcl_abapgit_stage
|
||||||
!io_repo TYPE REF TO zcl_abapgit_repo_online
|
!io_repo TYPE REF TO zcl_abapgit_repo_online
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception .
|
||||||
|
|
||||||
METHODS wall_message_list
|
METHODS wall_message_list
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!ii_html TYPE REF TO zif_abapgit_html.
|
!ii_html TYPE REF TO zif_abapgit_html .
|
||||||
|
|
||||||
METHODS wall_message_repo
|
METHODS wall_message_repo
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
|
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
|
||||||
!ii_html TYPE REF TO zif_abapgit_html.
|
!ii_html TYPE REF TO zif_abapgit_html .
|
||||||
|
|
||||||
ENDINTERFACE.
|
ENDINTERFACE.
|
||||||
|
|
|
@ -1146,9 +1146,12 @@ CLASS zcl_abapgit_objects IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD supported_list.
|
METHOD supported_list.
|
||||||
|
|
||||||
DATA: lt_objects TYPE STANDARD TABLE OF ko100,
|
DATA lt_objects TYPE STANDARD TABLE OF ko100.
|
||||||
ls_item TYPE zif_abapgit_definitions=>ty_item,
|
DATA ls_item TYPE zif_abapgit_definitions=>ty_item.
|
||||||
ls_supported_obj_type TYPE ty_supported_types.
|
DATA ls_supported_obj_type TYPE ty_supported_types.
|
||||||
|
DATA lt_types TYPE zif_abapgit_exit=>ty_object_types.
|
||||||
|
DATA lv_type LIKE LINE OF lt_types.
|
||||||
|
DATA li_exit TYPE REF TO zif_abapgit_exit.
|
||||||
|
|
||||||
FIELD-SYMBOLS <ls_object> LIKE LINE OF lt_objects.
|
FIELD-SYMBOLS <ls_object> LIKE LINE OF lt_objects.
|
||||||
FIELD-SYMBOLS <ls_supported_obj_type> TYPE ty_supported_types.
|
FIELD-SYMBOLS <ls_supported_obj_type> TYPE ty_supported_types.
|
||||||
|
@ -1170,10 +1173,16 @@ CLASS zcl_abapgit_objects IMPLEMENTATION.
|
||||||
OTHERS = 1 ##FM_SUBRC_OK.
|
OTHERS = 1 ##FM_SUBRC_OK.
|
||||||
|
|
||||||
LOOP AT lt_objects ASSIGNING <ls_object> WHERE pgmid = 'R3TR'.
|
LOOP AT lt_objects ASSIGNING <ls_object> WHERE pgmid = 'R3TR'.
|
||||||
|
INSERT <ls_object>-object INTO TABLE lt_types.
|
||||||
|
ENDLOOP.
|
||||||
|
|
||||||
ls_item-obj_type = <ls_object>-object.
|
li_exit = zcl_abapgit_exit=>get_instance( ).
|
||||||
|
li_exit->change_supported_object_types( CHANGING ct_types = lt_types ).
|
||||||
|
|
||||||
ls_supported_obj_type-obj_type = <ls_object>-object.
|
LOOP AT lt_types INTO lv_type.
|
||||||
|
ls_item-obj_type = lv_type.
|
||||||
|
|
||||||
|
ls_supported_obj_type-obj_type = lv_type.
|
||||||
ls_supported_obj_type-supported = is_supported( ls_item ).
|
ls_supported_obj_type-supported = is_supported( ls_item ).
|
||||||
|
|
||||||
INSERT ls_supported_obj_type INTO TABLE gt_supported_obj_types.
|
INSERT ls_supported_obj_type INTO TABLE gt_supported_obj_types.
|
||||||
|
@ -1181,7 +1190,6 @@ CLASS zcl_abapgit_objects IMPLEMENTATION.
|
||||||
IF ls_supported_obj_type-supported = abap_true.
|
IF ls_supported_obj_type-supported = abap_true.
|
||||||
INSERT ls_supported_obj_type-obj_type INTO TABLE rt_types.
|
INSERT ls_supported_obj_type-obj_type INTO TABLE rt_types.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
gv_supported_obj_types_loaded = abap_true.
|
gv_supported_obj_types_loaded = abap_true.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user