There are scenarios where you want to serialize objects differently than abapGit. This exit is called at the end of the serialize process and gives an opportunity to change the content of the serialzed files.
One such scenario would be to automatically pretty-print code. This can be achieved by looping over all `.abap` files and processing them accordingly in this exit.
Closes#5050
Co-authored-by: Lars Hvam <larshp@hotmail.com>
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.
```
* Post-processing option for custom class serializer
When using the current exit for serializing classes, you have to code the complete serialization yourself (i.e. reading and formatting the code).
https://docs.abapgit.org/ref-exits.html#custom_serialize_abap_clif
With this change, you get the option to let abapGit serialize the class first and then post-process the source in the exit. The change is compatible with existing implementations of the exit.
To use the post-processing option, add the following code to the beginning of the exit:
```abap
IF it_source IS INITIAL.
RETURN.
ENDIF.
```
* Update ref-exits.md
Co-authored-by: Lars Hvam <larshp@hotmail.com>
* add user exit for commit display URL
METHODS adjust_display_commit_url
IMPORTING iv_repo_url TYPE zif_abapgit_persistence=>ty_repo-url
iv_commit_hash TYPE zif_abapgit_definitions=>ty_sha1
CHANGING cv_display_url TYPE zif_abapgit_persistence=>ty_repo-url
* adjust UT
* provide also repo name and key in the exit
* Update ref-exits.md
* Update ref-exits.md
Co-authored-by: Lars Hvam <larshp@hotmail.com>
* Update 3 objects
* Update zcl_abapgit_exit.clas.abap
Pretty printer didnt work in JAVA GUI, so had to manually change the file
* IS_STEP as input parameter
* Issue in JAVA based GUI
Pretty printer not working for class name in implementation
* Move TY_STEP_DATA to ZIF_ABAPGIT_DEFINITIONS
* try moving ty_deserialization_step
Co-authored-by: Lars Hvam <larshp@hotmail.com>
* Add user exit for serialize_abap_clif_source
* Document CLIF serializer exit
* Add exit redirection for CLIF serializer
* Add link to example for CLIF serialization exit