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

[CSNM] Add new object type CSNM #557

Merged
merged 22 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a4673fa
Add files for CSNM
michaelbelenki Sep 22, 2023
9cb83f8
Fix abaplint errors
michaelbelenki Sep 22, 2023
50606d2
Fix errors
michaelbelenki Sep 22, 2023
b67e1f4
Fix folder name
michaelbelenki Sep 25, 2023
065248f
Update file-formats/csnm/README.md
michaelbelenki Sep 25, 2023
a3141ed
Update file-formats/csnm/examples/z_aff_example_csnm.csnm.json
michaelbelenki Sep 25, 2023
ae5a2e8
Fix lint errors
michaelbelenki Sep 25, 2023
ba4f64d
Delete file-formats/csnm/.DS_Store
michaelbelenki Sep 25, 2023
33a5b8e
Merge branch 'main' into feature/csnm
schneidermic0 Sep 25, 2023
15e9cde
Remove unneccessary comment from abap interface
michaelbelenki Sep 25, 2023
1734112
Merge branch 'main' into feature/csnm
schneidermic0 Sep 26, 2023
f18570d
Update file-formats/csnm/examples/z_aff_example_csnm.csnm.json
michaelbelenki Sep 26, 2023
fea8faa
Update file-formats/csnm/examples/z_aff_example_csnm.csnm.json
michaelbelenki Sep 26, 2023
4b739fc
Ajust AFF (general information node is deleted)
michaelbelenki Sep 26, 2023
52d9534
Adjust doc comment on the ABAP interface
michaelbelenki Sep 26, 2023
78afcef
Adjust title and description
michaelbelenki Sep 26, 2023
919a0f9
Update file-formats/csnm/type/zif_aff_csnm_v1.intf.abap
michaelbelenki Sep 29, 2023
5b97766
Update file-formats/csnm/type/zif_aff_csnm_v1.intf.abap
michaelbelenki Sep 29, 2023
9f0ae50
Update file-formats/csnm/type/zif_aff_csnm_v1.intf.abap
michaelbelenki Sep 29, 2023
7d74559
Adjust schema
michaelbelenki Sep 29, 2023
b698917
Merge branch 'main' into feature/csnm
schneidermic0 Oct 2, 2023
0c799bd
Implementation of requested changes
michaelbelenki Oct 3, 2023
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
6 changes: 6 additions & 0 deletions file-formats/csnm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CSNM File Format

File | Cardinality | Definition | Schema | Example
michaelbelenki marked this conversation as resolved.
Show resolved Hide resolved
:--- | :--- | :--- | :--- | :---
`<name>.csnm.json` | 1 | [`zif_aff_csnm_v1.intf.abap`](./type/zif_aff_csnm_v1.intf.abap) | [`csnm-v1.json`](./csnm-v1.json) | [z_aff_example_csnm.csnm.json](./examples/z_aff_example_csnm.csnm.json)
`<name>.csnm.<csnfilename>.csn` | 0...n | - | - | [z_aff_example_csnm.csnm.model_inferred.csn](./examples/z_aff_example_csnm.csnm.model_inferred.csn)
83 changes: 83 additions & 0 deletions file-formats/csnm/csnm-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"$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/csnm/csnm-v1.json",
"title": "CSN Model Transport Object",
"description": "CSN model transport object",
"type": "object",
"properties": {
"formatVersion": {
"title": "Format Version",
"description": "Format version",
"type": "string",
"const": "1"
},
"header": {
"title": "Header",
"description": "Header",
"type": "object",
"properties": {
"description": {
"title": "Description",
"description": "Description of the ABAP object",
"type": "string",
"maxLength": 60
},
"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",
"cloudDevelopment"
],
"enumTitles": [
"Standard",
"ABAP Cloud Development"
],
"enumDescriptions": [
"Standard",
"ABAP cloud development"
],
"default": "standard"
}
},
"additionalProperties": false,
"required": [
"description",
"originalLanguage"
]
},
"csnFiles": {
"title": "CSN Files",
"description": "CSN files",
"type": "array",
"items": {
"title": "CSN File",
"description": "CSN file",
"type": "object",
"properties": {
"name": {
"title": "CSN File Name",
"description": "CSN file name",
"type": "string"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false,
"required": [
"formatVersion",
"header"
]
}
12 changes: 12 additions & 0 deletions file-formats/csnm/examples/z_aff_example_csnm.csnm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"formatVersion": "1",
"header": {
"description": "Example CSN model for ABAP file formats",
"originalLanguage": "en"
},
"csnFiles": [
{
"name": "model_inferred.csn"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"definitions": {
"Foo": {
"kind": "entity",
"elements": {
"name": {
"key": true,
"type": "cds.String"
},
"vorname": {
"key": true,
"type": "cds.String"
}
}
},
"Bar": {
"kind": "entity",
"projection": {
"from": {
"ref": [
"Foo"
]
},
"columns": [
{
"ref": [
"name"
],
"as": "Name"
},
{
"ref": [
"vorname"
],
"as": "Vorname"
}
]
},
"elements": {
"Name": {
"key": true,
"type": "cds.String"
},
"Vorname": {
"key": true,
"type": "cds.String"
}
}
}
},
"meta": {
"creator": "CDS Compiler v3.3.2",
"flavor": "inferred"
},
"$version": "2.0"
}
34 changes: 34 additions & 0 deletions file-formats/csnm/type/zif_aff_csnm_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"! ABAP File Format for CSN Model Transport Object Generic Editor
INTERFACE zif_aff_csnm_v1
PUBLIC.

TYPES:
"! <p class="shorttext">CSN File</p>
"! CSN file
BEGIN OF ty_csn_file,
"! <p class="shorttext">CSN File Name</p>
michaelbelenki marked this conversation as resolved.
Show resolved Hide resolved
"! CSN file name
michaelbelenki marked this conversation as resolved.
Show resolved Hide resolved
name TYPE string,
michaelbelenki marked this conversation as resolved.
Show resolved Hide resolved
END OF ty_csn_file.

"! <p class="shorttext">CSN Files</p>
"! CSN files
TYPES ty_csn_files TYPE STANDARD TABLE OF ty_csn_file WITH DEFAULT KEY.

TYPES:
"! <p class="shorttext">CSN Model Transport Object</p>
"! CSN model transport object
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 zif_aff_types_v1=>ty_header_60_cloud,
"! <p class="shorttext">CSN Files</p>
"! CSN files
csn_files TYPE ty_csn_files,
END OF ty_main.
ENDINTERFACE.
7 changes: 7 additions & 0 deletions file-formats/csnm/type/zif_aff_csnm_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "CSN AFF type for CSNM repository object",
"originalLanguage": "en"
}
}
Loading