
In this article, I will introduce a sample program for SAP BTP that manages both text and file information. This guide should prove useful for those new to SAP BTP, like myself. Previously I posted Extend Upload Set to Fiori Elements and utilize Document Management Service with minimum TypeScript implementation.
Recently SAP CAP team was implemented @cap-js/attachments plugin that provides out-of-box attachment files support with SAP Object Store service. We do not need TypeScript implementation above using this plugin.
It is quite convenient for us, but I had some trouble in deployment. I would like to note how can I resolve deployment trouble for my follower to prevent such pitfall.
screenshot of sample program
Sample code is hosted on a GitHub repository, and you are free to copy and experiment with it.
Note: Currently Object Store is available only in Free Tier environment, not in trial environment.
Note: I tested this on AWS subaccount. Maybe not working for other hyper scalers in current plugin version.
Most of steps are same as my instruction post Instruction of implement-test-deploy flow for SAPUI5 plus CAP integrated with another services. And it is not difficult for you to follow instruction of @cap-js/attachments plugin. Key differences are:
Deployment configuration is also similar to my previous artifacts.
In production (Cloud Foundry) environment, we will store file object to Object Store (this is Simple Storage Service, aka S3 in AWS). To do this, we will describe Object Store service instance and bind it to Node.js application in `mta.yaml` file.
One more thing to care is `package.json` CDS configuration. To connect to above service instance with CDS, I will write cds properties:
"cds": {
"requires": {
"kinds": {
"attachments-db": {
"impl": "@cap-js/attachments/lib/basic"
},
"attachments-s3": {
"impl": "@cap-js/attachments/lib/aws-s3"
}
},
"[production]":{
...,
"attachments": {
"kind": "s3",
"vcap": {
"name": "sap-sample-fiori-elements-uploadset-object-store"
}
}
}
}
}
After setup configuration has done, you can `mbt build` and `cf deploy` to deploy to Cloud Foundry. You can upload and download files in Fiori Elements like below.
Upload and donwload file
It is quite convenient even this plugin is still beta version for the moment, and this is what I am wanting for years to quickly implement program dealing both text and file. I highly expect GA version.
If you have any feedback, please post reply and discuss with me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |