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

[SMTG] Add new object type SMTG #633

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
5 changes: 5 additions & 0 deletions file-formats/smtg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SMTG File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.smtg.json` | 1 | [`zob_aff_smtg_v1.intf.abap`](./type/zob_aff_smtg_v1.intf.abap) | [`smtg-v1.json`](./smtg-v1.json)
226 changes: 226 additions & 0 deletions file-formats/smtg/smtg-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"$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/smtg/smtg-v1.json",
"title": "Demo Object Type SMTG",
"description": "Demo object type SMTG",
"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
},
"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": [
"description",
"originalLanguage"
]
},
"generalInformation": {
"title": "General Information",
"description": "General information",
"type": "object",
"properties": {
"templateHeader": {
"title": "Template Header",
"description": "Contains basic template identifiers and description",
"type": "object",
"properties": {
"templateId": {
"title": "Template Name",
"description": "Unique identifier for the template",
"type": "string",
"maxLength": 60
},
"cdsView": {
"title": "CDS View",
"description": "The corresponding CDS view name for the template",
"type": "string",
"maxLength": 30
},
"description": {
"title": "Description",
"description": "Brief description of the template",
"type": "string",
"maxLength": 255
},
"predelivered": {
"title": "Predelivered",
"description": "Indicator if the template is pre-delivered",
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"templateId",
"cdsView"
]
},
"administrativeData": {
"title": "Administrative Data",
"description": "Contains info about template creation and modification",
"type": "object",
"properties": {
"createdBy": {
"title": "Created By",
"description": "Created by",
"type": "string"
},
"lastChangedBy": {
"title": "Last Changed By",
"description": "last changed by",
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"templateHeader",
"administrativeData"
]
},
"templateOptions": {
"title": "Options",
"description": "Options",
"type": "object",
"properties": {
"languages": {
"title": "Languages",
"description": "Available languages for the template",
"type": "array",
"items": {
"title": "Template Language",
"description": "Language options for the template",
"type": "object",
"properties": {
"country": {
"title": "Language",
"description": "Language code",
"type": "string"
},
"html": {
"title": "HTML",
"description": "Indicates if HTML format is available",
"type": "boolean"
},
"plain": {
"title": "Plain",
"description": "Indicates if plain text is available",
"type": "boolean"
},
"auto": {
"title": "Auto",
"description": "Indicates if automatic plain text update is enabled",
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"country"
]
}
},
"inputFields": {
"title": "Input Fields",
"description": "Input fields for the template from corresponding CDS view",
"type": "array",
"items": {
"title": "Input Field",
"description": "Input field",
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "Name of the input field",
"type": "string"
},
"text": {
"title": "Text",
"description": "Text asscociated with the input field",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"name",
"text"
]
}
}
},
"additionalProperties": false,
"required": [
"languages"
]
},
"templateContent": {
"title": "Text",
"description": "Text",
"type": "object",
"properties": {
"bodyHtml": {
"title": "Body HTML",
"description": "The HTML body content of the email template",
"type": "string"
},
"bodyPlainText": {
"title": "Body Plain Text",
"description": "The plain text body content of the email template",
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": [
"formatVersion",
"header",
"generalInformation",
"templateOptions",
"templateContent"
]
}
156 changes: 156 additions & 0 deletions file-formats/smtg/type/zob_aff_smtg_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
interface zob_aff_smtg_v1

Check failure on line 1 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Object name does not match pattern ^(ZIF\_AFF\_|Z\_AFF\_EXAMPLE): ZOB_AFF_SMTG_V1

https://rules.abaplint.org/object_naming
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
public.

Check failure on line 2 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "interface"

https://rules.abaplint.org/keyword_case

" Email Template Metadata --------------------------------------------------------------------------------------------
types:

Check failure on line 5 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Administrative Data</p>
"! Contains administrative details such as creation and last change information.
begin of ty_administrative_data,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Created By</p>
"! Created by
"! $showAlways
created_by type string,
"! <p class="shorttext">Last Changed By</p>
"! last changed by
"! $showAlways
last_changed_by type string,
end of ty_administrative_data.

types:

Check failure on line 19 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Header</p>
"! Contains identifying and descriptive information about the template.
begin of ty_template_header,

Check failure on line 22 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Type "TY_TEMPLATE_HEADER" contains unknown: SMTG_TMPL_NAME not found, lookup

https://rules.abaplint.org/unknown_types
"! <p class="shorttext">Template Name</p>
"! Unique identifier for the template
"! $required
template_id type smtg_tmpl_name,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">CDS View</p>
"! The corresponding CDS view name for the template
"! $required
cds_view type smtg_cds_view,
"! <p class="shorttext">Description</p>
"! Brief description of the template
description type smtg_tmpl_description,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Predelivered</p>
"! Indicator if the template is pre-delivered
predelivered type abap_bool,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
end of ty_template_header.

types:

Check failure on line 39 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">General Information</p>
"! Combines template header and administrative data.
begin of ty_general_information,

Check failure on line 42 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Type "TY_GENERAL_INFORMATION" contains unknown: SMTG_TMPL_NAME not found, lookup

https://rules.abaplint.org/unknown_types
"! <p class="shorttext">Template Header</p>
"! Contains basic template identifiers and description
"! $required
template_header type ty_template_header,
"! <p class="shorttext">Administrative Data</p>
"! Contains info about template creation and modification
"! $required
administrative_data type ty_administrative_data,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
end of ty_general_information.


" Email Template Body --------------------------------------------------------------------------------------------

types:

Check failure on line 56 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Template Content</p>
"! Holds the actual content of the email template.
begin of ty_template_content,
"! <p class="shorttext">Body HTML</p>
"! The HTML body content of the email template
body_html type string,
"! <p class="shorttext">Body Plain Text</p>
"! The plain text body content of the email template
body_plain_text type string,
end of ty_template_content.


" Email Template body options --------------------------------------------------------------------------------------------

Check failure on line 69 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Reduce line length to max 120, currently 124

https://rules.abaplint.org/line_length

types:

Check failure on line 71 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Template Language</p>
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
"! Language options for the template
begin of ty_template_language,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Language</p>
"! Language code
"! $required
country type string,
"! <p class="shorttext">HTML</p>
"! Indicates if HTML format is available
html type abap_bool,
"! <p class="shorttext">Plain</p>
"! Indicates if plain text is available
Plain type abap_bool,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
"! <p class="shorttext">Auto</p>
"! Indicates if automatic plain text update is enabled
Auto type abap_bool,
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved
end of ty_template_language.

"! <p class="shorttext">Languages</p>
"! List of available languages
types ty_temp_languages type standard table of ty_template_language with default key.

Check failure on line 92 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
Markus1812 marked this conversation as resolved.
Show resolved Hide resolved

types:

Check failure on line 94 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Input Field</p>
"! Input field
begin of ty_input_field,
"! <p class="shorttext">Name</p>
"! Name of the input field
"! $required
name type string,
"! <p class="shorttext">Text</p>
"! Text asscociated with the input field
"! $required
text type string,
end of ty_input_field.

"! <p class="shorttext">Input Fields</p>
"! List of all input fields
types ty_input_fields type standard table of ty_input_field with key name.

Check failure on line 110 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case

types:

Check failure on line 112 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Template Options</p>
"! Variants of the template content plus CDS input fields
begin of ty_content_options,
"! <p class="shorttext">Languages</p>
"! Available languages for the template
"! $required
languages type ty_temp_languages,
"! <p class="shorttext">Input Fields</p>
"! Input fields for the template from corresponding CDS view
input_fields type ty_input_fields,
end of ty_content_options.


" Main View --------------------------------------------------------------------------------------------------------

types:

Check failure on line 128 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "types"

https://rules.abaplint.org/keyword_case
"! <p class="shorttext">Demo Object Type SMTG</p>
"! Demo object type SMTG
begin of ty_main,

Check failure on line 131 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Type "TY_MAIN" contains unknown: SMTG_TMPL_NAME not found, lookup

https://rules.abaplint.org/unknown_types
"! <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,
"! <p class="shorttext">General Information</p>
"! General information
"! $required
general_information type ty_general_information,
"! <p class="shorttext">Options</p>
"! Options
"! $required
template_options type ty_content_options,
"! <p class="shorttext">Text</p>
"! Text
"! $required
template_content type ty_template_content,
end of ty_main.



endinterface.

Check failure on line 156 in file-formats/smtg/type/zob_aff_smtg_v1.intf.abap

View check run for this annotation

abaplint / abaplint

Keyword should be upper case: "endinterface"

https://rules.abaplint.org/keyword_case
7 changes: 7 additions & 0 deletions file-formats/smtg/type/zob_aff_smtg_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"formatVersion": "1",
"header": {
"description": "test email template file format",
"originalLanguage": "en"
}
}
Loading