Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SWCR] Add new object type Software Component Relations #539

Merged
merged 17 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 10 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
5 changes: 5 additions & 0 deletions file-formats/swcr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SWCR File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.swcr.json` | 1 | [`zif_aff_swcr_v1.intf.abap`](./type/zif_aff_swcr_v1.intf.abap) | [`swcr-v1.json`](./swcr-v1.json) | [`z_aff_example_swcr.swcr.json`](./examples/z_aff_example_swcr.swcr.json)
17 changes: 17 additions & 0 deletions file-formats/swcr/examples/z_aff_example_swcr.swcr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"formatVersion": "1",
"header": {
"originalLanguage": "en",
"abapLanguageVersion": "cloudDevelopment"
hottek marked this conversation as resolved.
Show resolved Hide resolved
},
"relations": [
{
"softwareComponent": "/PARTNER/APPLICATION",
"type": "unrestricted"
},
{
"softwareComponent": "ZCUSTOM_DEVELOPMENT",
"type": "keyUserExtensibilityUsage"
}
]
}
103 changes: 103 additions & 0 deletions file-formats/swcr/swcr-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"$comment": "This file is autogenerated, do not edit manually, see https://github.com/SAP/abap-file-formats for more information.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/swcr/swcr-v1.json",
"title": "Software Component Relations",
"description": "Software Component Relations",
"type": "object",
"properties": {
"formatVersion": {
"title": "Format Version",
"description": "Format version",
"type": "string",
"const": "1"
},
"header": {
"title": "Header",
"description": "Header",
"type": "object",
"properties": {
"originalLanguage": {
"title": "Original Language",
"description": "Original language of the ABAP object",
"type": "string",
"minLength": 2,
"maxLength": 2,
"pattern": "^[a-z]+$"
},
"abapLanguageVersion": {
"title": "ABAP Language Version",
"description": "ABAP language version",
"type": "string",
"enum": [
"standard",
"keyUser",
"cloudDevelopment"
],
"enumTitles": [
"Standard",
"ABAP for Key Users",
"ABAP Cloud Development"
],
"enumDescriptions": [
"Standard",
"ABAP for key user extensibility",
"ABAP cloud development"
],
"default": "standard"
}
},
"additionalProperties": false,
"required": [
"originalLanguage"
]
},
"relations": {
"title": "Relations",
"description": "Relations",
"type": "array",
"uniqueItems": true,
"items": {
"title": "Related Software Component",
"description": "Related Software Component",
"type": "object",
"properties": {
"softwareComponent": {
"title": "Related Software Component",
"description": "Related Software Component",
"type": "string",
"maxLength": 30
},
"type": {
"title": "Relation Type",
"description": "Relation Type",
"type": "string",
"enum": [
"unrestricted",
"keyUserExtensibilityUsage"
],
"enumTitles": [
"Unrestricted Usage",
"Key User Extensibility Usage"
],
"enumDescriptions": [
"Unrestricted Usage",
"Key User Extensibility Usage"
]
}
},
"additionalProperties": false,
"required": [
"softwareComponent",
"type"
]
}
}
},
"additionalProperties": false,
"required": [
"formatVersion",
"header",
"relations"
]
}
66 changes: 66 additions & 0 deletions file-formats/swcr/type/zif_aff_swcr_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
INTERFACE zif_aff_swcr_v1
PUBLIC.

TYPES:
"! <p class="shorttext">Header</p>
"! Header
BEGIN OF ty_header,
"! $required
original_language TYPE zif_aff_types_v1=>ty_original_language,
abap_language_version TYPE zif_aff_types_v1=>ty_abap_language_version,
END OF ty_header.

"! <p class="shorttext">Relation Type</p>
"! Relation Type
"! $values {@link zif_aff_swcr_v1.data:co_relation_type}
TYPES ty_relation_type TYPE c LENGTH 1.

CONSTANTS:
"! <p class="shorttext">Relation Type</p>
"! Relation Type
BEGIN OF co_relation_type,
"! <p class="shorttext">Unrestricted Usage</p>
"! Unrestricted Usage
unrestricted TYPE ty_relation_type VALUE '1',
"! <p class="shorttext">Key User Extensibility Usage</p>
"! Key User Extensibility Usage
key_user_extensibility_usage TYPE ty_relation_type VALUE '2',
END OF co_relation_type.

TYPES:
"! <p class="shorttext">Related Software Component</p>
"! Related Software Component
BEGIN OF ty_relation,
"! <p class="shorttext">Related Software Component</p>
"! Related Software Component
"! $required
software_component TYPE c LENGTH 30,
"! <p class="shorttext">Relation Type</p>
"! Relation Type
"! $required
type TYPE ty_relation_type,
END OF ty_relation.

"! <p class="shorttext">Relations</p>
"! Relations
TYPES ty_relations TYPE SORTED TABLE OF ty_relation WITH UNIQUE KEY software_component.

TYPES:
"! <p class="shorttext">Software Component Relations</p>
"! Software Component Relations
BEGIN OF ty_main,
"! <p class="shorttext">Format Version</p>
"! Format version
"! $required
format_version TYPE zif_aff_types_v1=>ty_format_version,
"! <p class="shorttext">Header</p>
"! Header
"! $required
header TYPE ty_header,
"! <p class="shorttext">Relations</p>
"! Relations
"! $required
relations TYPE ty_relations,
END OF ty_main.

ENDINTERFACE.
7 changes: 7 additions & 0 deletions file-formats/swcr/type/zif_aff_swcr_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "AFF Type for SWCR (Software Component Relations)",
"originalLanguage": "en"
}
}