Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/development-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Development related information
- [Overview](serializers/overview.md)
- [Serializer Class](serializers/serializers.md)
- [New Serializers](serializers/task-list.md)
- [Adding AFF support](serializers/aff.md)
- [File Naming and Formats](serializers/file-formats.md)

### Testing
Expand Down
1 change: 1 addition & 0 deletions src/development-guide/serializers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dir:
- [Overview](overview.md)
- [Serializer Class](serializers.md)
- [New Serializers](task-list.md)
- [Adding AFF support](aff.md)
- [File Naming and Formats](file-formats.md)
21 changes: 21 additions & 0 deletions src/development-guide/serializers/aff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Adding AFF support
category: serializers
order: 35
---

The [ABAP File Format (AFF)](https://github.com/SAP/abap-file-formats) is the preferred
format for object types for which SAP provides an AFF object handler.

For implementing AFF support for new object types already supported by AFF see the examples in the repository.

abapGit has been backwards compatible for 10+ years, and whishes to continue to support all users going forward.
This means reading old formats and writing new formats, and not breaking existing users, and users should not loose any data when switching to a new format.

Suggested approach:

* Read the old XML into the new AFF format carried by the INTF, https://github.com/abapGit/abapGit/tree/main/src/objects/aff_types

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading needs to support both xml and json formats.

* Persist the object given the data in the INTF
* Serialize the object to AFF format

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should define which part gets implemented in which class ie what changes need to be made to the old class and what needs to be changed in the framework around it (and we assume a new AFF class has been provided by SAP that calls the AFF handler which might not be the case).

That's what I tried to discuss in abapGit/abapGit#7768

Make sure to test and keep old and new examples in https://github.com/orgs/abapGit-tests
10 changes: 6 additions & 4 deletions src/development-guide/serializers/task-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ The following list includes the mandatory and recommended tasks for adding a new
abapGit maintainers will add your issue to a [central list](https://github.com/abapGit/abapGit/issues/5912) and, if there's no further discussion required, close it.
:::

3. Implement the serializer class

Follow the instructions below. Often, it makes sense to use an existing serializer class as a template. This can save a lot of work especially if the new object type is similar to others.
3. Implement the serializer class

Follow the instructions below. Often, it makes sense to use an existing serializer class as a template. This can save a lot of work especially if the new object type is similar to others.

If SAP provides an ABAP File Format object handler for the object type, follow [Adding AFF support](aff.md).

::: warning
Your code must comply with the [development guidelines](/development-guide/read-first/guidelines.md) for abapGit. Most notably your code must be compatible with 7.02 ABAP syntax and available standard SAP objects, use prefixing of variables, be pretty-printed, and pass all abaplint checks.
Expand All @@ -48,7 +50,7 @@ You might get lots of abaplint errors. If you are uncertain how to resolve these

Fork the abapGit repository and add a branch for your serializer class. Commit your implementation (the `zcl_abapgit_object_<type>` class) to the branch, and create a pull request to the abapGit repository. Reference your issue in the pull request and add a link to the test repository.

Note: Object types using the ABAP File Format must be added to the [AFF Registry](https://github.com/abapGit/abapGit/blob/d0167ff97dcf6f90ed2721c40d194a5fb34f3ea0/src/objects/aff/zcl_abapgit_aff_registry.clas.abap#L51-L61) as well.
Note: Object types using the ABAP File Format must be added to the [AFF Registry](aff.md#register-the-object-type) as well.

7. Update documentation

Expand Down
Loading