The Common Data Model (CDM) includes business content from various SAP products all integrated in a unified manner in one site. It contains definitions of entities such as roles, spaces, apps, pages, groups, and catalogs and their relationships. For this tutorial we will be using the role and card entities.
-
Click on the manifest.json file. Everything needed to render the content package is described in this file. Copy the following code snippet and add it to the manifest.json file:
"i18n": "i18n/i18n.properties",
"icon": "sap-icon://accept",
"title": "{{PACKAGE_TITLE}}",
"subTitle": "{{PACKAGE_SUBTITLE}}",
"shortTitle": "{{PACKAGE_SHORTTITLE}}",
"info": "{{PACKAGE_INFO}}",
"description": "{{PACKAGE_DESCRIPTION}}",
A content package must contain at least one role as well as the card that it will be assigned to so that it can be deployed to SAP Build Work Zone, standard edition.
-
We will first add a descriptor (in the Common Data Model format) that describes the content of this content package - in this case the content is the card and the role. We will later add a card and a role to the Content Package.
In the content.json file, replace the existing code with the following code:
{
"sample-role1": {
"type": "role",
"src": {
"from": "./demo/src",
"content": "role.json"
}
},
"card-sample": {
"type": "card",
"src": {
"from": "./demo/src",
"path": "./",
"build": "",
"package": "",
"manifest": "src/manifest.json"
}
}
}
We’ve added a descriptor of the role and card. Now we’ll create the respective card and role files in our content package.
-
Create a new folder under the workspace by right clicking on the project cp_erp and select New Folder.
-
Name the new folder demo. This folder will contain the necessary role and UI integration card code.
-
Right click on the demo folder and then select New Folder and name the new folder src.
-
Right click on the scr folder and select New File - name it role.json. This file will contain the role. Do this again and call the second file manifest.json. The manifest.json file will contain the code of the card.
Note that this manifest.json file is for the card. The other manifest.json file at the bottom of the structure is for the content package.
-
Last, copy the i18n (Internationalization) folder into the src folder, otherwise the build will fail.
The folder structure should now look like this:
The workspace structure is ready, and now you can populate the json files.
-
Copy and paste the following code into the role.json file:
{
"_version": "3.2.0",
"identification": {
"id": "ns.cp_erp_ns.mycontentpackage.sm",
"title": "ContentPackageRole",
"entityType": "role"
},
"payload": {
"apps": [
{
"id": "ns.products_by_category_card.app"
}
]
}
}
-
Now copy and paste the UI integration card code that you created in this tutorial: Create a UI5 Integration Card that Displays Data from the SAP Gateway Demo System into the manifest.json file
Note if you chose to skip doing the above tutorial, you can simply copy the code from the end of Step 5. Under Results after Step 5, in the first sentence, there’s a link to the manifest.json file that you need to copy and paste it here.