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

[SITO] File format for situation objects - New #380

Merged
merged 17 commits into from
Aug 25, 2022
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
2 changes: 1 addition & 1 deletion docs/json.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## JSON Files in ABAP File Formats
## JSON Files in ABAP File Formats .
schneidermic0 marked this conversation as resolved.
Show resolved Hide resolved
JSON files are central, since every ABAP object specifies at least a JSON file.
Depending on the object, there might be additional files containing source code or other information, but there is always a JSON file with the pattern `<object_name>.<object_type>.json`, see [`File Names`](./specification.md#File-Names).
For its annotation and validation the ABAP file formats provide JSON Schemas.
Expand Down
5 changes: 5 additions & 0 deletions file-formats/sito/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SITO File Format

File | Cardinality | Definition | Schema | Example
:--- | :--- | :--- | :--- | :---
`<name>.sito.json` | 1 | [`zif_aff_sito_v1.intf.abap`](./type/zif_aff_sito_v1.intf.abap) | [`sito-v1.json`](./sito-v1.json) | [`zmo_sito_test.sito.json`](./examples/zmo_sito_test.sito.json)
262 changes: 262 additions & 0 deletions file-formats/sito/examples/zmo_sito_test.sito.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
{
"formatVersion": "1",
"header": {
"description": "Flight (Demo Object)",
"originalLanguage": "en"
},
"situationObject": {
"scope": "sap",
"sapObjectType": "BusinessSituationDemoFlight",
"texts": [
{
"name": "Flight (Demo Object)",
"description": "The flight object is used in the demo scenario Flight Profitability (SITDEMO_FLIGHT_PROFITABILITY)."
}
],
"structures": [
{
"type": "cds",
"scope": "sap",
"name": "I_SITN2DEMOFLIGHT",
"sapObjectNodeType": "BusinessSituationDemoFlight",
"id": "SITDEMO_CDS_FLIGHT",
"texts": [
{
"description": "CDS view of flight (demo object)"
}
],
"semanticKeys": [
{
"fieldOrder": "02",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the field fieldOrder represent the order of semantic keys? This seems to be similar to the discussion of order of db table fields for indexes. There we take the approach to not specify an order field. The order is specified by the order of entries in the array.

Relates to #176

Copy link
Contributor

Choose a reason for hiding this comment

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

Field Order is used to set the order for the concatenation of keys for the semantic key. It is a critical information. If the explicit definition of the field order is removed and the order is just defined by the implicit order of the fields in the array, a user could miss the necessity/importance of that order. Without the explizit field order definition it just looks like an array of keys where the order does not matter!

"field": "SITNDEMOCONNECTIONID"
},
{
"fieldOrder": "03",
"field": "SITNDEMOFLIGHTDATE"
},
{
"fieldOrder": "01",
"field": "SITNDEMOCARRIERID"
}
],
"valueHelpMappings": [
{
"appType": "allApps",
"type": "service",
"scope": "sap",
"fieldName": "SITNDEMOCARRIERID"
},
{
"appType": "allApps",
"type": "service",
"scope": "sap",
"fieldName": "SITNDEMOPLANETYPE"
},
{
"appType": "allApps",
"type": "service",
"scope": "sap",
"fieldName": "SITNDEMOCARRIERREGION"
},
{
"appType": "allApps",
"type": "service",
"scope": "sap",
"fieldName": "SITNDEMOCONNECTIONID"
}
],
"services": [
{
"type": "allApps",
"fieldName": "SITNDEMOCARRIERID",
"entitySet": "C_Sitn2DemoFlightVH",
"property": "SitnDemoCarrierID",
"id": "SITDEMO_VH"
},
{
"type": "allApps",
"fieldName": "SITNDEMOPLANETYPE",
"entitySet": "C_Sitn2DemoFlightVH",
"property": "SitnDemoPlaneType",
"id": "SITDEMO_VH"
},
{
"type": "allApps",
"fieldName": "SITNDEMOCARRIERREGION",
"entitySet": "C_Sitn2DemoFlightVH",
"property": "SitnDemoRegionCode",
"id": "SITDEMO_VH"
},
{
"type": "allApps",
"fieldName": "SITNDEMOCONNECTIONID",
"entitySet": "C_Sitn2DemoFlightVH",
"property": "SitnDemoConnectionID",
"id": "SITDEMO_VH"
}
]
}
],
"endUserActions": [
{
"type": "callbackAction",
"scope": "sap",
"id": "SITDEMO_ACT_CANCEL_FLIGHT",
"texts": [
{
"name": "Cancel Flight",
"description": "Set flight status to unscheduled"
}
],
"callbacks": [
{
"id": "SITDEMO_CB_CANCEL_FLIGHT"
}
]
},
{
"type": "callbackAction",
"scope": "sap",
"id": "SITDEMO_ACT_CHANGE_PLANE",
"texts": [
{
"name": "Change Plane",
"description": "Assign another plane to the flight"
}
],
"callbacks": [
{
"id": "SITDEMO_CB_CHANGE_PLANE"
}
]
},
{
"type": "navigationAction",
"scope": "sap",
"id": "SITDEMO_ACT_MANAGE_AIRLINE",
"texts": [
{
"name": "Display Airline",
"description": "Show contact details"
}
],
"navigations": [
{
"id": "SITDEMO_NAV_MANAGE_AIRLINE"
schneidermic0 marked this conversation as resolved.
Show resolved Hide resolved
}
]
},
{
"type": "navigationAction",
"scope": "sap",
"id": "SITDEMO_ACT_MANAGE_FLIGHT",
"texts": [
{
"name": "Manage Flight",
"description": "Maintain bookings and flight details"
}
],
"navigations": [
{
"id": "SITDEMO_NAV_MANAGE_FLIGHT"
}
]
}
],
"navigations": [
{
"scope": "sap",
"id": "SITDEMO_NAV_MANAGE_FLIGHT",
"semanticObjectAction": "maintain",
"semanticObject": "SituationDemoFlight",
"parameters": [
{
"name": "SitnDemoCarrierID"
},
{
"name": "SitnDemoConnectionID"
},
{
"name": "SitnDemoFlightDate"
}
]
},
{
"scope": "sap",
"id": "SITDEMO_NAV_MANAGE_AIRLINE",
"semanticObjectAction": "maintain",
"semanticObject": "SituationDemoFlight",
"parameters": [
{
"name": "SitnDemoCarrierID"
}
]
}
],
"callbacks": [
{
"scope": "sap",
"className": "CL_SIT2_DEMO_CB_CHANGE_PLANE",
"id": "SITDEMO_CB_CHANGE_PLANE",
"parameters": [
{
"name": "CARRID"
},
{
"name": "PLANETYPE"
},
{
"name": "CONNID"
},
{
"name": "FLDATE"
}
]
},
{
"scope": "sap",
"className": "CL_SIT2_DEMO_CB_CANCEL_FLIGHT",
"id": "SITDEMO_CB_CANCEL_FLIGHT",
"parameters": [
{
"name": "CARRID"
},
{
"name": "CONNID"
},
{
"name": "FLDATE"
}
]
}
],
"valueHelpServices": [
{
"version": "0001",
"protocolVersion": "v2",
"pathType": "standard",
"scope": "sap",
"binding": "C_SITN2DEMOFLIGHTVH_CDS",
"id": "SITDEMO_VH",
"valueHelpServiceProviders": [
{
"property": "SitnDemoCarrierID",
"entitySet": "C_Sitn2DemoFlightVH"
},
{
"property": "SitnDemoConnectionID",
"entitySet": "C_Sitn2DemoFlightVH"
},
{
"property": "SitnDemoPlaneType",
"entitySet": "C_Sitn2DemoFlightVH"
},
{
"property": "SitnDemoRegionCode",
"entitySet": "C_Sitn2DemoFlightVH"
}
]
}
]
}
}
Loading