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 14 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)
20 changes: 20 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,20 @@
{
"formatVersion": "1",
"header": {
"originalLanguage": "en",
"abapLanguageVersion": "cloudDevelopment"
hottek marked this conversation as resolved.
Show resolved Hide resolved
},
"permissions": [
{
"softwareComponent": "/PARTNER_1/SOLUTION_1"
},
{
"softwareComponent": "/PARTNER_1/SOLUTION_2"
}
],
"dependencies": [
{
"softwareComponent": "/PARTNER_1/KEY_USER"
}
]
}
105 changes: 105 additions & 0 deletions file-formats/swcr/swcr-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"$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"
]
},
"permissions": {
"title": "Access Permissions",
"description": "The Software Component Grants Access Permission to the Specified Software Components",
"type": "array",
"items": {
"title": "Access Permission",
"description": "Access Permission",
"type": "object",
"properties": {
"softwareComponent": {
"title": "Software Component",
"description": "Software Component",
"type": "string",
"maxLength": 30
}
},
"additionalProperties": false,
"required": [
"softwareComponent"
]
}
},
"dependencies": {
"title": "Dependencies",
"description": "The Software Component Depends on the Specified Software Components",
"type": "array",
"items": {
"title": "Dependency",
"description": "Dependency",
"type": "object",
"properties": {
"softwareComponent": {
"title": "Software Component",
"description": "Software Component",
"type": "string",
"maxLength": 30
}
},
"additionalProperties": false,
"required": [
"softwareComponent"
]
}
}
},
"additionalProperties": false,
"required": [
"formatVersion",
"header"
]
}
61 changes: 61 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,61 @@
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.

TYPES:
"! <p class="shorttext">Access Permission</p>
"! Access Permission
hottek marked this conversation as resolved.
Show resolved Hide resolved
BEGIN OF ty_permission,
"! <p class="shorttext">Software Component</p>
"! Software Component
hottek marked this conversation as resolved.
Show resolved Hide resolved
"! $required
software_component TYPE c LENGTH 30,
hottek marked this conversation as resolved.
Show resolved Hide resolved
END OF ty_permission.

"! <p class="shorttext">Access Permissions</p>
"! Access Permissions
hottek marked this conversation as resolved.
Show resolved Hide resolved
TYPES ty_permissions TYPE STANDARD TABLE OF ty_permission WITH DEFAULT KEY.

TYPES:
"! <p class="shorttext">Dependency</p>
"! Dependency
BEGIN OF ty_dependency,
"! <p class="shorttext">Software Component</p>
"! Software Component
"! $required
software_component TYPE c LENGTH 30,
END OF ty_dependency.

"! <p class="shorttext">Dependencies</p>
"! Dependencies
TYPES ty_dependencies TYPE STANDARD TABLE OF ty_dependency WITH DEFAULT KEY.

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">Access Permissions</p>
"! The Software Component Grants Access Permission to the Specified Software Components
permissions TYPE ty_permissions,
hottek marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Dependencies</p>
"! The Software Component Depends on the Specified Software Components
dependencies TYPE ty_dependencies,
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"
}
}