Adding data for our SAP Cloud Application Programming Model service

Опубликовано: 02 Октябрь 2024
на канале: SAP Developers
2,247
48

We start out where we left off last time with our extended & related entities (see https://www.youtube.com/live/xolmwO02y1M) and take some steps to retrieve data and make it available for our two main entities. Everyone welcome, especially beginners to CAP!

Topics:
SAP API Business Hub, OData, JSON, XML, jq, yq, fq, Bash, CAP, CSV, SAP BTP, lf

Links:
This week's SAP Developer News https://groups.community.sap.com/t5/a...
SAP CodeJam Service Integration with SAP Cloud Application Programming Model (St Leon-Rot, DE) https://groups.community.sap.com/t5/s...
yq https://github.com/mikefarah/yq
jq https://stedolan.github.io/jq/
fq https://github.com/wader/fq
lf https://github.com/gokcehan/lf
Improving my interactive jq workflow with ijq, bash and tmux (explains zijq) https://qmacro.org/blog/posts/2023/04...

Chapters:
00:00 Welcome and introduction
04:00 Digging into the live stream episode JSON data to find out when the last episode was
06:10 Reminding ourselves of the details from we left off last time
08:24 Looking at the events in the "Hot Dev Summer" (05-08 July 2023)
14:00 Thinking about the API key, where we got it and where we're storing it (in .env)
15:25 Exploring the .env file contents carefully and without revealing the API key, via jq
19:10 Specifying the sandbox profile to see more info from cds env
20:40 Considering how we'd develop offline, with CSV data in a locally mocked service (instead of a remote connection)
23:00 Understanding the differences and similarities between mocked & remote systems
24:50 Describing what we're going to do (retrieve data from the API Hub based endpoint, convert to CSV, load as service data)
26:40 Retrieving all of the sandbox profile based remote system info, but hiding the API key data
28:10 Constructing an HTTP request to the remote system, with curl
30:40 Getting a spectacular response protocol.http.TooBigBody!
31:42 Adding the --compressed option to request (and parse) the response as zipped
31:55 Requesting the response in a different representation
32:15 Seeing what the OData service document looks like in JSON
34:49 Bringing in the sandbox CSV script mechanism
37:50 Examining the sandbox-csv Bash script
42:42 Filling the srv/external/data file with the CSV parsed from the JSON of the OData service
43:05 Considering the support and technical possibilities for different database systems for CAP services on Cloud Foundry on SAP BTP
46:30 Discovering an error with the production of the CSV header line, and fixing it (use keys_unsorted, not keys)
51:30 Viewing some JSON data of all the Hands-on SAP Dev live stream episodes
53:00 Extracting a CSV formatted version of that with ID, title and broadcast date
53:52 Sending that CSV data to the db/data file for the Episodes entity type
54:10 Encountering an error in the CSV data load which gives us some insight as to how it works
55:38 Working through the error to a successful conclusion, via a detour where we learned that 'when' is a reserved word in CDS!
58:22 Exploring the episode data, sorting it by broadcast date and time via an OData query on the CAP service
1:00:19 Looking forward to what we'll cover in the next episodes - learning about and building managed associations!