abapGit/src/zif_abapgit_exit.intf.abap
Marc Bernard 97821c8428
Add user exit for adjusting display of filenames (#5185)
The filenames can become very long, for example, usage of many sub-packages, namespaces, objects like function groups, or BSP/Fiori apps with many sub-objects, or a long paths as starting folder. This can make the repository view very busy or render the output as a very wide table (see #5169, #5178).

This exit allows to adjust the filename according to your own rules. 

Here's an example for shortening the display of files for sub-objects:

```abap
  METHOD zif_abapgit_exit~adjust_display_filename.

    DATA:
      lv_path TYPE string,
      lv_name TYPE string,
      lv_ext1 TYPE string,
      lv_ext2 TYPE string.

    SPLIT iv_filename AT '.' INTO lv_path lv_name lv_ext1 lv_ext2.

    IF lv_ext2 IS INITIAL.
      " Main object
      rv_filename = iv_filename.
    ELSE.
      " Sub object
      rv_filename = |…{ lv_ext1 }.{ lv_ext2 }|.
    ENDIF.

  ENDMETHOD.
```
2021-12-08 08:07:45 +01:00

109 lines
3.1 KiB
ABAP

INTERFACE zif_abapgit_exit
PUBLIC .
TYPES:
BEGIN OF ty_ci_repo,
name TYPE string,
clone_url TYPE string,
END OF ty_ci_repo .
TYPES:
ty_ci_repos TYPE TABLE OF ty_ci_repo .
METHODS adjust_display_commit_url
IMPORTING
!iv_repo_url TYPE csequence
!iv_repo_name TYPE csequence
!iv_repo_key TYPE csequence
!iv_commit_hash TYPE zif_abapgit_definitions=>ty_sha1
CHANGING
!cv_display_url TYPE csequence
RAISING
zcx_abapgit_exception .
METHODS allow_sap_objects
RETURNING
VALUE(rv_allowed) TYPE abap_bool .
METHODS change_local_host
CHANGING
!ct_hosts TYPE zif_abapgit_definitions=>ty_string_tt .
METHODS change_proxy_authentication
IMPORTING
!iv_repo_url TYPE csequence
CHANGING
!cv_proxy_authentication TYPE abap_bool .
METHODS change_proxy_port
IMPORTING
!iv_repo_url TYPE csequence
CHANGING
!cv_proxy_port TYPE string .
METHODS change_proxy_url
IMPORTING
!iv_repo_url TYPE csequence
CHANGING
!cv_proxy_url TYPE string .
METHODS change_tadir
IMPORTING
!iv_package TYPE devclass
!ii_log TYPE REF TO zif_abapgit_log
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt .
METHODS create_http_client
IMPORTING
!iv_url TYPE string
RETURNING
VALUE(ri_client) TYPE REF TO if_http_client
RAISING
zcx_abapgit_exception .
METHODS custom_serialize_abap_clif
IMPORTING
!is_class_key TYPE seoclskey
!it_source TYPE zif_abapgit_definitions=>ty_string_tt OPTIONAL
RETURNING
VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt
RAISING
zcx_abapgit_exception .
METHODS deserialize_postprocess
IMPORTING
!is_step TYPE zif_abapgit_objects=>ty_step_data
!ii_log TYPE REF TO zif_abapgit_log .
METHODS get_ci_tests
IMPORTING
!iv_object TYPE tadir-object
CHANGING
!ct_ci_repos TYPE ty_ci_repos .
METHODS get_ssl_id
RETURNING
VALUE(rv_ssl_id) TYPE ssfapplssl .
METHODS http_client
IMPORTING
!iv_url TYPE string
!ii_client TYPE REF TO if_http_client .
METHODS pre_calculate_repo_status
IMPORTING
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
CHANGING
!ct_local TYPE zif_abapgit_definitions=>ty_files_item_tt
!ct_remote TYPE zif_abapgit_definitions=>ty_files_tt
RAISING
zcx_abapgit_exception .
METHODS wall_message_list
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html .
METHODS wall_message_repo
IMPORTING
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
!ii_html TYPE REF TO zif_abapgit_html .
METHODS on_event
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_handled) TYPE zif_abapgit_gui_event_handler=>ty_handling_result
RAISING
zcx_abapgit_exception .
METHODS adjust_display_filename
IMPORTING
!iv_filename TYPE string
RETURNING
VALUE(rv_filename) TYPE string.
ENDINTERFACE.