├── .gitignore ├── .reuse └── dep5 ├── LICENSE ├── LICENSES └── Apache-2.0.txt ├── README.md ├── cap-cql-examples ├── .cdsrc.json ├── .gitignore ├── README.md ├── db │ ├── data │ │ ├── cap.cql.db-AssocMItems.csv │ │ ├── cap.cql.db-AssocSItems.csv │ │ ├── cap.cql.db-CompMItems.csv │ │ ├── cap.cql.db-CompSItems.csv │ │ ├── cap.cql.db-Roots.csv │ │ └── cap.cql.db-Roots2.csv │ └── schema.cds ├── package.json └── srv │ ├── service.cds │ └── service.js ├── cap-dpp-example ├── .cdsrc.json ├── .gitignore ├── .npmrc ├── README.md ├── app │ ├── approuter │ │ ├── package.json │ │ ├── resources │ │ │ ├── appconfig │ │ │ │ └── fioriSandboxConfig.json │ │ │ └── index.html │ │ └── xs-app.json │ ├── customers │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5-deploy.yaml │ │ ├── ui5.yaml │ │ ├── webapp │ │ │ ├── Component.js │ │ │ ├── annotations │ │ │ │ └── annotation.xml │ │ │ ├── i18n │ │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ │ └── metadata.xml │ │ │ ├── manifest.json │ │ │ └── test │ │ │ │ ├── flpSandbox.html │ │ │ │ ├── integration │ │ │ │ ├── FirstJourney.js │ │ │ │ ├── opaTests.qunit.html │ │ │ │ ├── opaTests.qunit.js │ │ │ │ └── pages │ │ │ │ │ ├── AddressesObjectPage.js │ │ │ │ │ ├── CustomersList.js │ │ │ │ │ └── CustomersObjectPage.js │ │ │ │ ├── testsuite.qunit.html │ │ │ │ └── testsuite.qunit.js │ │ └── xs-app.json │ ├── orders │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5-deploy.yaml │ │ ├── ui5.yaml │ │ ├── webapp │ │ │ ├── Component.js │ │ │ ├── annotations │ │ │ │ └── annotation.xml │ │ │ ├── i18n │ │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ │ └── metadata.xml │ │ │ ├── manifest.json │ │ │ └── test │ │ │ │ ├── flpSandbox.html │ │ │ │ ├── integration │ │ │ │ ├── FirstJourney.js │ │ │ │ ├── opaTests.qunit.html │ │ │ │ ├── opaTests.qunit.js │ │ │ │ └── pages │ │ │ │ │ ├── OrderItemsObjectPage.js │ │ │ │ │ ├── OrdersList.js │ │ │ │ │ └── OrdersObjectPage.js │ │ │ │ ├── testsuite.qunit.html │ │ │ │ └── testsuite.qunit.js │ │ └── xs-app.json │ └── services.cds ├── config │ ├── pdm-config.json │ ├── pdm-security-config.json │ └── xs-security.json ├── db │ ├── data │ │ ├── sap.cap.dpp-AddressTypes.csv │ │ ├── sap.cap.dpp-Addresses.csv │ │ ├── sap.cap.dpp-Customers.csv │ │ ├── sap.cap.dpp-EmailAddresses.csv │ │ ├── sap.cap.dpp-EmailTypes.csv │ │ ├── sap.cap.dpp-Games.csv │ │ ├── sap.common-Countries.csv │ │ └── sap.common-Currencies.csv │ ├── schema.cds │ ├── src │ │ └── .hdiconfig │ └── undeploy.json ├── mta.yaml ├── package.json └── srv │ ├── admin-capbilities.cds │ ├── admin-service.cds │ ├── admin-service.js │ ├── catalog-capabilities.cds │ ├── catalog-service.cds │ ├── catalog-service.js │ ├── pdm-capabilities.cds │ └── pdm-service.cds ├── cap-fe-lr-op-actions ├── .cdsrc.json ├── .eslintrc ├── .gitignore ├── README.md ├── app │ ├── services.cds │ └── ui01 │ │ ├── README.md │ │ ├── annotations │ │ ├── action-varieties.cds │ │ ├── annotations.cds │ │ ├── chart-actions.cds │ │ ├── fieldgroup-actions.cds │ │ ├── generic-actions.cds │ │ ├── global-determining-actions.cds │ │ └── table-actions.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ ├── Component.js │ │ ├── i18n │ │ └── i18n.properties │ │ ├── index.html │ │ ├── localService │ │ └── metadata.xml │ │ ├── manifest.json │ │ └── test │ │ ├── flpSandbox.html │ │ ├── integration │ │ ├── FirstJourney.js │ │ ├── opaTests.qunit.html │ │ ├── opaTests.qunit.js │ │ └── pages │ │ │ ├── RootsList.js │ │ │ └── RootsObjectPage.js │ │ ├── testsuite.qunit.html │ │ └── testsuite.qunit.js ├── db │ ├── data │ │ ├── cap.fe.lr.op.actions.db-Categories.csv │ │ ├── cap.fe.lr.op.actions.db-Criticalities.csv │ │ ├── cap.fe.lr.op.actions.db-Items.csv │ │ ├── cap.fe.lr.op.actions.db-Roots.csv │ │ └── cap.fe.lr.op.actions.db-Samples.csv │ └── schema.cds ├── package.json └── srv │ ├── annotations.cds │ ├── service.cds │ └── service.js ├── cap-fe-lr-table-views ├── .cdsrc.json ├── .eslintrc ├── .gitignore ├── README.md ├── app │ ├── services.cds │ ├── ui01 │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ │ ├── Component.js │ │ │ ├── i18n │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ └── metadata.xml │ │ │ ├── manifest.json │ │ │ └── test │ │ │ ├── flpSandbox.html │ │ │ ├── integration │ │ │ ├── FirstJourney.js │ │ │ ├── opaTests.qunit.html │ │ │ ├── opaTests.qunit.js │ │ │ └── pages │ │ │ │ ├── OrdersList.js │ │ │ │ └── OrdersObjectPage.js │ │ │ ├── testsuite.qunit.html │ │ │ └── testsuite.qunit.js │ ├── ui02 │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ │ ├── Component.js │ │ │ ├── i18n │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ └── metadata.xml │ │ │ ├── manifest.json │ │ │ └── test │ │ │ ├── flpSandbox.html │ │ │ ├── integration │ │ │ ├── FirstJourney.js │ │ │ ├── opaTests.qunit.html │ │ │ ├── opaTests.qunit.js │ │ │ └── pages │ │ │ │ ├── OrderItemsObjectPage.js │ │ │ │ ├── OrdersList.js │ │ │ │ └── OrdersObjectPage.js │ │ │ ├── testsuite.qunit.html │ │ │ └── testsuite.qunit.js │ ├── ui03 │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ │ ├── Component.js │ │ │ ├── i18n │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ └── metadata.xml │ │ │ ├── manifest.json │ │ │ └── test │ │ │ ├── flpSandbox.html │ │ │ ├── integration │ │ │ ├── FirstJourney.js │ │ │ ├── opaTests.qunit.html │ │ │ ├── opaTests.qunit.js │ │ │ └── pages │ │ │ │ ├── OrdersList.js │ │ │ │ └── OrdersObjectPage.js │ │ │ ├── testsuite.qunit.html │ │ │ └── testsuite.qunit.js │ ├── ui04 │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ │ ├── Component.js │ │ │ ├── i18n │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ └── metadata.xml │ │ │ ├── manifest.json │ │ │ └── test │ │ │ ├── flpSandbox.html │ │ │ ├── integration │ │ │ ├── FirstJourney.js │ │ │ ├── opaTests.qunit.html │ │ │ ├── opaTests.qunit.js │ │ │ └── pages │ │ │ │ ├── OrdersList.js │ │ │ │ └── OrdersObjectPage.js │ │ │ ├── testsuite.qunit.html │ │ │ └── testsuite.qunit.js │ └── ui05 │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ ├── Component.js │ │ ├── i18n │ │ └── i18n.properties │ │ ├── index.html │ │ ├── localService │ │ └── metadata.xml │ │ ├── manifest.json │ │ └── test │ │ ├── flpSandbox.html │ │ ├── integration │ │ ├── FirstJourney.js │ │ ├── opaTests.qunit.html │ │ ├── opaTests.qunit.js │ │ └── pages │ │ │ ├── OrdersList.js │ │ │ └── OrdersObjectPage.js │ │ ├── testsuite.qunit.html │ │ └── testsuite.qunit.js ├── db │ ├── data │ │ ├── cap.fe.lr.table.views.db-Customers.csv │ │ ├── cap.fe.lr.table.views.db-OrderItems.csv │ │ ├── cap.fe.lr.table.views.db-OrderTypes.csv │ │ ├── cap.fe.lr.table.views.db-Orders.csv │ │ └── cap.fe.lr.table.views.db-Products.csv │ └── schema.cds ├── package-lock.json ├── package.json └── srv │ ├── annotations.cds │ └── service.cds ├── cap-fe-se-ca-de ├── .cdsrc.json ├── .gitignore ├── README.md ├── app │ ├── customers │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ │ ├── Component.js │ │ │ ├── annotations │ │ │ └── annotation.xml │ │ │ ├── i18n │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ └── metadata.xml │ │ │ └── manifest.json │ ├── orders │ │ ├── README.md │ │ ├── annotations.cds │ │ ├── annotations_ca_de.cds │ │ ├── annotations_se.cds │ │ ├── package.json │ │ ├── ui5.yaml │ │ └── webapp │ │ │ ├── Component.js │ │ │ ├── annotations │ │ │ └── annotation.xml │ │ │ ├── css │ │ │ └── custom.css │ │ │ ├── i18n │ │ │ ├── customI18n.properties │ │ │ └── i18n.properties │ │ │ ├── index.html │ │ │ ├── localService │ │ │ └── metadata.xml │ │ │ └── manifest.json │ └── services.cds ├── db │ ├── data │ │ ├── cap.fe.se.ca.de.db-Industries.csv │ │ ├── cap.fe.se.ca.de.db-Products.csv │ │ ├── sap.common-Currencies.csv │ │ └── sap.common-Currencies.texts.csv │ └── schema.cds ├── package.json └── srv │ ├── capabilities.cds │ ├── service.cds │ └── service.js ├── cap-media-malware ├── .cdsrc.json ├── .gitignore ├── .npmrc ├── README.md ├── db │ ├── schema.cds │ ├── src │ │ └── .hdiconfig │ └── undeploy.json ├── mta.yaml ├── package-lock.json ├── package.json ├── srv │ ├── resources │ │ ├── api-clients │ │ │ └── MalwareScanAPI │ │ │ │ ├── default-api.d.ts │ │ │ │ ├── default-api.d.ts.map │ │ │ │ ├── default-api.js │ │ │ │ ├── default-api.js.map │ │ │ │ ├── default-api.ts │ │ │ │ ├── index.d.ts │ │ │ │ ├── index.d.ts.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── index.ts │ │ │ │ ├── schema │ │ │ │ ├── index.d.ts │ │ │ │ ├── index.d.ts.map │ │ │ │ ├── index.js │ │ │ │ ├── index.js.map │ │ │ │ ├── index.ts │ │ │ │ ├── return-message.d.ts │ │ │ │ ├── return-message.d.ts.map │ │ │ │ ├── return-message.js │ │ │ │ ├── return-message.js.map │ │ │ │ ├── return-message.ts │ │ │ │ ├── scan-result.d.ts │ │ │ │ ├── scan-result.d.ts.map │ │ │ │ ├── scan-result.js │ │ │ │ ├── scan-result.js.map │ │ │ │ ├── scan-result.ts │ │ │ │ ├── status.d.ts │ │ │ │ ├── status.d.ts.map │ │ │ │ ├── status.js │ │ │ │ ├── status.js.map │ │ │ │ └── status.ts │ │ │ │ └── tsconfig.json │ │ └── api-specs │ │ │ └── MalwareScanAPI.json │ ├── service.cds │ └── test.txt ├── test.http └── xs-security.json ├── cap_resilient_timeout ├── .cdsrc.json ├── .eslintrc ├── .gitignore ├── README.md ├── app │ └── router │ │ ├── package-lock.json │ │ ├── package.json │ │ └── xs-app.json ├── db │ ├── src │ │ └── .hdiconfig │ └── undeploy.json ├── package-lock.json ├── package.json ├── resilience-plugin │ ├── cds-plugin.js │ ├── package.json │ └── resilience_timeout.js ├── srv │ ├── service.cds │ └── service.js ├── test.http └── xs-security.json └── others ├── Actions_Ticket_Process.xlsx ├── BusinessRules_ServiceTicketConfigurations.zip └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: btp-cap-demo-usecases 3 | Upstream-Contact: ospo@sap.com 4 | Source: https://github.com/sap-samples/btp-cap-demo-usecases 5 | Disclaimer: The code in this project may include calls to APIs ("API Calls") of 6 | SAP or third-party products or services developed outside of this project 7 | ("External Products"). 8 | "APIs" means application programming interfaces, as well as their respective 9 | specifications and implementing code that allows software to communicate with 10 | other software. 11 | API Calls to External Products are not licensed under the open source license 12 | that governs this project. The use of such API Calls and related External 13 | Products are subject to applicable additional agreements with the relevant 14 | provider of the External Products. In no event shall the open source license 15 | that governs this project grant any rights in or to any External Products,or 16 | alter, expand or supersede any terms of the applicable additional agreements. 17 | If you have a valid license agreement with SAP for the use of a particular SAP 18 | External Product, then you may make use of any API Calls included in this 19 | project's code for that SAP External Product, subject to the terms of such 20 | license agreement. If you do not have a valid license agreement for the use of 21 | a particular SAP External Product, then you may only make use of any API Calls 22 | in this project for that SAP External Product for your internal, non-productive 23 | and non-commercial test and evaluation of such API Calls. Nothing herein grants 24 | you any rights to use or access any SAP External Product, or provide any third 25 | parties the right to use of access any SAP External Product, through API Calls. 26 | 27 | Files: *.* 28 | Copyright: 2025 SAP SE or an SAP affiliate company and btp-cap-demo-usecases contributors 29 | License: Apache-2.0 30 | 31 | -------------------------------------------------------------------------------- /cap-cql-examples/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cap-cql-examples/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-cql-examples 2 | _out 3 | *.db 4 | *.sqlite 5 | connection.properties 6 | default-*.json 7 | .cdsrc-private.json 8 | gen/ 9 | node_modules/ 10 | target/ 11 | 12 | # Web IDE, App Studio 13 | .che/ 14 | .gen/ 15 | 16 | # MTA 17 | *_mta_build_tmp 18 | *.mtar 19 | mta_archives/ 20 | 21 | # Other 22 | .DS_Store 23 | *.orig 24 | *.log 25 | 26 | *.iml 27 | *.flattened-pom.xml 28 | 29 | # IDEs 30 | .vscode/ 31 | # .idea 32 | -------------------------------------------------------------------------------- /cap-cql-examples/db/data/cap.cql.db-AssocMItems.csv: -------------------------------------------------------------------------------- 1 | ID;asm_sfield;asm_nfield;root_ID 2 | e49f8fc4-7f73-4ae3-bedc-3327314b20b8;asm string 1;1001;7891fd0d-5924-471a-89c4-519f7df071b8 3 | 8240eeb0-e39e-4b64-960f-61609a3a6de9;asm string 2;1002;e2673f1c-21bc-40a8-bc8b-d626459cdebd 4 | 9af32bc8-dfb3-4cb8-a092-0756b55b06bf;asm string 3;1003;f11aacb1-ab35-40da-918b-589cdd387ad1 5 | 9a118230-9ca9-4b06-9a1b-9a5b411c4ffe;asm string 4;1004;445b1357-90b2-4a2c-a60d-7f7e40d46f12 6 | 5b8e697b-f722-4db2-abaa-5ea3249fc568;asm string 5;1005;38a13fed-f2d1-45bd-91ec-642053889c92 7 | 3d3422ca-917c-4a4c-bafc-6da50a5c4886;asm string 6;1006;7891fd0d-5924-471a-89c4-519f7df071b8 8 | 3b2a6717-fcd0-497d-976f-d92d686c04f1;asm string 7;1007;e2673f1c-21bc-40a8-bc8b-d626459cdebd 9 | 29c14c36-4559-47fc-b213-e7d00fb58f3f;asm string 8;1008;f11aacb1-ab35-40da-918b-589cdd387ad1 10 | 843d3257-ec12-47ad-b3db-c82c2a346a5a;asm string 9;1009;445b1357-90b2-4a2c-a60d-7f7e40d46f12 11 | 110f6a9f-b647-4e63-bdb2-03ec724d0d2b;asm string 10;1010;38a13fed-f2d1-45bd-91ec-642053889c92 12 | 71bd1b1d-ca9c-403e-b435-99e58e8373c0;asm string 11;1011;7891fd0d-5924-471a-89c4-519f7df071b8 13 | 2f101352-bccf-4c3d-9c61-b2f9aa27606c;asm string 12;1012;e2673f1c-21bc-40a8-bc8b-d626459cdebd 14 | 8e140467-62e7-4526-9854-85666f47d287;asm string 13;1013;7891fd0d-5924-471a-89c4-519f7df071b8 15 | c90453e8-8449-438a-bec3-0bbdcad9f2a9;asm string 14;1014;7891fd0d-5924-471a-89c4-519f7df071b8 16 | a70af58f-9e8d-4dc6-8ac8-1c3162159cba;asm string 15;1015;e2673f1c-21bc-40a8-bc8b-d626459cdebd -------------------------------------------------------------------------------- /cap-cql-examples/db/data/cap.cql.db-AssocSItems.csv: -------------------------------------------------------------------------------- 1 | ID;asi_sfield;asi_nfield 2 | 585dee53-69e5-47d9-b90d-945253d4af0d;asi string 1;100 3 | 53f11b2e-8a23-4499-82c4-4c31ada8a738;asi string 2;200 -------------------------------------------------------------------------------- /cap-cql-examples/db/data/cap.cql.db-CompMItems.csv: -------------------------------------------------------------------------------- 1 | ID;csm_sfield;csm_nfield;root_ID 2 | a683be64-551e-42c2-b341-e12a93094567;csm string 1;2001;7891fd0d-5924-471a-89c4-519f7df071b8 3 | d0ba8693-8be4-4673-9027-edc90a260a31;csm string 2;2002;e2673f1c-21bc-40a8-bc8b-d626459cdebd 4 | 7c5ee229-872f-4108-889d-6f7a8164f4f5;csm string 3;2003;f11aacb1-ab35-40da-918b-589cdd387ad1 5 | 31ed22d8-6721-4710-9da5-f3edbcdcf2a7;csm string 4;2004;445b1357-90b2-4a2c-a60d-7f7e40d46f12 6 | bd33dc0a-53d7-4e0d-bac4-bc64d4446514;" csm string 5";2005;38a13fed-f2d1-45bd-91ec-642053889c92 7 | 0b46fc95-d19a-4286-977e-7a9ecd8005eb;csm string 6;2006;7891fd0d-5924-471a-89c4-519f7df071b8 8 | e8c8ccf3-9874-4257-9f55-c7667aeac895;csm string 7;2007;e2673f1c-21bc-40a8-bc8b-d626459cdebd 9 | 68c34b49-04de-474c-b2b9-aa98010e8570;csm string 8;2008;f11aacb1-ab35-40da-918b-589cdd387ad1 10 | 6ac89791-f745-46c4-b0a7-714bdd073d6d;csm string 9;2009;445b1357-90b2-4a2c-a60d-7f7e40d46f12 11 | d950576b-2840-4d43-8efb-d1994b0ced79;csm string 10;2010;38a13fed-f2d1-45bd-91ec-642053889c92 12 | 429672fd-7552-4883-b7c3-a8364ce9eb51;csm string 11;2011;7891fd0d-5924-471a-89c4-519f7df071b8 13 | 9a08eb17-d026-4a14-af0a-2460ff633d89;csm string 12;2012;e2673f1c-21bc-40a8-bc8b-d626459cdebd 14 | b9d547a0-4b3a-463c-8f3a-f82446a8129e;csm string 13;2013;7891fd0d-5924-471a-89c4-519f7df071b8 15 | 0db2e759-0896-42ea-bea3-ebe814eba784;csm string 14;2014;7891fd0d-5924-471a-89c4-519f7df071b8 16 | 562f1af6-97f7-49da-9f30-30ab47ba0bf8;csm string 15;2015;e2673f1c-21bc-40a8-bc8b-d626459cdebd 17 | c8571bfd-3161-4c83-9692-e2d5561a70bf;csm string 16;2016;7891fd0d-5924-471a-89c4-519f7df071b8 18 | ec6504e8-0112-46d0-b75e-9ea7cf8890f3;csm string 17;2017;e2673f1c-21bc-40a8-bc8b-d626459cdebd -------------------------------------------------------------------------------- /cap-cql-examples/db/data/cap.cql.db-CompSItems.csv: -------------------------------------------------------------------------------- 1 | ID;csi_sfield;csi_nfield 2 | 5a772f50-948a-4449-a5f0-19b9abc5a376;csi string 3;300 3 | 6d920b25-a1cd-4dcb-af2b-2ccbee48dcbf;csi string 4;400 4 | 5917b521-a654-4351-bd93-ddac35c314e7;csi string 5;500 5 | a5f9e89c-7b0e-4996-8092-87c3796f1589;csi string 6;600 6 | 7ab7fe97-581d-489b-89e2-a22515da3946;csi string 7;700 -------------------------------------------------------------------------------- /cap-cql-examples/db/data/cap.cql.db-Roots.csv: -------------------------------------------------------------------------------- 1 | ID;name;descr;dfield;tfield;dtfield;tsfield;nfield;afield;asitem_ID;csitem_ID;category 2 | 7891fd0d-5924-471a-89c4-519f7df071b8;root 1;descr 1;2022-10-01;10:20:00;2022-10-01T10:20:00Z;2022-10-01T10:20:00.123Z;123;199060.230120;585dee53-69e5-47d9-b90d-945253d4af0d;5a772f50-948a-4449-a5f0-19b9abc5a376;rc1 3 | e2673f1c-21bc-40a8-bc8b-d626459cdebd;root 2;descr 2;2022-03-15;15:08:59;2022-03-15T15:08:59Z;2022-03-15T15:08:59.290Z;456;299345.451028;585dee53-69e5-47d9-b90d-945253d4af0d;6d920b25-a1cd-4dcb-af2b-2ccbee48dcbf;rc1 4 | f11aacb1-ab35-40da-918b-589cdd387ad1;root 3;descr 3;2023-02-20;20:20:20;2023-02-20T20:20:20Z;2023-02-20T20:20:20.422Z;789;456120.343434;585dee53-69e5-47d9-b90d-945253d4af0d;5917b521-a654-4351-bd93-ddac35c314e7;rc2 5 | 445b1357-90b2-4a2c-a60d-7f7e40d46f12;root 4;descr 4;2022-12-01;12:14:01;2022-12-01T12:14:01Z;2022-12-01T12:14:01.200Z;1000;8120000.120080;53f11b2e-8a23-4499-82c4-4c31ada8a738;a5f9e89c-7b0e-4996-8092-87c3796f1589;rc3 6 | 38a13fed-f2d1-45bd-91ec-642053889c92;root 5;descr 5;2022-02-11;04:08:29;2022-02-11T04:08:29Z;2022-02-11T04:08:29.129Z;200;23891100.123456;53f11b2e-8a23-4499-82c4-4c31ada8a738;7ab7fe97-581d-489b-89e2-a22515da3946;rc3 -------------------------------------------------------------------------------- /cap-cql-examples/db/data/cap.cql.db-Roots2.csv: -------------------------------------------------------------------------------- 1 | first;second;name;descr 2 | 101;201;r2 name1;r2 descr1 3 | 102;202;r2 name2;r2 descr2 -------------------------------------------------------------------------------- /cap-cql-examples/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace cap.cql.db; 2 | 3 | using {cuid} from '@sap/cds/common'; 4 | 5 | 6 | entity Roots : cuid { 7 | name : String(20); 8 | descr : String(100); 9 | dfield : Date; 10 | tfield : Time; 11 | dtfield : DateTime; 12 | tsfield : Timestamp; 13 | nfield : Integer; 14 | afield : Decimal(20, 6); 15 | asitem : Association to one AssocSItems; 16 | amitems : Association to many AssocMItems 17 | on amitems.root = $self; 18 | csitem : Composition of one CompSItems; 19 | cmitems : Composition of many CompMItems 20 | on cmitems.root = $self; 21 | category: String(10); 22 | } 23 | 24 | entity AssocSItems : cuid { 25 | asi_sfield : String(20); 26 | asi_nfield : Integer; 27 | } 28 | 29 | entity AssocMItems : cuid { 30 | asm_sfield : String(20); 31 | asm_nfield : Integer; 32 | root : Association to one Roots; 33 | } 34 | 35 | entity CompSItems : cuid { 36 | csi_sfield : String(20); 37 | csi_nfield : Integer; 38 | } 39 | 40 | entity CompMItems : cuid { 41 | csm_sfield : String(20); 42 | csm_nfield : Integer; 43 | root : Association to one Roots; 44 | } 45 | 46 | entity Roots2 { 47 | key first : Integer; 48 | key second : Integer; 49 | name : String(20); 50 | descr : String(100); 51 | } 52 | -------------------------------------------------------------------------------- /cap-cql-examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cap-cql-examples", 3 | "version": "1.0.0", 4 | "description": "A simple CAP project.", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@sap/cds": "^6", 10 | "express": "^4", 11 | "hdb": "^0.19.0" 12 | }, 13 | "devDependencies": { 14 | "sqlite3": "^5.0.4" 15 | }, 16 | "scripts": { 17 | "start": "cds run", 18 | "build": "rimraf resources mta_archives && mbt build --mtar archive", 19 | "deploy": "cf deploy mta_archives/archive.mtar --retries 1", 20 | "undeploy":"cf undeploy cap-cql-examples --delete-services --delete-service-keys --delete-service-brokers" 21 | }, 22 | "engines": { 23 | "node": "^16.15" 24 | }, 25 | "eslintConfig": { 26 | "extends": "eslint:recommended", 27 | "env": { 28 | "es2020": true, 29 | "node": true, 30 | "jest": true, 31 | "mocha": true 32 | }, 33 | "globals": { 34 | "SELECT": true, 35 | "INSERT": true, 36 | "UPDATE": true, 37 | "DELETE": true, 38 | "CREATE": true, 39 | "DROP": true, 40 | "CDL": true, 41 | "CQL": true, 42 | "CXL": true, 43 | "cds": true 44 | }, 45 | "rules": { 46 | "no-console": "off", 47 | "require-atomic-updates": "off" 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /cap-cql-examples/srv/service.cds: -------------------------------------------------------------------------------- 1 | using {cap.cql.db as db} from '../db/schema'; 2 | 3 | service CQLService { 4 | 5 | entity Roots as projection on db.Roots; 6 | entity AssocSItems as projection on db.AssocSItems; 7 | entity AssocMItems as projection on db.AssocMItems; 8 | entity CompSItems as projection on db.CompSItems; 9 | entity CompMItems as projection on db.CompMItems; 10 | entity Roots2 as projection on db.Roots2; 11 | 12 | function testCQLExamples() returns String(100); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /cap-cql-examples/srv/service.js: -------------------------------------------------------------------------------- 1 | const cds = require("@sap/cds"); 2 | module.exports = cds.service.impl(async function (srv) { 3 | 4 | const { Roots, Roots2 } = cds.entities; 5 | 6 | srv.on('testCQLExamples', async (req) => { 7 | let result; 8 | result = await SELECT.from(Roots).columns('name',`asitem.asi_sfield`) 9 | console.log(result); 10 | return 'It Works!!' 11 | }); 12 | 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /cap-dpp-example/.cdsrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "target": "dbsrv-build" 4 | } 5 | } -------------------------------------------------------------------------------- /cap-dpp-example/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-dpp-example 2 | _out 3 | *.db 4 | connection.properties 5 | default-*.json 6 | .cdsrc-private.json 7 | gen/ 8 | node_modules/ 9 | target/ 10 | 11 | # Web IDE, App Studio 12 | .che/ 13 | .gen/ 14 | 15 | # MTA 16 | *_mta_build_tmp 17 | *.mtar 18 | mta_archives/ 19 | 20 | # Other 21 | .DS_Store 22 | *.orig 23 | *.log 24 | 25 | *.iml 26 | *.flattened-pom.xml 27 | 28 | # IDEs 29 | .vscode 30 | # .idea 31 | app/orders/dist/ 32 | dbsrv-build/ 33 | app-build/ 34 | app/customers/dist/ 35 | config-backup/ 36 | package-lock.json 37 | -------------------------------------------------------------------------------- /cap-dpp-example/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.com -------------------------------------------------------------------------------- /cap-dpp-example/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository is an showcase for CAP application integration with Data Privacy and Protection services like Personal Data Manager Service on BTP. For more info please visit the following series of Blogs. 4 | 5 | - [Part1: DPP Terminologies and PDM Overview](https://blogs.sap.com/2023/03/18/sapcap-win-customer-trust-using-data-privacy-and-protection-services-on-btp-part-1/) 6 | - [Part2: Personal Data Annotations in CAP and Integration with PDM](https://blogs.sap.com/2023/03/18/sapcap-win-customer-trust-using-data-privacy-and-protection-services-on-btp-part-2/) 7 | - [Part3: Explore PDM Application features](https://blogs.sap.com/2023/03/18/sapcap-win-customer-trust-using-data-privacy-and-protection-services-on-btp-part-3/) 8 | 9 | 10 | 11 | ## Getting Started 12 | 13 | File or Folder | Purpose 14 | ---------|---------- 15 | `app/` | This has 2 UI frontends i.e. Customers and Orders and contains approuter 16 | `db/` | Data model is defined in schema.cds 17 | `srv/` | Services are defined in service.cds 18 | `package.json` | project metadata and configuration 19 | `config/` | Contains config for security and Personal Data manager (PDM) 20 | 21 | 22 | ## Next Steps 23 | 24 | - Follow steps provided in series of blogs mentioned above. 25 | 26 | 27 | ## Learn More / Resources 28 | 29 | Learn more at https://cap.cloud.sap/docs/get-started/. 30 | 31 | -------------------------------------------------------------------------------- /cap-dpp-example/app/approuter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "approuter", 3 | "dependencies": { 4 | "@sap/approuter": "^11.0.0" 5 | }, 6 | "engines": { 7 | "node": "^16" 8 | }, 9 | "scripts": { 10 | "start": "node node_modules/@sap/approuter/approuter.js" 11 | } 12 | } -------------------------------------------------------------------------------- /cap-dpp-example/app/approuter/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Game Shop 9 | 10 | 16 | 17 | 18 | 24 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /cap-dpp-example/app/approuter/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/resources/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "^/resources/(.*)$", 7 | "target": "/$1", 8 | "localDir": "resources", 9 | "authenticationType": "xsuaa" 10 | }, 11 | { 12 | "source": "^/appconfig/(.*)$", 13 | "target": "/appconfig/$1", 14 | "localDir": "resources", 15 | "authenticationType": "xsuaa" 16 | }, 17 | { 18 | "source": "^/sapcapdppappcustomers/(.*)$", 19 | "target": "/sapcapdppappcustomers/$1", 20 | "service": "html5-apps-repo-rt", 21 | "authenticationType": "xsuaa" 22 | }, 23 | { 24 | "source": "^/sapcapdppuiorders/(.*)$", 25 | "target": "/sapcapdppuiorders/$1", 26 | "service": "html5-apps-repo-rt", 27 | "authenticationType": "xsuaa" 28 | }, 29 | { 30 | "source": "^/(.*)$", 31 | "target": "$1", 32 | "destination": "sap-cap-dpp-srv", 33 | "authenticationType": "xsuaa", 34 | "csrfProtection": true 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Wed Jan 25 2023 11:36:38 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.8.1| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/admin/ 11 | |**Module Name**
customers| 12 | |**Application Title**
Manage Customers| 13 | |**Namespace**
sap.cap.dpp.app| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.109.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Customers| 20 | |**Navigation Entity**
address| 21 | 22 | ## customers 23 | 24 | Manage Customers 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/customers/webapp/index.html 31 | 32 | - It is also possible to run the application using mock data that reflects the OData Service URL supplied during application generation. In order to run the application with Mock Data, run the following from the generated app root folder: 33 | 34 | ``` 35 | npm run start-mock 36 | ``` 37 | 38 | #### Pre-requisites: 39 | 40 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 41 | 42 | 43 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "customers", 3 | "version": "0.0.1", 4 | "description": "Manage Customers", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf", 13 | "build:cf": "ui5 build preload --clean-dest --config ui5-deploy.yaml --include-task=generateCachebusterInfo" 14 | }, 15 | "devDependencies": { 16 | "@sap/ui5-builder-webide-extension": "^1.1.8", 17 | "ui5-task-zipper": "^0.5.0", 18 | "mbt": "^1.2.18", 19 | "@ui5/cli": "^2.14.10" 20 | }, 21 | "ui5": { 22 | "dependencies": [ 23 | "@sap/ui5-builder-webide-extension", 24 | "ui5-task-zipper", 25 | "mbt" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/ui5-deploy.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json 2 | specVersion: '2.4' 3 | metadata: 4 | name: sap.cap.dpp.app.customers 5 | type: application 6 | resources: 7 | configuration: 8 | propertiesFileSourceEncoding: UTF-8 9 | builder: 10 | resources: 11 | excludes: 12 | - "/test/**" 13 | - "/localService/**" 14 | customTasks: 15 | - name: webide-extension-task-updateManifestJson 16 | afterTask: replaceVersion 17 | configuration: 18 | appFolder: webapp 19 | destDir: dist 20 | - name: ui5-task-zipper 21 | afterTask: generateCachebusterInfo 22 | configuration: 23 | archiveName: sapcapdppappcustomers 24 | additionalFiles: 25 | - xs-app.json 26 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: sap.cap.dpp.app.customers 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("sap.cap.dpp.app.customers.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/annotations/annotation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for sap.cap.dpp.app.customers 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Manage Customers 7 | 8 | #YDES: Application description 9 | appDescription=Manage Customers 10 | 11 | flpTitle=Manage Customers 12 | 13 | flpSubtitle=modify customers 14 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Manage Customers 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheCustomersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheCustomersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheCustomersList.onTable().iCheckRows(); 22 | 23 | When.onTheCustomersList.onTable().iPressRow(0); 24 | Then.onTheCustomersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'sap/cap/dpp/app/customers/test/integration/FirstJourney', 5 | 'sap/cap/dpp/app/customers/test/integration/pages/CustomersList', 6 | 'sap/cap/dpp/app/customers/test/integration/pages/CustomersObjectPage', 7 | 'sap/cap/dpp/app/customers/test/integration/pages/AddressesObjectPage' 8 | ], 9 | function(JourneyRunner, opaJourney, CustomersList, CustomersObjectPage, AddressesObjectPage) { 10 | 'use strict'; 11 | var JourneyRunner = new JourneyRunner({ 12 | // start index.html in web folder 13 | launchUrl: sap.ui.require.toUrl('sap/cap/dpp/app/customers') + '/index.html' 14 | }); 15 | 16 | 17 | JourneyRunner.run( 18 | { 19 | pages: { 20 | onTheCustomersList: CustomersList, 21 | onTheCustomersObjectPage: CustomersObjectPage, 22 | onTheAddressesObjectPage: AddressesObjectPage 23 | } 24 | }, 25 | opaJourney.run 26 | ); 27 | } 28 | ); -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/integration/pages/AddressesObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'sap.cap.dpp.app.customers', 12 | componentId: 'AddressesObjectPage', 13 | entitySet: 'Addresses' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/integration/pages/CustomersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'sap.cap.dpp.app.customers', 12 | componentId: 'CustomersList', 13 | entitySet: 'Customers' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/integration/pages/CustomersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'sap.cap.dpp.app.customers', 12 | componentId: 'CustomersObjectPage', 13 | entitySet: 'Customers' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-dpp-example/app/customers/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "^/admin/(.*)$", 7 | "target": "/admin/$1", 8 | "destination": "sap-cap-dpp-srv", 9 | "authenticationType": "xsuaa", 10 | "csrfProtection": false 11 | }, 12 | { 13 | "source": "^/resources/(.*)$", 14 | "target": "/resources/$1", 15 | "authenticationType": "none", 16 | "destination": "ui5" 17 | }, 18 | { 19 | "source": "^/test-resources/(.*)$", 20 | "target": "/test-resources/$1", 21 | "authenticationType": "none", 22 | "destination": "ui5" 23 | }, 24 | { 25 | "source": "^(.*)$", 26 | "target": "$1", 27 | "service": "html5-apps-repo-rt", 28 | "authenticationType": "xsuaa" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Wed Jan 25 2023 23:10:07 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.8.1| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/browse/ 11 | |**Module Name**
orders| 12 | |**Application Title**
Manage Orders| 13 | |**Namespace**
sap.cap.dpp.ui| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.109.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
items| 21 | 22 | ## orders 23 | 24 | Manage Orders 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/orders/webapp/index.html 31 | 32 | - It is also possible to run the application using mock data that reflects the OData Service URL supplied during application generation. In order to run the application with Mock Data, run the following from the generated app root folder: 33 | 34 | ``` 35 | npm run start-mock 36 | ``` 37 | 38 | #### Pre-requisites: 39 | 40 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 41 | 42 | 43 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orders", 3 | "version": "0.0.1", 4 | "description": "Manage Orders", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf", 13 | "build:cf": "ui5 build preload --clean-dest --config ui5-deploy.yaml --include-task=generateCachebusterInfo" 14 | }, 15 | "devDependencies": { 16 | "@sap/ui5-builder-webide-extension": "^1.1.8", 17 | "ui5-task-zipper": "^0.5.0", 18 | "mbt": "^1.2.18", 19 | "@ui5/cli": "^2.14.10" 20 | }, 21 | "ui5": { 22 | "dependencies": [ 23 | "@sap/ui5-builder-webide-extension", 24 | "ui5-task-zipper", 25 | "mbt" 26 | ] 27 | } 28 | } -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/ui5-deploy.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json 2 | specVersion: '2.4' 3 | metadata: 4 | name: sap.cap.dpp.ui.orders 5 | type: application 6 | resources: 7 | configuration: 8 | propertiesFileSourceEncoding: UTF-8 9 | builder: 10 | resources: 11 | excludes: 12 | - "/test/**" 13 | - "/localService/**" 14 | customTasks: 15 | - name: webide-extension-task-updateManifestJson 16 | afterTask: replaceVersion 17 | configuration: 18 | appFolder: webapp 19 | destDir: dist 20 | - name: ui5-task-zipper 21 | afterTask: generateCachebusterInfo 22 | configuration: 23 | archiveName: sapcapdppuiorders 24 | additionalFiles: 25 | - xs-app.json 26 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: sap.cap.dpp.ui.orders 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("sap.cap.dpp.ui.orders.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/annotations/annotation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for sap.cap.dpp.ui.orders 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Manage Orders 7 | 8 | #YDES: Application description 9 | appDescription=Manage Orders 10 | 11 | flpTitle=Manage Orders 12 | 13 | flpSubtitle=modify orders 14 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Manage Orders 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheOrdersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheOrdersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheOrdersList.onTable().iCheckRows(); 22 | 23 | When.onTheOrdersList.onTable().iPressRow(0); 24 | Then.onTheOrdersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'sap/cap/dpp/ui/orders/test/integration/FirstJourney', 5 | 'sap/cap/dpp/ui/orders/test/integration/pages/OrdersList', 6 | 'sap/cap/dpp/ui/orders/test/integration/pages/OrdersObjectPage', 7 | 'sap/cap/dpp/ui/orders/test/integration/pages/OrderItemsObjectPage' 8 | ], 9 | function(JourneyRunner, opaJourney, OrdersList, OrdersObjectPage, OrderItemsObjectPage) { 10 | 'use strict'; 11 | var JourneyRunner = new JourneyRunner({ 12 | // start index.html in web folder 13 | launchUrl: sap.ui.require.toUrl('sap/cap/dpp/ui/orders') + '/index.html' 14 | }); 15 | 16 | 17 | JourneyRunner.run( 18 | { 19 | pages: { 20 | onTheOrdersList: OrdersList, 21 | onTheOrdersObjectPage: OrdersObjectPage, 22 | onTheOrderItemsObjectPage: OrderItemsObjectPage 23 | } 24 | }, 25 | opaJourney.run 26 | ); 27 | } 28 | ); -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/integration/pages/OrderItemsObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'sap.cap.dpp.ui.orders', 12 | componentId: 'OrderItemsObjectPage', 13 | entitySet: 'OrderItems' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/integration/pages/OrdersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'sap.cap.dpp.ui.orders', 12 | componentId: 'OrdersList', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/integration/pages/OrdersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'sap.cap.dpp.ui.orders', 12 | componentId: 'OrdersObjectPage', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-dpp-example/app/orders/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "^/browse/(.*)$", 7 | "target": "/browse/$1", 8 | "destination": "sap-cap-dpp-srv", 9 | "authenticationType": "xsuaa", 10 | "csrfProtection": false 11 | }, 12 | { 13 | "source": "^/resources/(.*)$", 14 | "target": "/resources/$1", 15 | "authenticationType": "none", 16 | "destination": "ui5" 17 | }, 18 | { 19 | "source": "^/test-resources/(.*)$", 20 | "target": "/test-resources/$1", 21 | "authenticationType": "none", 22 | "destination": "ui5" 23 | }, 24 | { 25 | "source": "^(.*)$", 26 | "target": "$1", 27 | "service": "html5-apps-repo-rt", 28 | "authenticationType": "xsuaa" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /cap-dpp-example/app/services.cds: -------------------------------------------------------------------------------- 1 | 2 | using from './customers/annotations'; 3 | 4 | using from './orders/annotations'; -------------------------------------------------------------------------------- /cap-dpp-example/config/pdm-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "fullyQualifiedApplicationName": "cap-dpp-example-pdm", 3 | "fullyQualifiedModuleName": "cap-dpp-example-srv", 4 | "applicationTitle": "DPP GameShop", 5 | "applicationTitleKey":"DppGameShop", 6 | "applicationURL": "https://tfe-dpp-dev-vud8raks-dev-cap-dpp-example-srv.cfapps.us10.hana.ondemand.com", 7 | "endPoints": [ 8 | { 9 | "type": "odatav4", 10 | "serviceName": "cap-dpp-example-service", 11 | "serviceTitle": "DppService GameSHop", 12 | "serviceTitleKey": "DppServiceGameShop", 13 | "serviceURI": "pdm", 14 | "hasGdprV4Annotations": true, 15 | "cacheControl": "no-cache" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /cap-dpp-example/config/pdm-security-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "xs-security": { 3 | "xsappname": "cap-dpp-example", 4 | "authorities": [ 5 | "$ACCEPT_GRANTED_AUTHORITIES" 6 | ] 7 | }, 8 | "fullyQualifiedApplicationName": "cap-dpp-example-pdm", 9 | "appConsentServiceEnabled": true 10 | } -------------------------------------------------------------------------------- /cap-dpp-example/config/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "tenant-mode":"dedicated", 3 | "xsappname": "cap-dpp-example", 4 | "scopes": [ 5 | { 6 | "name": "$XSAPPNAME.GameShopAdmin", 7 | "description": "GameShopAdmin" 8 | }, 9 | { 10 | "name": "$XSAPPNAME.GameShopUser", 11 | "description": "GameShopUser" 12 | }, 13 | { 14 | "name": "$XSAPPNAME.PersonalDataManagerUser", 15 | "description": "Authority for Personal Data Manager", 16 | "grant-as-authority-to-apps": ["$XSSERVICENAME(cap-dpp-example-pdm)"] 17 | } 18 | ], 19 | "attributes": [], 20 | "role-templates": [ 21 | { 22 | "name": "GameShopAdmin", 23 | "description": "generated", 24 | "scope-references": ["$XSAPPNAME.GameShopAdmin"], 25 | "attribute-references": [] 26 | }, 27 | { 28 | "name": "GameShopUser", 29 | "description": "generated", 30 | "scope-references": ["$XSAPPNAME.GameShopUser"], 31 | "attribute-references": [] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.cap.dpp-AddressTypes.csv: -------------------------------------------------------------------------------- 1 | id;name 2 | 1;Work 3 | 2;Home 4 | 3;Preferred -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.cap.dpp-Addresses.csv: -------------------------------------------------------------------------------- 1 | ID;createdAt;createdBy;modifiedAt;modifiedBy;customer_ID;type_id;state;street;town;country_code;someOtherField 2 | 1b80b9e2-223b-4f86-a61c-47a08162e2a6;2023-01-25T14:33:00.575Z;anonymous;2023-01-25T14:33:00.575Z;anonymous;c7efafdb-9689-444b-af0f-d4f69abc190e;1;Maharastra;Churchgate;Mumbai;IND;Floor 4 3 | 2524b602-7618-4ff3-944e-9c482b043e12;2023-01-25T14:34:38.549Z;anonymous;2023-01-25T14:34:38.549Z;anonymous;4b2d116a-381c-4ae0-ad3a-c34ca760e793;3;Maharastra;Bazar Road;Mumbai;IND;Floor 4 4 | 4299bacc-298e-4167-bb46-369b12eac721;2023-01-25T14:34:38.549Z;anonymous;2023-01-25T14:34:38.549Z;anonymous;4b2d116a-381c-4ae0-ad3a-c34ca760e793;2;Maharastra;MG Road;Mumbai;IND;Floor 29 5 | 4549639a-43f0-40fe-b1fb-a2a9e947e907;2023-01-25T14:25:11.365Z;anonymous;2023-01-25T14:25:11.365Z;anonymous;5abf9ee3-596d-4cb9-b2be-efaa8e99b0c7;3;California;California Institute of Technology;null;USA;1001 6 | 7d082559-edcf-4c63-b8bd-de8832c45063;2023-01-25T14:21:27.830Z;anonymous;2023-01-25T14:21:27.830Z;anonymous;ca896642-5413-4c9c-86bf-c72d7b7da811;2;California;North Los Robles Avenue;Pasadena;USA;2311 7 | 8394674d-e7f1-4ea9-bec7-c5791e9ca551;2023-01-25T14:25:11.365Z;anonymous;2023-01-25T14:25:11.365Z;anonymous;5abf9ee3-596d-4cb9-b2be-efaa8e99b0c7;1;California;Los Robles Avenue;Pasadena;USA;4A 8 | 8adc5ba9-c65f-4f67-bc1c-58fa86d2118f;2023-01-25T14:33:00.575Z;anonymous;2023-01-25T14:33:00.575Z;anonymous;c7efafdb-9689-444b-af0f-d4f69abc190e;2;Maharastra;Worli's Omkar;Mumbai;IND;Floor 35 9 | c0512022-a47b-40f2-b371-220bc75c412b;2023-01-25T14:21:27.830Z;anonymous;2023-01-25T14:21:27.830Z;anonymous;ca896642-5413-4c9c-86bf-c72d7b7da811;1;California;California Institute of Technology;null;USA;4A -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.cap.dpp-Customers.csv: -------------------------------------------------------------------------------- 1 | ID;createdAt;createdBy;modifiedAt;modifiedBy;email;firstName;lastName;creditCardNo;dateOfBirth 2 | 4b2d116a-381c-4ae0-ad3a-c34ca760e793;2023-01-25T14:34:38.549Z;anonymous;2023-01-25T14:34:38.549Z;anonymous;rohit.sharma@cricket.com;Rohit;Sharma;8012330044005623;1981-01-11 3 | 5abf9ee3-596d-4cb9-b2be-efaa8e99b0c7;2023-01-25T14:25:11.365Z;anonymous;2023-01-25T14:25:11.365Z;anonymous;leonard.hoftstadter@bbt.com;Leonard;Hofstadter;9011223310002468;1991-01-01 4 | c7efafdb-9689-444b-af0f-d4f69abc190e;2023-01-25T14:33:00.575Z;anonymous;2023-01-25T14:33:00.575Z;anonymous;virat.kohli@cricket.com;Virat;Kohli;8011220033002378;1986-01-10 5 | ca896642-5413-4c9c-86bf-c72d7b7da811;2023-01-25T14:21:27.830Z;anonymous;2023-01-25T14:21:27.830Z;anonymous;sheldon.cooper@bbt.com;Sheldon;Cooper;9001201030106789;1989-01-25 -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.cap.dpp-EmailAddresses.csv: -------------------------------------------------------------------------------- 1 | ID;createdAt;createdBy;modifiedAt;modifiedBy;customer_ID;emailType_id;emailAddress 2 | 54e8a9cd-5c27-4161-b01c-aeec66ee3c2c;2023-02-04T14:49:50.056Z;risk.manager@tester.sap.com;2023-02-04T14:50:01.799Z;risk.manager@tester.sap.com;ca896642-5413-4c9c-86bf-c72d7b7da811;4;sheldon.cooper@bbt.com 3 | c03808c3-5577-48bb-83bc-5ec0f1386fe7;2023-02-04T14:48:12.186Z;risk.manager@tester.sap.com;2023-02-04T14:48:25.755Z;risk.manager@tester.sap.com;4b2d116a-381c-4ae0-ad3a-c34ca760e793;1;rohit.sharma@cricket.com 4 | d1930672-e737-4651-9522-bb6fc9383889;2023-02-04T14:49:05.971Z;risk.manager@tester.sap.com;2023-02-04T14:49:16.961Z;risk.manager@tester.sap.com;5abf9ee3-596d-4cb9-b2be-efaa8e99b0c7;4;leonard.hoftstadter@bbt.com 5 | daeba3dc-4e0e-41dd-a4f7-a038983ca802;2023-02-04T14:49:32.994Z;risk.manager@tester.sap.com;2023-02-04T14:49:41.649Z;risk.manager@tester.sap.com;c7efafdb-9689-444b-af0f-d4f69abc190e;2;virat.kohli@gmail.com 6 | -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.cap.dpp-EmailTypes.csv: -------------------------------------------------------------------------------- 1 | id;name 2 | 1;Work 3 | 2;Personal 4 | 4;Preffered 5 | -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.cap.dpp-Games.csv: -------------------------------------------------------------------------------- 1 | ID;title;genre;publisher;stock;price;currency_code;image;descr 2 | 0e05cdb8-5ccf-11ed-9b6a-0242ac120002;God Of War;Action Adventure;Sony Interactive Entertainment;10;30;USD;https://m.media-amazon.com/images/I/81E5a+Vym-L._SX425_.jpg;God of War 3 | 0e05d34e-5ccf-11ed-9b6a-0242ac120002;Playerunknown's Battlegrounds;Action;Sony Computer Entertainment;10;20;USD;https://m.media-amazon.com/images/I/71jA11aa56L.jpg;Playerunknown's Battlegrounds 4 | 0e05d876-5ccf-11ed-9b6a-0242ac120002;Call of Duty;Action;Activision;10;25;USD;https://image.api.playstation.com/cdn/EP0002/CUSA05282_00/JhIXa8se54KKNhggEahiO0Oz78IITOGF.png;Call of Duty: Infinite Warfare 5 | 0e05d9e8-5ccf-11ed-9b6a-0242ac120002;FIFA 22;Sports;Electronic Arts;10;40;USD;https://m.media-amazon.com/images/I/81yegjdGUjL._SL1500_.jpg;PS4 FIFA 22 (Standard) 6 | 0e05db46-5ccf-11ed-9b6a-0242ac120002;Uncharted by NaughtyDog;Action Adventure;Sony Computer Entertainment;10;50;USD;https://cdn.wccftech.com/wp-content/uploads/2021/11/uncharted-legacy-of-thieves-collection.jpg;Uncharted : The Nathan Drake Collection -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.common-Countries.csv: -------------------------------------------------------------------------------- 1 | code;name;descr 2 | IND; India; India 3 | USA; America; United States of America -------------------------------------------------------------------------------- /cap-dpp-example/db/data/sap.common-Currencies.csv: -------------------------------------------------------------------------------- 1 | code;name;descr;symbol 2 | INR;Indian Rupees;Indian Rupees; 3 | USD;US Dollar;US Dollar; -------------------------------------------------------------------------------- /cap-dpp-example/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace sap.cap.dpp; 2 | 3 | using { 4 | managed, 5 | Currency, 6 | Country, 7 | sap.common.CodeList, 8 | cuid 9 | } from '@sap/cds/common'; 10 | 11 | 12 | entity Games : cuid, managed { 13 | title : String(100); 14 | descr : String(300); 15 | genre : String(50); 16 | publisher : String(50); 17 | stock : Integer; 18 | price : Decimal; 19 | currency : Currency; 20 | image : String; 21 | } 22 | 23 | entity Orders : cuid, managed { 24 | orderNo : String; 25 | items : Composition of many OrderItems 26 | on items.order = $self; 27 | totamount : Decimal; 28 | currency : Currency; 29 | customer : Association to Customers; 30 | personalComment : String; 31 | status : String(20); 32 | } 33 | 34 | entity OrderItems : cuid { 35 | order : Association to Orders; 36 | game : Association to Games; 37 | quantity : Integer; 38 | price : Decimal; 39 | netprice : Decimal; 40 | currency : Currency; 41 | } 42 | 43 | entity Customers : cuid, managed { 44 | email : String; 45 | firstName : String; 46 | lastName : String; 47 | creditCardNo : String; 48 | dateOfBirth : Date; 49 | addresses : Composition of many Addresses 50 | on addresses.customer = $self; 51 | emails : Composition of many EmailAddresses 52 | on emails.customer = $self; 53 | } 54 | 55 | entity Addresses : cuid, managed { 56 | customer : Association to one Customers; 57 | type : Association to one AddressTypes; 58 | state : String(128); 59 | street : String(128); 60 | town : String(128); 61 | country : Country; 62 | someOtherField : String(256); 63 | }; 64 | 65 | entity EmailAddresses : cuid, managed { 66 | customer : Association to one Customers; 67 | emailType : Association to one EmailTypes; 68 | emailAddress : String(200); 69 | } 70 | 71 | entity AddressTypes { 72 | key id : String(1); 73 | name : String(30); 74 | } 75 | 76 | entity EmailTypes { 77 | key id : String(1); 78 | name : String(30); 79 | } 80 | -------------------------------------------------------------------------------- /cap-dpp-example/db/undeploy.json: -------------------------------------------------------------------------------- 1 | [ 2 | "src/gen/**/*.hdbview", 3 | "src/gen/**/*.hdbindex", 4 | "src/gen/**/*.hdbconstraint" 5 | ] -------------------------------------------------------------------------------- /cap-dpp-example/srv/admin-capbilities.cds: -------------------------------------------------------------------------------- 1 | using {AdminService as service} from './admin-service'; 2 | 3 | annotate service with @( 4 | path : '/admin', 5 | requires: ['GameShopAdmin'] 6 | ); 7 | 8 | annotate service.Customers with @( 9 | assert.integrity : true, 10 | odata.draft.enabled: true 11 | ); 12 | 13 | annotate service.Customers { 14 | // email @Communication: {IsEmailAddress} @mandatory; 15 | creditCardNo @assert.format: '^[0-9]{16}$' @mandatory; 16 | firstName @assert.format: '^([a-z]|[A-Z]){1}' @mandatory; 17 | }; 18 | 19 | annotate service.Addresses { 20 | type @mandatory; 21 | country_code @mandatory; 22 | state @mandatory; 23 | someOtherField @mandatory; 24 | }; 25 | 26 | annotate service.EmailAddresses { 27 | emailType @mandatory; 28 | emailAddress @Communication: {IsEmailAddress} @mandatory; 29 | }; 30 | 31 | 32 | annotate service.AddressTypes with @readonly; 33 | -------------------------------------------------------------------------------- /cap-dpp-example/srv/admin-service.cds: -------------------------------------------------------------------------------- 1 | using {sap.cap.dpp as db} from '../db/schema'; 2 | 3 | service AdminService { 4 | entity Games as projection on db.Games; 5 | entity Customers as projection on db.Customers; 6 | entity Addresses as projection on db.Addresses; 7 | entity EmailAddresses as projection on db.EmailAddresses; 8 | entity AddressTypes as projection on db.AddressTypes; 9 | entity EmailTypes as projection on db.EmailTypes; 10 | } 11 | -------------------------------------------------------------------------------- /cap-dpp-example/srv/admin-service.js: -------------------------------------------------------------------------------- 1 | const cds = require("@sap/cds"); 2 | 3 | class service extends cds.ApplicationService { 4 | async init() { 5 | const { Customers, EmailAddresses } = this.entities; 6 | 7 | this.after("PATCH", EmailAddresses, async (data) => { 8 | let customerInfo = { email: '' }, addressInfo=''; 9 | let result = await cds.read(EmailAddresses.drafts).where({ ID: data.ID }).columns(["customer_ID"]); 10 | 11 | let dbItemInfos = await cds.read(EmailAddresses.drafts).where({ customer_ID: result[0].customer_ID }); 12 | addressInfo = dbItemInfos.find(emailAddress => emailAddress.emailType_id == '4'); 13 | if(addressInfo == undefined || addressInfo.emailAddress == ''){ 14 | addressInfo = dbItemInfos.find(emailAddress => emailAddress.emailType_id == '2'); 15 | } 16 | if(addressInfo == undefined || addressInfo.emailAddress == ''){ 17 | addressInfo = dbItemInfos.find(emailAddress => emailAddress.emailType_id == '1'); 18 | } 19 | if(addressInfo && addressInfo != undefined){ 20 | customerInfo.email = addressInfo.emailAddress; 21 | } 22 | await cds.update(Customers.drafts, result[0].customer_ID).set(customerInfo); 23 | }); 24 | await super.init(); 25 | } 26 | } 27 | module.exports = service; -------------------------------------------------------------------------------- /cap-dpp-example/srv/catalog-capabilities.cds: -------------------------------------------------------------------------------- 1 | using { CatalogService as service } from './catalog-service'; 2 | 3 | annotate service with @( 4 | path : '/browse', 5 | requires: ['GameShopUser'] 6 | ); 7 | 8 | annotate service.Orders with @( 9 | assert.integrity : true, 10 | odata.draft.enabled : true, 11 | UI.UpdateHidden : {$edmJson : {$Eq : [{$Path : 'status'},'In Process']}}, 12 | Common.DefaultValuesFunction : 'getOrderDefaults' 13 | ); 14 | 15 | annotate service.Orders with @(UI.Identification : [ 16 | { 17 | $Type : 'UI.DataFieldForAction', 18 | Label : 'Set to In Process', 19 | Action : 'CatalogService.setOrderProcessing', 20 | ![@UI.Hidden] : {$edmJson : {$Ne : [{$Path : 'status'}, 'Open']}} 21 | }, 22 | { 23 | $Type : 'UI.DataFieldForAction', 24 | Label : 'Set to Open', 25 | Action : 'CatalogService.setOrderOpen', 26 | ![@UI.Hidden] : {$edmJson : {$Eq : [{$Path : 'status'},'Open']}} 27 | } 28 | ]); 29 | 30 | 31 | annotate service.Orders with { 32 | status @Common.FieldControl : {$edmJson : {$If : [{$Ne : [ {$Path : 'status'}, '' ]}, 1, 3 ]}} 33 | }; 34 | 35 | annotate service.Orders @(Common : { 36 | SideEffects #CustomerChanged : { 37 | SourceProperties : ['customer_ID'], 38 | TargetEntities : [customer, customer.addresses] 39 | }, 40 | SideEffects #ItemChanged : { 41 | SourceEntities : [items], 42 | TargetProperties : ['totamount', 'currency_code'] 43 | } 44 | }); 45 | 46 | 47 | annotate service.OrderItems @(Common : { 48 | SideEffects #GameChanged : { 49 | SourceProperties : ['game_ID'], 50 | TargetProperties : ['price', 'currency_code', 'netprice'] 51 | }, 52 | SideEffects #QuantityChanged : { 53 | SourceProperties : ['quantity'], 54 | TargetProperties : ['netprice'] 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /cap-dpp-example/srv/catalog-service.cds: -------------------------------------------------------------------------------- 1 | using {sap.cap.dpp as db} from '../db/schema'; 2 | 3 | service CatalogService { 4 | entity Games as projection on db.Games; 5 | 6 | entity Orders as projection on db.Orders actions { 7 | @( 8 | cds.odata.bindingparameter.name: '_it', 9 | Common.SideEffects : {TargetProperties: ['_it/status']} 10 | ) 11 | action setOrderProcessing(); 12 | @( 13 | cds.odata.bindingparameter.name: '_it', 14 | Common.SideEffects : {TargetProperties: ['_it/status']} 15 | ) 16 | action setOrderOpen(); 17 | }; 18 | 19 | function getOrderDefaults() returns Orders; 20 | entity OrderItems as projection on db.OrderItems; 21 | entity Customers as projection on db.Customers; 22 | entity Addresses as projection on db.Addresses; 23 | } 24 | -------------------------------------------------------------------------------- /cap-dpp-example/srv/pdm-service.cds: -------------------------------------------------------------------------------- 1 | using {sap.cap.dpp as db} from '../db/schema'; 2 | 3 | service PdmService { 4 | entity Customers as projection on db.Customers; 5 | entity CustomerPostalAddresses as 6 | select from db.Addresses { 7 | *, 8 | type.name as addressType }; 9 | entity CustomerEmailAddresses as 10 | select from db.EmailAddresses { 11 | *, 12 | emailType.name as emailAddressType }; 13 | entity OrderItemView as 14 | select from db.Orders { 15 | key items.ID as Item_ID, 16 | ID as Order_ID, 17 | orderNo as Order_No, 18 | personalComment as personalComment, 19 | customer.ID as Customer_ID, 20 | customer.email as Customer_Email, 21 | items.game.title as Item_Game, 22 | items.quantity as Item_Quantity, 23 | items.netprice as Item_NetPrice }; 24 | } -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "es2022": true, 5 | "node": true, 6 | "jest": true, 7 | "mocha": true 8 | }, 9 | "globals": { 10 | "SELECT": true, 11 | "INSERT": true, 12 | "UPSERT": true, 13 | "UPDATE": true, 14 | "DELETE": true, 15 | "CREATE": true, 16 | "DROP": true, 17 | "CDL": true, 18 | "CQL": true, 19 | "CXL": true, 20 | "cds": true 21 | }, 22 | "rules": { 23 | "no-console": "off", 24 | "require-atomic-updates": "off" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-fe-lr-op-actions 2 | _out 3 | *.db 4 | *.sqlite 5 | connection.properties 6 | default-*.json 7 | .cdsrc-private.json 8 | gen/ 9 | node_modules/ 10 | target/ 11 | 12 | # Web IDE, App Studio 13 | .che/ 14 | .gen/ 15 | 16 | # MTA 17 | *_mta_build_tmp 18 | *.mtar 19 | mta_archives/ 20 | 21 | # Other 22 | .DS_Store 23 | *.orig 24 | *.log 25 | 26 | *.iml 27 | *.flattened-pom.xml 28 | 29 | # IDEs 30 | # .vscode 31 | # .idea 32 | 33 | # @cap-js/cds-typer 34 | @cds-models 35 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository is an showcase for exploring actions on List Report and Object Page of SAP Fiori Elements with SAP Cloud Application Programming Model (CAP) using annotations only. 4 | 5 | More information is available on following blogs: 6 | 7 | - [CAP with Fiori Elements: Actions on List Report / Object Page using Annotations – Part1](https://blogs.sap.com/2023/12/31/cap-with-fiori-elements-actions-on-list-report-object-page-using-annotations-part1/) 8 | 9 | - [CAP with Fiori Elements: Actions on List Report / Object Page using Annotations – Part2](https://blogs.sap.com/2023/12/31/cap-with-fiori-elements-actions-on-list-report-object-page-using-annotations-part2/) 10 | 11 | ## Getting Started 12 | 13 | File or Folder | Purpose 14 | ---------|---------- 15 | `app/` | content for UI frontends goes here 16 | `db/` | your domain models and data go here 17 | `srv/` | your service models and code go here 18 | `package.json` | project metadata and configuration 19 | `readme.md` | this getting started guide 20 | 21 | 22 | ## Local Run 23 | 24 | - Clone this git repo and Open cap-fe-lr-op-actions folder in a new terminal 25 | - install dependencies by running npm install 26 | - run `cds watch` to start the cap application. 27 | 28 | 29 | ## Learn More 30 | 31 | Learn more at https://cap.cloud.sap/docs/get-started/. -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/services.cds: -------------------------------------------------------------------------------- 1 | 2 | using from './ui01/annotations/annotations'; 3 | 4 | using from './ui01/annotations/generic-actions'; 5 | 6 | using from './ui01/annotations/global-determining-actions'; 7 | 8 | using from './ui01/annotations/table-actions'; 9 | 10 | using from './ui01/annotations/fieldgroup-actions'; 11 | 12 | using from './ui01/annotations/chart-actions'; 13 | 14 | 15 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Fri Dec 29 2023 10:05:40 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.11.0| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/cap_fe_lr_op_actions/ 11 | |**Module Name**
ui01| 12 | |**Application Title**
Actions - UI01| 13 | |**Namespace**
cap.fe.lr.op.actions| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.120.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Roots| 20 | |**Navigation Entity**
None| 21 | 22 | ## ui01 23 | 24 | Actions - UI01 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/ui01/webapp/index.html 31 | 32 | #### Pre-requisites: 33 | 34 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/annotations/chart-actions.cds: -------------------------------------------------------------------------------- 1 | using cap_fe_lr_op_actions_service as service from '../../../srv/service'; 2 | 3 | annotate service.Items with @( 4 | Analytics.AggregatedProperty #itemamount_sum: { 5 | $Type : 'Analytics.AggregatedPropertyType', 6 | Name : 'itemamount_sum', 7 | AggregatableProperty: itemAmount, 8 | AggregationMethod : 'sum', 9 | ![@Common.Label] : 'itemamount (Sum)' 10 | }, 11 | UI.Chart #ROChart : { 12 | $Type : 'UI.ChartDefinitionType', 13 | Title : 'Amount By Item', 14 | ChartType : #Bar, 15 | Dimensions : [iname], 16 | DimensionAttributes: [{ 17 | $Type : 'UI.ChartDimensionAttributeType', 18 | Dimension: iname, 19 | Role : #Category 20 | }], 21 | DynamicMeasures : ['@Analytics.AggregatedProperty#itemamount_sum'], 22 | Actions : [ 23 | { 24 | $Type : 'UI.DataFieldForAction', 25 | Action : 'ca_op_ub_chartAction', 26 | Label : '(Unbound) Chart Action', 27 | Criticality: #Positive 28 | } 29 | ] 30 | }, 31 | ) ; -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/annotations/fieldgroup-actions.cds: -------------------------------------------------------------------------------- 1 | using cap_fe_lr_op_actions_service as service from '../../../srv/service'; 2 | 3 | annotate service.Roots with @(UI.FieldGroup #Details: { 4 | $Type: 'UI.FieldGroupType', 5 | Data : [ 6 | { 7 | $Type: 'UI.DataField', 8 | Value: id, 9 | Label: 'id', 10 | }, 11 | { 12 | $Type: 'UI.DataField', 13 | Value: name, 14 | Label: 'name', 15 | }, 16 | /*---------->>[ FieldGroup Actions ]<<----------*/ 17 | { 18 | $Type : 'UI.DataFieldForAction', 19 | Action: 'cap_fe_lr_op_actions_service.EntityContainer/fg_op_ub_triggerRefresh', 20 | Label : '(Unbound) Section Trigger' 21 | }, 22 | { 23 | $Type : 'UI.DataFieldForAction', 24 | Action : 'cap_fe_lr_op_actions_service.fg_op_triggerInlineAction01', 25 | Label : 'Inline Trigger 01', 26 | Inline: true 27 | } 28 | /*----------------------------------------------*/ 29 | ] 30 | }); 31 | 32 | annotate service.Roots with @(UI.FieldGroup #MoreDetails: { 33 | $Type: 'UI.FieldGroupType', 34 | Data : [ 35 | { 36 | $Type: 'UI.DataField', 37 | Value: descr, 38 | Label: 'descr', 39 | }, 40 | { 41 | $Type: 'UI.DataField', 42 | Value: totalAmount, 43 | Label: 'totalAmount', 44 | }, 45 | /*---------->>[ FieldGroup Actions ]<<----------*/ 46 | { 47 | $Type : 'UI.DataFieldForAction', 48 | Action: 'cap_fe_lr_op_actions_service.fg_op_triggerAction', 49 | Label : 'Section Trigger' 50 | }, 51 | { 52 | $Type : 'UI.DataFieldForAction', 53 | Action : 'cap_fe_lr_op_actions_service.fg_op_triggerInlineAction02', 54 | Label : 'Inline Trigger 02', 55 | Inline: true 56 | } 57 | /*----------------------------------------------*/ 58 | ] 59 | }); 60 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/annotations/generic-actions.cds: -------------------------------------------------------------------------------- 1 | using cap_fe_lr_op_actions_service as service from '../../../srv/service'; 2 | /*---------->>[ Generic Actions ]<<----------*/ 3 | /*-------------------------------------------*/ 4 | 5 | /*-----> Create Action 6 | 7 | annotate service.Roots with @( 8 | UI.CreateHidden: true 9 | ); 10 | 11 | <-----*/ 12 | 13 | /*-----> Edit Action 14 | 15 | annotate service.Roots with @( 16 | UI.UpdateHidden: true 17 | ); 18 | 19 | <-----*/ 20 | 21 | /*-----> Edit Action: By Property and By Dynamic Expression 22 | 23 | annotate service.Roots with @( 24 | UI.UpdateHidden: disableUpdation 25 | ); 26 | 27 | annotate service.Roots with @( 28 | UI.UpdateHidden : {$edmJson: {$Ne: [{$Path: 'enableUpdation'}, true]}} 29 | ); 30 | 31 | <-----*/ 32 | 33 | /*-----> Delete Action 34 | 35 | annotate service.Roots with @( 36 | UI.DeleteHidden: true 37 | ); 38 | 39 | <-----*/ 40 | 41 | /*-----> Delete Action: By Property and By Dynamic Expression 42 | 43 | annotate service.Roots with @( 44 | UI.DeleteHidden: disableDeletion 45 | ); 46 | 47 | annotate service.Roots with @( 48 | UI.DeleteHidden : {$edmJson: {$Ne: [{$Path: 'enableDeletion'}, true]}} 49 | ); 50 | 51 | <-----*/ 52 | /*-------------------------------------------*/ -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/annotations/global-determining-actions.cds: -------------------------------------------------------------------------------- 1 | using cap_fe_lr_op_actions_service as service from '../../../srv/service'; 2 | // using from './annotations'; 3 | 4 | annotate service.Roots with @(UI.Identification: [ 5 | 6 | /*---------->>[ Global Actions ]<<----------*/ 7 | { 8 | $Type : 'UI.DataFieldForAction', 9 | Action : 'cap_fe_lr_op_actions_service.ga_op_calculate', 10 | Label : 'Trigger Calculation', 11 | Criticality: #Negative 12 | }, 13 | { 14 | $Type : 'UI.DataFieldForAction', 15 | Action : 'cap_fe_lr_op_actions_service.EntityContainer/ga_op_ub_replication', 16 | Label : '(Unbound) Trigger Replication', 17 | Criticality: #Positive 18 | }, 19 | { 20 | $Type : 'UI.DataFieldForAction', 21 | Action : 'cap_fe_lr_op_actions_service.EntityContainer/msg_trigger', 22 | Label : 'Trigger Messages', 23 | Criticality: #Positive 24 | }, 25 | /*-------------------------------------------*/ 26 | /*-------->>[ Determining Actions ]<<--------*/ 27 | { 28 | $Type : 'UI.DataFieldForAction', 29 | Action : 'cap_fe_lr_op_actions_service.da_op_clearParymentAction', 30 | Label : 'Clear Payment Action', 31 | Determining: true, 32 | Criticality: #Negative 33 | }, 34 | { 35 | $Type : 'UI.DataFieldForAction', 36 | Action : 'cap_fe_lr_op_actions_service.EntityContainer/da_op_ub_clearOutstanding', 37 | Label : '(Unbound) Clear Outstanding', 38 | Determining: true, 39 | Criticality: #Positive 40 | } 41 | /*-------------------------------------------*/ 42 | 43 | ]); 44 | 45 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui01", 3 | "version": "0.0.1", 4 | "description": "Actions - UI01", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.lr.op.actions.ui01 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.lr.op.actions.ui01.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.lr.op.actions.ui01 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Actions - UI01 7 | 8 | #YDES: Application description 9 | appDescription=Actions - UI01 -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Actions - UI01 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheRootsList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheRootsList.onFilterBar().iExecuteSearch(); 21 | Then.onTheRootsList.onTable().iCheckRows(); 22 | 23 | When.onTheRootsList.onTable().iPressRow(0); 24 | Then.onTheRootsObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'cap/fe/lr/op/actions/ui01/test/integration/FirstJourney', 5 | 'cap/fe/lr/op/actions/ui01/test/integration/pages/RootsList', 6 | 'cap/fe/lr/op/actions/ui01/test/integration/pages/RootsObjectPage' 7 | ], 8 | function(JourneyRunner, opaJourney, RootsList, RootsObjectPage) { 9 | 'use strict'; 10 | var JourneyRunner = new JourneyRunner({ 11 | // start index.html in web folder 12 | launchUrl: sap.ui.require.toUrl('cap/fe/lr/op/actions/ui01') + '/index.html' 13 | }); 14 | 15 | 16 | JourneyRunner.run( 17 | { 18 | pages: { 19 | onTheRootsList: RootsList, 20 | onTheRootsObjectPage: RootsObjectPage 21 | } 22 | }, 23 | opaJourney.run 24 | ); 25 | } 26 | ); -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/integration/pages/RootsList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'cap.fe.lr.op.actions.ui01', 12 | componentId: 'RootsList', 13 | entitySet: 'Roots' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/integration/pages/RootsObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.op.actions.ui01', 12 | componentId: 'RootsObjectPage', 13 | entitySet: 'Roots' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/app/ui01/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/db/data/cap.fe.lr.op.actions.db-Categories.csv: -------------------------------------------------------------------------------- 1 | id,descr 2 | PTM,Pre-Tained Sample 3 | FTM,Fine-Tuned Sample 4 | DSM,Domain-Specific Sample -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/db/data/cap.fe.lr.op.actions.db-Criticalities.csv: -------------------------------------------------------------------------------- 1 | id,descr 2 | CRP,Positive 3 | CRN,Negative 4 | CRI,Information -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/db/data/cap.fe.lr.op.actions.db-Items.csv: -------------------------------------------------------------------------------- 1 | id,iname,idescr,root_id,itemAmount,enableItem 2 | 10,item10,10 items,100,200,true 3 | 20,item20,20 items,100,300,false 4 | 30,item30,30 items,100,500,true 5 | 40,item10,10 items,101,500,true 6 | 50,item20,20 items,101,1000,false 7 | 60,item30,30 items,101,500,true 8 | 70,item10,10 items,102,1200,false 9 | 80,item20,20 items,102,750,true 10 | 90,item30,30 items,102,1050,true -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/db/data/cap.fe.lr.op.actions.db-Roots.csv: -------------------------------------------------------------------------------- 1 | id,name,descr,totalAmount,enableUpdation,disableUpdation,enableDeletion,disableDeletion 2 | 100,hundred,root hundred,1000,true,true,true,false 3 | 101,hundred one,root hundred one,2000,false,true,true,false 4 | 102,hundred two,root hundred two,3000,true,false,false,true -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/db/data/cap.fe.lr.op.actions.db-Samples.csv: -------------------------------------------------------------------------------- 1 | id,name,descr,amount 2 | 1001,Lucas Mitchell,An adventurous soul,23689 3 | 1002,Isabella Turner,A dedicated professional,344234 4 | 1003,Ava Richardson,An aspiring artist with a vibrant imagination,190222 5 | 1004,Elijah Foster,A lifelong learner and avid reader,45623 6 | 1005,Sophia Harrison,An advocate for social justice and equality,135790 -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace cap.fe.lr.op.actions.db; 2 | 3 | entity Roots { 4 | key id : Int16; 5 | name : String; 6 | descr : String; 7 | totalAmount : Integer64; 8 | items : Composition of many Items 9 | on items.root = $self; 10 | enableUpdation: Boolean; 11 | disableUpdation: Boolean; 12 | enableDeletion: Boolean; 13 | disableDeletion: Boolean 14 | } 15 | 16 | entity Items { 17 | key id : Int16; 18 | iname : String; 19 | idescr : String; 20 | itemAmount : Integer64; 21 | enableItem : Boolean; 22 | root : Association to one Roots; 23 | } 24 | 25 | entity Categories { 26 | key id : String(10); 27 | descr : String(100); 28 | } 29 | 30 | entity Criticalities { 31 | key id : String(10); 32 | descr : String(100); 33 | } 34 | 35 | entity Samples { 36 | key id : Int16; 37 | name : String; 38 | descr : String; 39 | amount : Integer64; 40 | } 41 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cap-fe-lr-op-actions", 3 | "version": "1.0.0", 4 | "description": "A simple CAP project.", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@sap/cds": "^8", 10 | "express": "^4" 11 | }, 12 | "devDependencies": { 13 | "@cap-js/sqlite": "^1", 14 | "@sap/ux-specification": "^1.120.1" 15 | }, 16 | "scripts": { 17 | "start": "cds-serve", 18 | "watch-ui01": "cds watch --open ui01/webapp/index.html?sap-ui-xx-viewCache=false" 19 | }, 20 | "sapux": [ 21 | "app/ui01" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /cap-fe-lr-op-actions/srv/annotations.cds: -------------------------------------------------------------------------------- 1 | using { cap_fe_lr_op_actions_service as service } from './service'; 2 | 3 | annotate service.Roots with @odata.draft.enabled; 4 | annotate service.Samples with @readonly @Capabilities.SearchRestrictions:{Searchable: false}; 5 | 6 | 7 | annotate service.Items with @Aggregation.ApplySupported: { 8 | $Type : 'Aggregation.ApplySupportedType', 9 | Transformations : [ 10 | 'aggregate', 11 | 'groupby', 12 | 'filter', 13 | 'search', 14 | 'concat', 15 | 'skip', 16 | 'orderby', 17 | 'top' 18 | ], 19 | Rollup : #None, 20 | From : false, 21 | GroupableProperties : [ 22 | id, 23 | iname, 24 | idescr 25 | ], 26 | AggregatableProperties: [{ 27 | Property : itemAmount, 28 | SupportedAggregationMethods : [ 29 | 'sum', 30 | 'max', 31 | 'min', 32 | 'average' 33 | ], 34 | RecommendedAggregationMethod: 'sum' 35 | }] 36 | }; 37 | 38 | annotate service.Items { 39 | itemAmount 40 | @Aggregation.default: #sum; 41 | }; 42 | 43 | /*---------->>[ Generic Actions ]<<----------*/ 44 | /*-------------------------------------------*/ 45 | 46 | /*-----> Create Action 47 | 48 | annotate service.Roots with @( 49 | Capabilities.Insertable: false 50 | ); 51 | 52 | <-----*/ 53 | 54 | /*-----> Edit Action 55 | 56 | annotate service.Roots with @( 57 | Capabilities.Updatable: false 58 | ); 59 | 60 | <-----*/ 61 | 62 | /*-----> Delete Action 63 | 64 | annotate service.Roots with @( 65 | Capabilities.Deletable: false 66 | ); 67 | 68 | <-----*/ 69 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "es2022": true, 5 | "node": true, 6 | "jest": true, 7 | "mocha": true 8 | }, 9 | "globals": { 10 | "SELECT": true, 11 | "INSERT": true, 12 | "UPSERT": true, 13 | "UPDATE": true, 14 | "DELETE": true, 15 | "CREATE": true, 16 | "DROP": true, 17 | "CDL": true, 18 | "CQL": true, 19 | "CXL": true, 20 | "cds": true 21 | }, 22 | "rules": { 23 | "no-console": "off", 24 | "require-atomic-updates": "off" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-fe-lr-table-views 2 | _out 3 | *.db 4 | *.sqlite 5 | connection.properties 6 | default-*.json 7 | .cdsrc-private.json 8 | gen/ 9 | node_modules/ 10 | target/ 11 | 12 | # Web IDE, App Studio 13 | .che/ 14 | .gen/ 15 | 16 | # MTA 17 | *_mta_build_tmp 18 | *.mtar 19 | mta_archives/ 20 | 21 | # Other 22 | .DS_Store 23 | *.orig 24 | *.log 25 | 26 | *.iml 27 | *.flattened-pom.xml 28 | 29 | # IDEs 30 | # .vscode 31 | # .idea 32 | 33 | # @cap-js/cds-typer 34 | @cds-models 35 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository is an showcase for presenting table in a List Report with different settings using SAP Cloud Application Programming Model (CAP) and SAP Fiori Elements. 4 | 5 | [CAP with Fiori Elements: Configure Multiple Views on List Report Tables](https://blogs.sap.com/2023/12/25/cap-with-fiori-elements-configure-multiple-views-on-list-report-tables/) 6 | 7 | ## Getting Started 8 | 9 | File or Folder | Purpose 10 | ---------|---------- 11 | `app/` | content for UI frontends goes here 12 | `db/` | your domain models and data go here 13 | `srv/` | your service models and code go here 14 | `package.json` | project metadata and configuration 15 | `readme.md` | this getting started guide 16 | 17 | 18 | ## Local Run 19 | 20 | - Clone this git repo and Open cap-fe-lr-table-views folder in a new terminal 21 | - install dependencies by running npm install 22 | - run `cds watch` to start the cap application. 23 | 24 | 25 | ## Learn More 26 | 27 | Learn more at https://cap.cloud.sap/docs/get-started/. 28 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/services.cds: -------------------------------------------------------------------------------- 1 | 2 | using from './ui01/annotations'; 3 | 4 | using from './ui02/annotations'; 5 | 6 | using from './ui03/annotations'; 7 | 8 | using from './ui04/annotations'; 9 | 10 | using from './ui05/annotations'; -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Tue Dec 19 2023 09:25:35 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.11.0| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/cap_fe_lr_table_views/ 11 | |**Module Name**
ui01| 12 | |**Application Title**
Single Table - Segmented View| 13 | |**Namespace**
cap.fe.lr.table.views| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.120.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
None| 21 | 22 | ## ui01 23 | 24 | Single Table - Segmented View 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/ui01/webapp/index.html 31 | 32 | #### Pre-requisites: 33 | 34 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 35 | 36 | 37 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui01", 3 | "version": "0.0.1", 4 | "description": "Single Table - Segmented View", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.lr.table.views.ui01 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.lr.table.views.ui01.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.lr.table.views.ui01 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Single Table - Segmented View 7 | 8 | #YDES: Application description 9 | appDescription=Single Table - Segmented View -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Single Table - Segmented View 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheOrdersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheOrdersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheOrdersList.onTable().iCheckRows(); 22 | 23 | When.onTheOrdersList.onTable().iPressRow(0); 24 | Then.onTheOrdersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'cap/fe/lr/table/views/ui01/test/integration/FirstJourney', 5 | 'cap/fe/lr/table/views/ui01/test/integration/pages/OrdersList', 6 | 'cap/fe/lr/table/views/ui01/test/integration/pages/OrdersObjectPage' 7 | ], 8 | function(JourneyRunner, opaJourney, OrdersList, OrdersObjectPage) { 9 | 'use strict'; 10 | var JourneyRunner = new JourneyRunner({ 11 | // start index.html in web folder 12 | launchUrl: sap.ui.require.toUrl('cap/fe/lr/table/views/ui01') + '/index.html' 13 | }); 14 | 15 | 16 | JourneyRunner.run( 17 | { 18 | pages: { 19 | onTheOrdersList: OrdersList, 20 | onTheOrdersObjectPage: OrdersObjectPage 21 | } 22 | }, 23 | opaJourney.run 24 | ); 25 | } 26 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/integration/pages/OrdersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui01', 12 | componentId: 'OrdersList', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/integration/pages/OrdersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui01', 12 | componentId: 'OrdersObjectPage', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui01/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Tue Dec 19 2023 17:49:25 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.11.0| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/cap_fe_lr_table_views/ 11 | |**Module Name**
ui02| 12 | |**Application Title**
Multiple Table - Tab View| 13 | |**Namespace**
cap.fe.lr.table.views| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.120.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
items| 21 | 22 | ## ui02 23 | 24 | Multiple Table - Tab View 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/ui02/webapp/index.html 31 | 32 | #### Pre-requisites: 33 | 34 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 35 | 36 | 37 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui02", 3 | "version": "0.0.1", 4 | "description": "Multiple Table - Tab View", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.lr.table.views.ui02 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.lr.table.views.ui02.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.lr.table.views.ui02 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Multiple Table - Tab View 7 | 8 | #YDES: Application description 9 | appDescription=Multiple Table - Tab View -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Multiple Table - Tab View 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheOrdersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheOrdersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheOrdersList.onTable().iCheckRows(); 22 | 23 | When.onTheOrdersList.onTable().iPressRow(0); 24 | Then.onTheOrdersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'cap/fe/lr/table/views/ui02/test/integration/FirstJourney', 5 | 'cap/fe/lr/table/views/ui02/test/integration/pages/OrdersList', 6 | 'cap/fe/lr/table/views/ui02/test/integration/pages/OrdersObjectPage', 7 | 'cap/fe/lr/table/views/ui02/test/integration/pages/OrderItemsObjectPage' 8 | ], 9 | function(JourneyRunner, opaJourney, OrdersList, OrdersObjectPage, OrderItemsObjectPage) { 10 | 'use strict'; 11 | var JourneyRunner = new JourneyRunner({ 12 | // start index.html in web folder 13 | launchUrl: sap.ui.require.toUrl('cap/fe/lr/table/views/ui02') + '/index.html' 14 | }); 15 | 16 | 17 | JourneyRunner.run( 18 | { 19 | pages: { 20 | onTheOrdersList: OrdersList, 21 | onTheOrdersObjectPage: OrdersObjectPage, 22 | onTheOrderItemsObjectPage: OrderItemsObjectPage 23 | } 24 | }, 25 | opaJourney.run 26 | ); 27 | } 28 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/integration/pages/OrderItemsObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui02', 12 | componentId: 'OrderItemsObjectPage', 13 | entitySet: 'OrderItems' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/integration/pages/OrdersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui02', 12 | componentId: 'OrdersList', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/integration/pages/OrdersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui02', 12 | componentId: 'OrdersObjectPage', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui02/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Tue Dec 19 2023 23:55:09 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.11.0| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/cap_fe_lr_table_views/ 11 | |**Module Name**
ui03| 12 | |**Application Title**
Multiple Table & Chart - Tab View| 13 | |**Namespace**
cap.fe.lr.table.views| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.120.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
None| 21 | 22 | ## ui03 23 | 24 | Multiple Table & Chart - Tab View 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/ui03/webapp/index.html 31 | 32 | #### Pre-requisites: 33 | 34 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 35 | 36 | 37 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui03", 3 | "version": "0.0.1", 4 | "description": "Multiple Table & Chart - Tab View", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.lr.table.views.ui03 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.lr.table.views.ui03.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.lr.table.views.ui03 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Multiple Table & Chart - Tab View 7 | 8 | #YDES: Application description 9 | appDescription=Multiple Table & Chart - Tab View -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Multiple Table & Chart - Tab View 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheOrdersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheOrdersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheOrdersList.onTable().iCheckRows(); 22 | 23 | When.onTheOrdersList.onTable().iPressRow(0); 24 | Then.onTheOrdersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'cap/fe/lr/table/views/ui03/test/integration/FirstJourney', 5 | 'cap/fe/lr/table/views/ui03/test/integration/pages/OrdersList', 6 | 'cap/fe/lr/table/views/ui03/test/integration/pages/OrdersObjectPage' 7 | ], 8 | function(JourneyRunner, opaJourney, OrdersList, OrdersObjectPage) { 9 | 'use strict'; 10 | var JourneyRunner = new JourneyRunner({ 11 | // start index.html in web folder 12 | launchUrl: sap.ui.require.toUrl('cap/fe/lr/table/views/ui03') + '/index.html' 13 | }); 14 | 15 | 16 | JourneyRunner.run( 17 | { 18 | pages: { 19 | onTheOrdersList: OrdersList, 20 | onTheOrdersObjectPage: OrdersObjectPage 21 | } 22 | }, 23 | opaJourney.run 24 | ); 25 | } 26 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/integration/pages/OrdersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui03', 12 | componentId: 'OrdersList', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/integration/pages/OrdersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui03', 12 | componentId: 'OrdersObjectPage', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui03/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Wed Dec 20 2023 00:21:54 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.11.0| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/cap_fe_lr_table_views/ 11 | |**Module Name**
ui04| 12 | |**Application Title**
Multiple Table - Tab & Segmented View| 13 | |**Namespace**
cap.fe.lr.table.views| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.120.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
None| 21 | 22 | ## ui04 23 | 24 | Multiple Table - Tab & Segmented View 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/ui04/webapp/index.html 31 | 32 | #### Pre-requisites: 33 | 34 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 35 | 36 | 37 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui04", 3 | "version": "0.0.1", 4 | "description": "Multiple Table - Tab & Segmented View", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.lr.table.views.ui04 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.lr.table.views.ui04.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.lr.table.views.ui04 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Multiple Table - Tab & Segmented View 7 | 8 | #YDES: Application description 9 | appDescription=Multiple Table - Tab & Segmented View -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Multiple Table - Tab & Segmented View 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheOrdersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheOrdersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheOrdersList.onTable().iCheckRows(); 22 | 23 | When.onTheOrdersList.onTable().iPressRow(0); 24 | Then.onTheOrdersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'cap/fe/lr/table/views/ui04/test/integration/FirstJourney', 5 | 'cap/fe/lr/table/views/ui04/test/integration/pages/OrdersList', 6 | 'cap/fe/lr/table/views/ui04/test/integration/pages/OrdersObjectPage' 7 | ], 8 | function(JourneyRunner, opaJourney, OrdersList, OrdersObjectPage) { 9 | 'use strict'; 10 | var JourneyRunner = new JourneyRunner({ 11 | // start index.html in web folder 12 | launchUrl: sap.ui.require.toUrl('cap/fe/lr/table/views/ui04') + '/index.html' 13 | }); 14 | 15 | 16 | JourneyRunner.run( 17 | { 18 | pages: { 19 | onTheOrdersList: OrdersList, 20 | onTheOrdersObjectPage: OrdersObjectPage 21 | } 22 | }, 23 | opaJourney.run 24 | ); 25 | } 26 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/integration/pages/OrdersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui04', 12 | componentId: 'OrdersList', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/integration/pages/OrdersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui04', 12 | componentId: 'OrdersObjectPage', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui04/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Wed Dec 20 2023 09:04:53 GMT+0530 (India Standard Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.11.0| 7 | |**Generation Platform**
Visual Studio Code| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/cap_fe_lr_table_views/ 11 | |**Module Name**
ui05| 12 | |**Application Title**
Multiple Table - Multiple EntitySet| 13 | |**Namespace**
cap.fe.lr.table.views| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.120.3| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
None| 21 | 22 | ## ui05 23 | 24 | Multiple Table - Multiple EntitySet 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/ui05/webapp/index.html 31 | 32 | #### Pre-requisites: 33 | 34 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 35 | 36 | 37 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui05", 3 | "version": "0.0.1", 4 | "description": "Multiple Table - Multiple EntitySet", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.lr.table.views.ui05 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.lr.table.views.ui05.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.lr.table.views.ui05 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Multiple Table - Multiple EntitySet 7 | 8 | #YDES: Application description 9 | appDescription=Multiple Table - Multiple EntitySet -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Multiple Table - Multiple EntitySet 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/integration/FirstJourney.js: -------------------------------------------------------------------------------- 1 | sap.ui.define([ 2 | "sap/ui/test/opaQunit" 3 | ], function (opaTest) { 4 | "use strict"; 5 | 6 | var Journey = { 7 | run: function() { 8 | QUnit.module("First journey"); 9 | 10 | opaTest("Start application", function (Given, When, Then) { 11 | Given.iStartMyApp(); 12 | 13 | Then.onTheOrdersList.iSeeThisPage(); 14 | 15 | }); 16 | 17 | 18 | opaTest("Navigate to ObjectPage", function (Given, When, Then) { 19 | // Note: this test will fail if the ListReport page doesn't show any data 20 | When.onTheOrdersList.onFilterBar().iExecuteSearch(); 21 | Then.onTheOrdersList.onTable().iCheckRows(); 22 | 23 | When.onTheOrdersList.onTable().iPressRow(0); 24 | Then.onTheOrdersObjectPage.iSeeThisPage(); 25 | 26 | }); 27 | 28 | opaTest("Teardown", function (Given, When, Then) { 29 | // Cleanup 30 | Given.iTearDownMyApp(); 31 | }); 32 | } 33 | } 34 | 35 | return Journey; 36 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/integration/opaTests.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Integration tests 5 | 6 | 7 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/integration/opaTests.qunit.js: -------------------------------------------------------------------------------- 1 | sap.ui.require( 2 | [ 3 | 'sap/fe/test/JourneyRunner', 4 | 'cap/fe/lr/table/views/ui05/test/integration/FirstJourney', 5 | 'cap/fe/lr/table/views/ui05/test/integration/pages/OrdersList', 6 | 'cap/fe/lr/table/views/ui05/test/integration/pages/OrdersObjectPage' 7 | ], 8 | function(JourneyRunner, opaJourney, OrdersList, OrdersObjectPage) { 9 | 'use strict'; 10 | var JourneyRunner = new JourneyRunner({ 11 | // start index.html in web folder 12 | launchUrl: sap.ui.require.toUrl('cap/fe/lr/table/views/ui05') + '/index.html' 13 | }); 14 | 15 | 16 | JourneyRunner.run( 17 | { 18 | pages: { 19 | onTheOrdersList: OrdersList, 20 | onTheOrdersObjectPage: OrdersObjectPage 21 | } 22 | }, 23 | opaJourney.run 24 | ); 25 | } 26 | ); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/integration/pages/OrdersList.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ListReport'], function(ListReport) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ListReport( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui05', 12 | componentId: 'OrdersList', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/integration/pages/OrdersObjectPage.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/fe/test/ObjectPage'], function(ObjectPage) { 2 | 'use strict'; 3 | 4 | var CustomPageDefinitions = { 5 | actions: {}, 6 | assertions: {} 7 | }; 8 | 9 | return new ObjectPage( 10 | { 11 | appId: 'cap.fe.lr.table.views.ui05', 12 | componentId: 'OrdersObjectPage', 13 | entitySet: 'Orders' 14 | }, 15 | CustomPageDefinitions 16 | ); 17 | }); -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/testsuite.qunit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | QUnit test suite 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/app/ui05/webapp/test/testsuite.qunit.js: -------------------------------------------------------------------------------- 1 | window.suite = function() { 2 | 'use strict'; 3 | 4 | // eslint-disable-next-line 5 | var oSuite = new parent.jsUnitTestSuite(), 6 | 7 | sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); 8 | oSuite.addTestPage(sContextPath + 'integration/opaTests.qunit.html'); 9 | 10 | return oSuite; 11 | }; -------------------------------------------------------------------------------- /cap-fe-lr-table-views/db/data/cap.fe.lr.table.views.db-Customers.csv: -------------------------------------------------------------------------------- 1 | ID;name 2 | 862;Phoenix Synergy Labs 3 | 2631;QuantumBlend Solutions 4 | 229;NebulaForge Innovations -------------------------------------------------------------------------------- /cap-fe-lr-table-views/db/data/cap.fe.lr.table.views.db-OrderTypes.csv: -------------------------------------------------------------------------------- 1 | ID;descr 2 | SS;Standard Sales Order 3 | CS;Cash Sales Order 4 | RS;Rush Sales Order 5 | RO;Return Order -------------------------------------------------------------------------------- /cap-fe-lr-table-views/db/data/cap.fe.lr.table.views.db-Orders.csv: -------------------------------------------------------------------------------- 1 | ID;descr;type_ID;totalamount;customer_ID 2 | 8419;Order for Nebula;RO;9031723.86;229 3 | 8207;descr3969;SS;95393.78;862 4 | 8320;descr4277;RO;60775119.83;862 5 | 6981;descr4165;RS;1990670.58;229 6 | 9594;descr6924;RS;98646.12;862 7 | 8240;descr379;CS;2909296.75;862 8 | 6441;descr3411;SS;7590609.41;2631 9 | 133;descr4857;CS;1609324.50;2631 10 | 4132;descr5136;CS;40722446.42;2631 11 | 6935;descr8755;SS;85596131.87;229 12 | 820;descr5542;RO;61019830.76;2631 13 | 8548;descr4391;CS;79169865.69;862 14 | 3420;descr6219;CS;54078795.39;2631 15 | 2801;descr7302;RS;94072575.29;862 16 | 7108;descr2442;CS;61804554.71;229 17 | 1092;descr1895;RS;21250844.25;862 18 | 9274;descr9328;CS;87784010.78;862 19 | 5391;descr5445;RO;79888214.19;229 20 | 1734;descr7836;RO;81485127.47;862 21 | 506;descr306;CS;98379404.18;229 22 | 4497;descr3721;SS;25055.75;862 23 | 1614;descr1359;RO;32409778.73;2631 24 | 1961;descr7121;CS;33400.13;862 25 | 9865;descr4547;RS;13111.93;2631 26 | 8666;descr6168;RO;14737923.32;2631 27 | 3124;descr2138;CS;91231.75;2631 28 | 586;descr5408;SS;73784745.70;229 29 | 16;descr3968;RO;53190283.90;2631 30 | 1353;descr6027;RO;37080.67;229 31 | 3934;descr6624;CS;27348826.86;862 32 | 8754;descr5871;CS;22140.62;862 33 | 128;descr6227;RS;43254289.51;2631 34 | 9608;descr5132;RO;29183.59;862 35 | 6804;descr584;CS;38018152.40;2631 36 | 3066;descr9910;RO;22669877.67;229 37 | 1918;descr7662;SS;47770274.23;862 38 | 5926;descr4141;CS;79357588.03;2631 39 | 4304;descr3964;RS;29109353.22;2631 40 | 3149;descr4476;RO;24102064.51;862 41 | 4142;descr3984;RS;53920867.25;229 42 | 5558;descr6360;RO;90864.10;862 43 | 4876;descr3859;RS;21374207.09;862 44 | 2270;descr9516;RO;41582435.25;229 45 | 4210;descr9774;RS;47598757.12;2631 46 | 5176;descr4504;SS;13277052.10;229 47 | 8566;descr8187;RO;37185242.57;862 48 | 2084;descr5460;CS;42972004.94;2631 49 | 5529;descr7349;RS;41064523.41;862 50 | 470;descr3135;SS;13499736.21;229 51 | 983;descr2464;CS;38955113.85;2631 -------------------------------------------------------------------------------- /cap-fe-lr-table-views/db/data/cap.fe.lr.table.views.db-Products.csv: -------------------------------------------------------------------------------- 1 | ID;name 2 | 2796;StellarBlend Elixir 3 | 7428;QuantumQuill Precision Pen 4 | 9130;LunaLuxe Sleep Aid 5 | 4018;ZenithZest Energy Boost 6 | 5321;NebulaNectar Organic Skincare -------------------------------------------------------------------------------- /cap-fe-lr-table-views/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace cap.fe.lr.table.views.db; 2 | 3 | entity Orders { 4 | key ID : Integer; 5 | descr : String(100); 6 | type : Association to one OrderTypes; 7 | items : Composition of many OrderItems 8 | on items.order = $self; 9 | totalamount : Decimal(10, 2); 10 | customer : Association to one Customers; 11 | } 12 | 13 | entity OrderItems { 14 | key ID : Integer; 15 | order : Association to one Orders; 16 | product : Association to one Products; 17 | } 18 | 19 | entity OrderTypes { 20 | key ID : String(2) 21 | @Core.Description: 'Type Id'; 22 | descr : String(100) 23 | @Core.Description: 'Type Description'; 24 | } 25 | 26 | entity Customers { 27 | key ID : Integer; 28 | name : String(200); 29 | } 30 | 31 | entity Products { 32 | key ID : Integer; 33 | name : String(100); 34 | } -------------------------------------------------------------------------------- /cap-fe-lr-table-views/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cap-fe-lr-table-views", 3 | "version": "1.0.0", 4 | "description": "Fiori Elements - List Report - Tables Examples", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@sap/cds": "^7", 10 | "express": "^4" 11 | }, 12 | "devDependencies": { 13 | "@cap-js/sqlite": "^1", 14 | "@sap/ux-specification": "^1.120.1" 15 | }, 16 | "scripts": { 17 | "start": "cds-serve", 18 | "watch-ui01": "cds watch --open ui01/webapp/index.html?sap-ui-xx-viewCache=false", 19 | "watch-ui02": "cds watch --open ui02/webapp/index.html?sap-ui-xx-viewCache=false", 20 | "watch-ui03": "cds watch --open ui03/webapp/index.html?sap-ui-xx-viewCache=false", 21 | "watch-ui04": "cds watch --open ui04/webapp/index.html?sap-ui-xx-viewCache=false", 22 | "watch-ui05": "cds watch --open ui05/webapp/index.html?sap-ui-xx-viewCache=false" 23 | }, 24 | "sapux": [ 25 | "app/ui01", 26 | "app/ui02", 27 | "app/ui03", 28 | "app/ui04", 29 | "app/ui05" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/srv/annotations.cds: -------------------------------------------------------------------------------- 1 | using {cap_fe_lr_table_views_service as service} from './service'; 2 | 3 | annotate service.Orders with @odata.draft.enabled; 4 | annotate service.OrderTypes with @odata.draft.enabled; 5 | annotate service.Customers with @odata.draft.enabled; 6 | annotate service.ItemTotals with @readonly; 7 | annotate service.CustomerTotals with @readonly; 8 | 9 | annotate service.Orders { 10 | totalamount 11 | @Aggregation.default: #sum; 12 | } 13 | 14 | annotate service.Orders with @Aggregation.ApplySupported: { 15 | $Type : 'Aggregation.ApplySupportedType', 16 | Transformations : [ 17 | 'aggregate', 18 | 'groupby', 19 | 'filter', 20 | 'search', 21 | 'concat', 22 | 'skip', 23 | 'orderby', 24 | 'top' 25 | ], 26 | Rollup : #None, 27 | From : false, 28 | GroupableProperties : [ 29 | ID, 30 | descr, 31 | customer_ID, 32 | type_ID 33 | ], 34 | AggregatableProperties: [{ 35 | Property : totalamount, 36 | SupportedAggregationMethods : [ 37 | 'sum', 38 | 'max', 39 | 'min', 40 | 'average' 41 | ], 42 | RecommendedAggregationMethod: 'sum' 43 | }] 44 | }; 45 | 46 | annotate service.CustomerTotals with @Aggregation.ApplySupported: { 47 | $Type : 'Aggregation.ApplySupportedType', 48 | Transformations : [ 49 | 'aggregate', 50 | 'groupby', 51 | 'filter', 52 | 'search', 53 | 'concat', 54 | 'skip', 55 | 'orderby', 56 | 'top' 57 | ], 58 | Rollup : #None, 59 | From : false, 60 | GroupableProperties : [ 61 | ID, 62 | name 63 | ], 64 | AggregatableProperties: [{ 65 | Property : amount, 66 | SupportedAggregationMethods : [ 67 | 'sum', 68 | 'max', 69 | 'min' 70 | ], 71 | RecommendedAggregationMethod: 'sum' 72 | }] 73 | }; 74 | -------------------------------------------------------------------------------- /cap-fe-lr-table-views/srv/service.cds: -------------------------------------------------------------------------------- 1 | using {cap.fe.lr.table.views.db as my} from '../db/schema'; 2 | 3 | @path: '/service/cap_fe_lr_table_views' 4 | service cap_fe_lr_table_views_service { 5 | 6 | entity Orders as 7 | projection on my.Orders { 8 | *, 9 | type : redirected to OrderTypes 10 | }; 11 | 12 | entity OrderItems as projection on my.OrderItems; 13 | entity OrderTypes as projection on my.OrderTypes; 14 | entity Customers as projection on my.Customers; 15 | entity Products as projection on my.Products; 16 | 17 | @cds.redirection.target: false 18 | entity ItemTotals as 19 | projection on my.OrderItems { 20 | product.ID, 21 | product.name, 22 | sum(order.totalamount) as orderamount : Decimal(10, 2) 23 | } 24 | group by product.ID, product.name; 25 | 26 | @cds.redirection.target: false 27 | entity CustomerTotals as 28 | projection on my.Orders { 29 | customer.ID, 30 | customer.name, 31 | sum(totalamount) as amount : Decimal(10, 2) 32 | } 33 | group by customer.ID, customer.name; 34 | } 35 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-fe-sideeffects 2 | _out 3 | *.db 4 | *.sqlite 5 | connection.properties 6 | default-*.json 7 | .cdsrc-private.json 8 | gen/ 9 | node_modules/ 10 | target/ 11 | 12 | # Web IDE, App Studio 13 | .che/ 14 | .gen/ 15 | 16 | # MTA 17 | *_mta_build_tmp 18 | *.mtar 19 | mta_archives/ 20 | 21 | # Other 22 | .DS_Store 23 | *.orig 24 | *.log 25 | 26 | *.iml 27 | *.flattened-pom.xml 28 | 29 | # IDEs 30 | # .vscode 31 | # .idea 32 | app/customers/webapp/test/** 33 | app/orders/webapp/test/** 34 | .vscode/** 35 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository is an showcase for CAP application using Fiori Elements UI with Side Effects, Custom Actions and Dynamic Expression examples. For more info please visit the following blog. 4 | 5 | [CAP with Fiori Elements: Side Effects, Custom Actions, Dynamic Expressions](https://blogs.sap.com/2022/12/23/cap-with-fiori-elements-side-effects-custom-actions-dynamic-expressions/) 6 | 7 | 8 | ## Getting Started 9 | 10 | File or Folder | Purpose 11 | ---------|---------- 12 | `app/` | This has 2 UI frontends i.e. Customers and Orders 13 | `db/` | Data model is defined in schema.cds 14 | `srv/` | Services are defined in service.cds 15 | `package.json` | project metadata and configuration 16 | `readme.md` | this getting started guide 17 | 18 | 19 | ## Next Steps 20 | 21 | - Open a new terminal and run `cds watch` 22 | - (in VS Code simply choose _**Terminal** > Run Task > cds watch_) 23 | 24 | 25 | ## Learn More / Resources 26 | 27 | Learn more at https://cap.cloud.sap/docs/get-started/. 28 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Fri Dec 09 2022 07:02:35 GMT+0000 (Coordinated Universal Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.8.3| 7 | |**Generation Platform**
SAP Business Application Studio| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/admin/ 11 | |**Module Name**
customers| 12 | |**Application Title**
Customers| 13 | |**Namespace**
cap.fe.se| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.108.0| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Customers| 20 | |**Navigation Entity**
addresses| 21 | 22 | ## customers 23 | 24 | Customers 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/customers/webapp/index.html 31 | 32 | - It is also possible to run the application using mock data that reflects the OData Service URL supplied during application generation. In order to run the application with Mock Data, run the following from the generated app root folder: 33 | 34 | ``` 35 | npm run start-mock 36 | ``` 37 | 38 | #### Pre-requisites: 39 | 40 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 41 | 42 | 43 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "customers", 3 | "version": "0.0.1", 4 | "description": "Customers", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.se.customers 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.se.customers.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/webapp/annotations/annotation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.se.customers 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Customers 7 | 8 | #YDES: Application description 9 | appDescription=Customers -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/customers/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Customers 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/README.md: -------------------------------------------------------------------------------- 1 | ## Application Details 2 | | | 3 | | ------------- | 4 | |**Generation Date and Time**
Fri Dec 09 2022 14:59:03 GMT+0000 (Coordinated Universal Time)| 5 | |**App Generator**
@sap/generator-fiori-elements| 6 | |**App Generator Version**
1.8.3| 7 | |**Generation Platform**
SAP Business Application Studio| 8 | |**Template Used**
List Report Page V4| 9 | |**Service Type**
Local Cap| 10 | |**Service URL**
http://localhost:4004/service/admin/ 11 | |**Module Name**
orders| 12 | |**Application Title**
Orders| 13 | |**Namespace**
cap.fe.se| 14 | |**UI5 Theme**
sap_horizon| 15 | |**UI5 Version**
1.108.0| 16 | |**Enable Code Assist Libraries**
False| 17 | |**Enable TypeScript**
False| 18 | |**Add Eslint configuration**
False| 19 | |**Main Entity**
Orders| 20 | |**Navigation Entity**
items| 21 | 22 | ## orders 23 | 24 | Orders 25 | 26 | ### Starting the generated app 27 | 28 | - This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser: 29 | 30 | http://localhost:4004/orders/webapp/index.html 31 | 32 | - It is also possible to run the application using mock data that reflects the OData Service URL supplied during application generation. In order to run the application with Mock Data, run the following from the generated app root folder: 33 | 34 | ``` 35 | npm run start-mock 36 | ``` 37 | 38 | #### Pre-requisites: 39 | 40 | 1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org) 41 | 42 | 43 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/annotations_ca_de.cds: -------------------------------------------------------------------------------- 1 | using orderservice as service from '../../srv/service'; 2 | using from './annotations'; 3 | 4 | annotate service.Orders with @( 5 | Common.DefaultValuesFunction : 'getOrderDefaults' 6 | ); 7 | 8 | annotate service.Orders with @(UI.Identification : [ 9 | { 10 | $Type : 'UI.DataFieldForAction', 11 | Label : 'Set to In Process', 12 | Action : 'orderservice.setOrderProcessing', 13 | ![@UI.Hidden] : {$edmJson : {$Ne : [{$Path : 'status'}, 'Open']}} 14 | }, 15 | { 16 | $Type : 'UI.DataFieldForAction', 17 | Label : 'Set to Open', 18 | Action : 'orderservice.setOrderOpen', 19 | ![@UI.Hidden] : {$edmJson : {$Eq : [{$Path : 'status'},'Open']}} 20 | } 21 | ]); 22 | 23 | annotate service.Orders with @( 24 | UI.UpdateHidden : {$edmJson : {$Eq : [{$Path : 'status'},'In Process']}} 25 | ); 26 | 27 | annotate service.Orders with { 28 | status @Common.FieldControl : {$edmJson : {$If : [{$Ne : [ {$Path : 'status'}, '' ]}, 1, 3 ]}} 29 | }; 30 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/annotations_se.cds: -------------------------------------------------------------------------------- 1 | using orderservice as service from '../../srv/service'; 2 | annotate service.Orders @(Common : { 3 | SideEffects #CustomerChanged : { 4 | SourceProperties : ['customer_ID'], 5 | TargetEntities : [customer, customer.addresses] 6 | } 7 | }); 8 | 9 | annotate service.Orders @(Common : { 10 | SideEffects #ItemChanged : { 11 | SourceEntities : [items], 12 | TargetProperties : ['totamount', 'currency_code'] 13 | } 14 | }); 15 | 16 | annotate service.OrderItems @(Common : { 17 | SideEffects #ProductChanged : { 18 | SourceProperties : ['product_id'], 19 | TargetProperties : ['price', 'currency_code', 'netprice'] 20 | } 21 | }); 22 | 23 | annotate service.OrderItems @(Common : { 24 | SideEffects #QuantityChanged : { 25 | SourceProperties : ['quantity'], 26 | TargetProperties : ['netprice'] 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "orders", 3 | "version": "0.0.1", 4 | "description": "Orders", 5 | "keywords": [ 6 | "ui5", 7 | "openui5", 8 | "sapui5" 9 | ], 10 | "main": "webapp/index.html", 11 | "scripts": { 12 | "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" 13 | }, 14 | "devDependencies": { } 15 | } 16 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/ui5.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "2.5" 2 | metadata: 3 | name: cap.fe.se.orders 4 | type: application 5 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/webapp/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define( 2 | ["sap/fe/core/AppComponent"], 3 | function (Component) { 4 | "use strict"; 5 | 6 | return Component.extend("cap.fe.se.orders.Component", { 7 | metadata: { 8 | manifest: "json" 9 | } 10 | }); 11 | } 12 | ); -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/webapp/annotations/annotation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/webapp/css/custom.css: -------------------------------------------------------------------------------- 1 | .sapUiBody { 2 | width: calc(100% - 24px) !important; 3 | height: calc(100% - 24px) !important; 4 | margin: 12px; 5 | font-family: "72","72full",Arial,Helvetica,sans-serif; 6 | font-size: 1rem; 7 | box-shadow: 6px 6px 12px #afbdea, -6px -6px 12px #afbdea !important; 8 | border-radius: 10px; 9 | background-color: #d6dfee !important; 10 | } 11 | 12 | .sapMNav { 13 | border-radius: 10px; 14 | } -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/webapp/i18n/customI18n.properties: -------------------------------------------------------------------------------- 1 | .sapUiBody { 2 | width: calc(100% - 24px) !important; 3 | height: calc(100% - 24px) !important; 4 | padding: 12px; 5 | font-family: "72","72full",Arial,Helvetica,sans-serif; 6 | font-size: 1rem; 7 | box-shadow: 6px 6px 12px #b8b9be, -6px -6px 12px #fff !important; 8 | } -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/webapp/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | # This is the resource bundle for cap.fe.se.orders 2 | 3 | #Texts for manifest.json 4 | 5 | #XTIT: Application name 6 | appTitle=Orders 7 | 8 | #YDES: Application description 9 | appDescription=Orders -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/orders/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Orders 8 | 13 | 25 | 26 | 27 |
34 | 35 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/app/services.cds: -------------------------------------------------------------------------------- 1 | 2 | using from './customers/annotations'; 3 | 4 | using from './orders/annotations'; 5 | 6 | using from './orders/annotations_se'; 7 | 8 | using from './orders/annotations_ca_de'; 9 | 10 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/db/data/cap.fe.se.ca.de.db-Industries.csv: -------------------------------------------------------------------------------- 1 | id;descr 2 | AFW;Agriculture & Forestry/Wildlife 3 | BUI;Business & Information 4 | CUC;Construction/Utilities/Contracting 5 | EDU;Education 6 | FIN;Finance & Insurance 7 | FNH;Food & Hospitality 8 | HES;Health Services 9 | MVE;Motor Vehicle 10 | NRE;Natural Resources/Environmental 11 | REH;Real Estate & Housing 12 | TRA;Transportation -------------------------------------------------------------------------------- /cap-fe-se-ca-de/db/data/sap.common-Currencies.csv: -------------------------------------------------------------------------------- 1 | code;name;descr;symbol 2 | INR;Indian Rupees;Indian Rupees; 3 | USD;US Dollar;US Dollar; 4 | EUR;Euro;Euro; -------------------------------------------------------------------------------- /cap-fe-se-ca-de/db/data/sap.common-Currencies.texts.csv: -------------------------------------------------------------------------------- 1 | locale;code;name;descr -------------------------------------------------------------------------------- /cap-fe-se-ca-de/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace cap.fe.se.ca.de.db; 2 | 3 | using { 4 | managed, 5 | cuid, 6 | Currency 7 | } from '@sap/cds/common'; 8 | 9 | entity Industries { 10 | key id : String(30); 11 | descr : String(100); 12 | } 13 | 14 | entity Customers : cuid, managed { 15 | firstname : String(50); 16 | lastname : String(50); 17 | industry : Association to one Industries; 18 | addresses : Composition of many Addresses 19 | on addresses.customer = $self; 20 | } 21 | 22 | entity Addresses : cuid, managed { 23 | customer : Association to Customers; 24 | country : String(30); 25 | state : String(30); 26 | city : String(30); 27 | address1 : String(100); 28 | zipcode : String(10); 29 | default : Boolean; 30 | } 31 | 32 | entity Products : managed { 33 | key id : String(50); 34 | text : String(200); 35 | category : String(50); 36 | price : Decimal; 37 | currency : Currency; 38 | } 39 | 40 | entity Orders : cuid, managed { 41 | descr : String(100); 42 | customer : Association to one Customers; 43 | address : String(500); 44 | totamount : Decimal; 45 | currency : Currency; 46 | items: Composition of many OrderItems on items.order = $self; 47 | status: String(20); 48 | } 49 | 50 | entity OrderItems : cuid, managed { 51 | order: Association to Orders; 52 | product : Association to one Products; 53 | quantity : Integer; 54 | price : Decimal; 55 | netprice : Decimal; 56 | currency : Currency; 57 | } 58 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cap-fe-se-ca-de", 3 | "version": "1.0.0", 4 | "description": "A simple CAP project.", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@sap/cds": "^6", 10 | "express": "^4" 11 | }, 12 | "devDependencies": { 13 | "@sap/ux-specification": "^1.102.14", 14 | "sqlite3": "^5.0.4" 15 | }, 16 | "scripts": { 17 | "start": "cds run", 18 | "watch-customers": "cds watch --open customers/webapp/index.html?sap-ui-xx-viewCache=false", 19 | "watch-orders": "cds watch --open orders/webapp/index.html?sap-ui-xx-viewCache=false" 20 | }, 21 | "engines": { 22 | "node": "^16.15" 23 | }, 24 | "eslintConfig": { 25 | "extends": "eslint:recommended", 26 | "env": { 27 | "es2020": true, 28 | "node": true, 29 | "jest": true, 30 | "mocha": true 31 | }, 32 | "globals": { 33 | "SELECT": true, 34 | "INSERT": true, 35 | "UPDATE": true, 36 | "DELETE": true, 37 | "CREATE": true, 38 | "DROP": true, 39 | "CDL": true, 40 | "CQL": true, 41 | "CXL": true, 42 | "cds": true 43 | }, 44 | "rules": { 45 | "no-console": "off", 46 | "require-atomic-updates": "off" 47 | } 48 | }, 49 | "sapux": [ 50 | "app/customers", 51 | "app/orders" 52 | ], 53 | "cds": { 54 | "requires": { 55 | "db": { 56 | "kind": "sqlite", 57 | "credentials": { 58 | "database": "db.sqlite" 59 | } 60 | } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /cap-fe-se-ca-de/srv/capabilities.cds: -------------------------------------------------------------------------------- 1 | using { 2 | adminservice as admin, 3 | orderservice as order 4 | } from './service'; 5 | 6 | annotate admin.Customers with @(odata.draft.enabled : true); 7 | annotate admin.Orders with @(odata.draft.enabled : true); 8 | 9 | annotate order.Customers with @(readonly : true); 10 | annotate order.Addresses with @(readonly : true); 11 | annotate order.Orders with @(odata.draft.enabled : true); 12 | -------------------------------------------------------------------------------- /cap-fe-se-ca-de/srv/service.cds: -------------------------------------------------------------------------------- 1 | using {cap.fe.se.ca.de.db as db} from '../db/schema'; 2 | 3 | service adminservice @(path : 'service/admin') { 4 | 5 | entity Industries as projection on db.Industries; 6 | entity Customers as projection on db.Customers; 7 | entity Addresses as projection on db.Addresses; 8 | entity Products as projection on db.Products; 9 | entity Orders as projection on db.Orders; 10 | entity OrderItems as projection on db.OrderItems; 11 | 12 | } 13 | 14 | service orderservice @(path : 'service/order') { 15 | entity Customers as projection on db.Customers; 16 | entity Addresses as projection on db.Addresses; 17 | entity Products as projection on db.Products; 18 | 19 | entity Orders as projection on db.Orders actions { 20 | 21 | @( cds.odata.bindingparameter.name : '_it', 22 | Common.SideEffects : {TargetProperties : ['_it/status']} ) 23 | action setOrderProcessing(); 24 | 25 | @( cds.odata.bindingparameter.name : '_it', 26 | Common.SideEffects : {TargetProperties : ['_it/status']} ) 27 | action setOrderOpen(); 28 | 29 | }; 30 | 31 | function getOrderDefaults() returns Orders; 32 | } 33 | -------------------------------------------------------------------------------- /cap-media-malware/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cap-media-malware/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-media-malware 2 | _out 3 | *.db 4 | *.sqlite 5 | connection.properties 6 | default-*.json 7 | .cdsrc-private.json 8 | gen/ 9 | node_modules/ 10 | target/ 11 | 12 | # Web IDE, App Studio 13 | .che/ 14 | .gen/ 15 | 16 | # MTA 17 | *_mta_build_tmp 18 | *.mtar 19 | mta_archives/ 20 | 21 | # Other 22 | .DS_Store 23 | *.orig 24 | *.log 25 | 26 | *.iml 27 | *.flattened-pom.xml 28 | 29 | # IDEs 30 | # .vscode 31 | # .idea 32 | -------------------------------------------------------------------------------- /cap-media-malware/.npmrc: -------------------------------------------------------------------------------- 1 | registry = 'https://registry.npmjs.org/' 2 | -------------------------------------------------------------------------------- /cap-media-malware/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository is an showcase about how to build cap application that allows users to upload files and check them for malware integrating SAP Malware Scanning Service on BTP. 4 | 5 | For more info please visit the following blog. 6 | [CAP: Handling of Media Data with Malware Scanning](https://blogs.sap.com/2023/01/14/cap-handling-of-media-data-with-malware-scanning/) 7 | 8 | ## Getting Started 9 | 10 | It contains these folders and files, following our recommended project layout: 11 | 12 | File or Folder | Purpose 13 | ---------|---------- 14 | `app/` | content for UI frontends goes here 15 | `db/` | your domain models and data go here 16 | `srv/` | your service models and code go here 17 | `package.json` | project metadata and configuration 18 | `readme.md` | this getting started guide 19 | 20 | 21 | ## Next Steps 22 | 23 | - Open a new terminal and run `npm install` to install dependencies 24 | - To build project run `npm run build` 25 | - To deploy project run `npm run deploy` 26 | - To test application use `test.http` 27 | 28 | ## Learn More / Resources 29 | 30 | Learn more at https://cap.cloud.sap/docs/get-started/. 31 | 32 | -------------------------------------------------------------------------------- /cap-media-malware/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace cap.media.db; 2 | 3 | using {cuid} from '@sap/cds/common'; 4 | 5 | entity MediaFiles : cuid { 6 | @Core.MediaType : type 7 | content : LargeBinary; 8 | @Core.IsMediaType : true 9 | type : String; 10 | filename: String; 11 | } -------------------------------------------------------------------------------- /cap-media-malware/db/undeploy.json: -------------------------------------------------------------------------------- 1 | [ 2 | "src/gen/**/*.hdbview", 3 | "src/gen/**/*.hdbindex", 4 | "src/gen/**/*.hdbconstraint" 5 | ] -------------------------------------------------------------------------------- /cap-media-malware/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cap-media-malware", 3 | "version": "1.0.0", 4 | "description": "CAP Media Application with Malware Scanning", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@sap-cloud-sdk/openapi": "^2.14.0", 10 | "@sap/cds": "^6", 11 | "express": "^4", 12 | "hdb": "^0.19.0", 13 | "@sap/xssec": "^3", 14 | "passport": "^0" 15 | }, 16 | "devDependencies": { 17 | "@sap-cloud-sdk/openapi-generator": "^2.14.0", 18 | "sqlite3": "^5.0.4" 19 | }, 20 | "scripts": { 21 | "start": "cds run", 22 | "undeploy": "cf undeploy cap-media-malware --delete-services --delete-service-keys --delete-service-brokers", 23 | "build": "rimraf resources mta_archives && mbt build --mtar archive", 24 | "deploy": "cf deploy mta_archives/archive.mtar --retries 1" 25 | }, 26 | "engines": { 27 | "node": "^16.15" 28 | }, 29 | "eslintConfig": { 30 | "extends": "eslint:recommended", 31 | "env": { 32 | "es2020": true, 33 | "node": true, 34 | "jest": true, 35 | "mocha": true 36 | }, 37 | "globals": { 38 | "SELECT": true, 39 | "INSERT": true, 40 | "UPDATE": true, 41 | "DELETE": true, 42 | "CREATE": true, 43 | "DROP": true, 44 | "CDL": true, 45 | "CQL": true, 46 | "CXL": true, 47 | "cds": true 48 | }, 49 | "rules": { 50 | "no-console": "off", 51 | "require-atomic-updates": "off" 52 | } 53 | }, 54 | "cds": { 55 | "requires": { 56 | "db": { 57 | "kind": "hana-cloud" 58 | }, 59 | "auth": { 60 | "kind": "xsuaa" 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/default-api.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; 7 | import type { ScanResult, Status } from './schema'; 8 | /** 9 | * Representation of the 'DefaultApi'. 10 | * This API is part of the 'MalwareScanAPI' service. 11 | */ 12 | export declare const DefaultApi: { 13 | /** 14 | * Use to scan unstructured data on upload. We recommend scanning on download if more than 3 days have passed since upload. Maximum file size is 400 MB. For archives, the extracted size must not exceed 1000 MB and single files no more than 500 MB. The archive must not contain more than 10,000 files or more than 31 recursively nested archives. 15 | * @param body - The request body must be plain file binaries. Full swagger integration comes with OpenAPI 3.0 ( https://swagger.io/docs/specification/describing-request-body/file-upload/ ). 16 | * @returns The request builder, use the `execute()` method to trigger the request. 17 | */ 18 | createScan: (body: any | undefined) => OpenApiRequestBuilder; 19 | /** 20 | * Returns the name and version of the scan engine, the age of the malware signatures, and any file size limitations. 21 | * @returns The request builder, use the `execute()` method to trigger the request. 22 | */ 23 | getInfo: () => OpenApiRequestBuilder; 24 | }; 25 | //# sourceMappingURL=default-api.d.ts.map 26 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/default-api.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"default-api.d.ts","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACnD;;;GAGG;AACH,eAAO,MAAM,UAAU;IACrB;;;;OAIG;uBACgB,GAAG,GAAG,SAAS;IAIlC;;;OAGG;;CAEJ,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/default-api.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.DefaultApi = void 0; 4 | /* 5 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 6 | * 7 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 8 | */ 9 | const openapi_1 = require("@sap-cloud-sdk/openapi"); 10 | /** 11 | * Representation of the 'DefaultApi'. 12 | * This API is part of the 'MalwareScanAPI' service. 13 | */ 14 | exports.DefaultApi = { 15 | /** 16 | * Use to scan unstructured data on upload. We recommend scanning on download if more than 3 days have passed since upload. Maximum file size is 400 MB. For archives, the extracted size must not exceed 1000 MB and single files no more than 500 MB. The archive must not contain more than 10,000 files or more than 31 recursively nested archives. 17 | * @param body - The request body must be plain file binaries. Full swagger integration comes with OpenAPI 3.0 ( https://swagger.io/docs/specification/describing-request-body/file-upload/ ). 18 | * @returns The request builder, use the `execute()` method to trigger the request. 19 | */ 20 | createScan: (body) => new openapi_1.OpenApiRequestBuilder('post', '/scan', { 21 | body 22 | }), 23 | /** 24 | * Returns the name and version of the scan engine, the age of the malware signatures, and any file size limitations. 25 | * @returns The request builder, use the `execute()` method to trigger the request. 26 | */ 27 | getInfo: () => new openapi_1.OpenApiRequestBuilder('get', '/info') 28 | }; 29 | //# sourceMappingURL=default-api.js.map -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/default-api.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAAqB,EAAE,EAAE,CACpC,IAAI,+BAAqB,CAAa,MAAM,EAAE,OAAO,EAAE;QACrD,IAAI;KACL,CAAC;IACJ;;;OAGG;IACH,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,+BAAqB,CAAS,KAAK,EAAE,OAAO,CAAC;CACjE,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/default-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; 7 | import type { ScanResult, Status } from './schema'; 8 | /** 9 | * Representation of the 'DefaultApi'. 10 | * This API is part of the 'MalwareScanAPI' service. 11 | */ 12 | export const DefaultApi = { 13 | /** 14 | * Use to scan unstructured data on upload. We recommend scanning on download if more than 3 days have passed since upload. Maximum file size is 400 MB. For archives, the extracted size must not exceed 1000 MB and single files no more than 500 MB. The archive must not contain more than 10,000 files or more than 31 recursively nested archives. 15 | * @param body - The request body must be plain file binaries. Full swagger integration comes with OpenAPI 3.0 ( https://swagger.io/docs/specification/describing-request-body/file-upload/ ). 16 | * @returns The request builder, use the `execute()` method to trigger the request. 17 | */ 18 | createScan: (body: any | undefined) => 19 | new OpenApiRequestBuilder('post', '/scan', { 20 | body 21 | }), 22 | /** 23 | * Returns the name and version of the scan engine, the age of the malware signatures, and any file size limitations. 24 | * @returns The request builder, use the `execute()` method to trigger the request. 25 | */ 26 | getInfo: () => new OpenApiRequestBuilder('get', '/info') 27 | }; 28 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | export * from './default-api'; 7 | export * from './schema'; 8 | //# sourceMappingURL=index.d.ts.map 9 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAKA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 14 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 15 | }; 16 | Object.defineProperty(exports, "__esModule", { value: true }); 17 | /* 18 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 19 | * 20 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 21 | */ 22 | __exportStar(require("./default-api"), exports); 23 | __exportStar(require("./schema"), exports); 24 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,gDAA8B;AAC9B,2CAAyB"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | export * from './default-api'; 7 | export * from './schema'; 8 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | export * from './scan-result'; 7 | export * from './return-message'; 8 | export * from './status'; 9 | //# sourceMappingURL=index.d.ts.map 10 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/index.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAKA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 3 | if (k2 === undefined) k2 = k; 4 | var desc = Object.getOwnPropertyDescriptor(m, k); 5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6 | desc = { enumerable: true, get: function() { return m[k]; } }; 7 | } 8 | Object.defineProperty(o, k2, desc); 9 | }) : (function(o, m, k, k2) { 10 | if (k2 === undefined) k2 = k; 11 | o[k2] = m[k]; 12 | })); 13 | var __exportStar = (this && this.__exportStar) || function(m, exports) { 14 | for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 15 | }; 16 | Object.defineProperty(exports, "__esModule", { value: true }); 17 | /* 18 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 19 | * 20 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 21 | */ 22 | __exportStar(require("./scan-result"), exports); 23 | __exportStar(require("./return-message"), exports); 24 | __exportStar(require("./status"), exports); 25 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,gDAA8B;AAC9B,mDAAiC;AACjC,2CAAyB"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | export * from './scan-result'; 7 | export * from './return-message'; 8 | export * from './status'; 9 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/return-message.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | /** 7 | * Representation of the 'ReturnMessage' schema. 8 | */ 9 | export type ReturnMessage = 10 | | { 11 | /** 12 | * Provides a description of the return code. 13 | */ 14 | message?: string; 15 | } 16 | | Record; 17 | //# sourceMappingURL=return-message.d.ts.map 18 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/return-message.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"return-message.d.ts","sourceRoot":"","sources":["return-message.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB;IACE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/return-message.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /* 3 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 4 | * 5 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 6 | */ 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | //# sourceMappingURL=return-message.js.map -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/return-message.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"return-message.js","sourceRoot":"","sources":["return-message.ts"],"names":[],"mappings":";AAAA;;;;GAIG"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/return-message.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | 7 | /** 8 | * Representation of the 'ReturnMessage' schema. 9 | */ 10 | export type ReturnMessage = 11 | | { 12 | /** 13 | * Provides a description of the return code. 14 | */ 15 | message?: string; 16 | } 17 | | Record; 18 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/scan-result.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | /** 7 | * Representation of the 'ScanResult' schema. 8 | */ 9 | export type ScanResult = 10 | | { 11 | /** 12 | * Indicates whether the scan engine detected a threat. 13 | */ 14 | malwareDetected: boolean; 15 | /** 16 | * Indicates whether the file has encrypted parts, which could not be scanned. 17 | */ 18 | encryptedContentDetected: boolean; 19 | /** 20 | * Size in bytes of the scanned file. Use the file size to validate the success of data transmission. 21 | */ 22 | scanSize: number; 23 | /** 24 | * This field may contain information about detected malware. 25 | */ 26 | finding?: string; 27 | /** 28 | * Indicates the detected MIME type for the scanned file. This data may not be reliable and results may vary on different service providers. 29 | */ 30 | mimeType?: string; 31 | /** 32 | * SHA-256 hash of the scanned file. Use the hash to validate the success of data transmission. 33 | */ 34 | SHA256: string; 35 | } 36 | | Record; 37 | //# sourceMappingURL=scan-result.d.ts.map 38 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/scan-result.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"scan-result.d.ts","sourceRoot":"","sources":["scan-result.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB;IACE;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,GACD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/scan-result.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /* 3 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 4 | * 5 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 6 | */ 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | //# sourceMappingURL=scan-result.js.map -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/scan-result.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"scan-result.js","sourceRoot":"","sources":["scan-result.ts"],"names":[],"mappings":";AAAA;;;;GAIG"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/scan-result.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | 7 | /** 8 | * Representation of the 'ScanResult' schema. 9 | */ 10 | export type ScanResult = 11 | | { 12 | /** 13 | * Indicates whether the scan engine detected a threat. 14 | */ 15 | malwareDetected: boolean; 16 | /** 17 | * Indicates whether the file has encrypted parts, which could not be scanned. 18 | */ 19 | encryptedContentDetected: boolean; 20 | /** 21 | * Size in bytes of the scanned file. Use the file size to validate the success of data transmission. 22 | */ 23 | scanSize: number; 24 | /** 25 | * This field may contain information about detected malware. 26 | */ 27 | finding?: string; 28 | /** 29 | * Indicates the detected MIME type for the scanned file. This data may not be reliable and results may vary on different service providers. 30 | */ 31 | mimeType?: string; 32 | /** 33 | * SHA-256 hash of the scanned file. Use the hash to validate the success of data transmission. 34 | */ 35 | SHA256: string; 36 | } 37 | | Record; 38 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/status.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | /** 7 | * Representation of the 'Status' schema. 8 | */ 9 | export type Status = 10 | | { 11 | /** 12 | * Max file size in bytes, accepted by this service instance. 13 | */ 14 | maxScanSize: number; 15 | /** 16 | * Time of the last malware definition update. UTC timestamp is in ISO 8601 format. 17 | */ 18 | signatureTimestamp?: string; 19 | /** 20 | * Version of the scan engine. 21 | */ 22 | engineVersion?: string; 23 | } 24 | | Record; 25 | //# sourceMappingURL=status.d.ts.map 26 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/status.d.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["status.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,MAAM,GACd;IACE;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/status.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /* 3 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 4 | * 5 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 6 | */ 7 | Object.defineProperty(exports, "__esModule", { value: true }); 8 | //# sourceMappingURL=status.js.map -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/status.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"status.js","sourceRoot":"","sources":["status.ts"],"names":[],"mappings":";AAAA;;;;GAIG"} -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/schema/status.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. 3 | * 4 | * This is a generated file powered by the SAP Cloud SDK for JavaScript. 5 | */ 6 | 7 | /** 8 | * Representation of the 'Status' schema. 9 | */ 10 | export type Status = 11 | | { 12 | /** 13 | * Max file size in bytes, accepted by this service instance. 14 | */ 15 | maxScanSize: number; 16 | /** 17 | * Time of the last malware definition update. UTC timestamp is in ISO 8601 format. 18 | */ 19 | signatureTimestamp?: string; 20 | /** 21 | * Version of the scan engine. 22 | */ 23 | engineVersion?: string; 24 | } 25 | | Record; 26 | -------------------------------------------------------------------------------- /cap-media-malware/srv/resources/api-clients/MalwareScanAPI/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2019", 4 | "module": "commonjs", 5 | "lib": ["esnext"], 6 | "declaration": true, 7 | "declarationMap": true, 8 | "sourceMap": true, 9 | "diagnostics": true, 10 | "moduleResolution": "node", 11 | "esModuleInterop": true, 12 | "inlineSources": false, 13 | "strict": true 14 | }, 15 | "include": ["**/*.ts"], 16 | "exclude": ["dist/**/*", "node_modules/**/*"] 17 | } 18 | -------------------------------------------------------------------------------- /cap-media-malware/srv/service.cds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/btp-cap-demo-usecases/29ca521b076aa6094a996f04e3aca9abf8a1509f/cap-media-malware/srv/service.cds -------------------------------------------------------------------------------- /cap-media-malware/srv/test.txt: -------------------------------------------------------------------------------- 1 | Test file -------------------------------------------------------------------------------- /cap-media-malware/test.http: -------------------------------------------------------------------------------- 1 | @xsuaaHostname = <> 2 | @xsuaaClient = <> 3 | @xsuaaSecret = <> 4 | @host = <> 5 | @protocol = https 6 | 7 | 8 | ### Request-1 Get xsuaa token 9 | #==================================================================# 10 | # @name getXsuaaToken 11 | 12 | POST {{xsuaaHostname}}/oauth/token 13 | Accept: application/json 14 | Content-Type: application/x-www-form-urlencoded 15 | Authorization: Basic {{xsuaaClient}}:{{xsuaaSecret}} 16 | 17 | client_id={{xsuaaClient}} 18 | &client_secret={{xsuaaSecret}} 19 | &grant_type=client_credentials 20 | 21 | 22 | ### Store access token 23 | @access_token = {{getXsuaaToken.response.body.$.access_token}} 24 | 25 | ### Request-2 Create entry in MediaFiles 26 | #==================================================================# 27 | # @name postMediaEntry 28 | POST {{protocol}}://{{host}}/media/MediaFiles 29 | Authorization: Bearer {{access_token}} 30 | Content-Type: application/json 31 | 32 | { 33 | "type": "text/plain", 34 | "filename": "malware.test.txt" 35 | } 36 | ### Request-3 Update file with Malware 37 | #==================================================================# 38 | PUT {{protocol}}://{{host}}/media/MediaFiles({{postMediaEntry.response.body.$.ID}})/content 39 | Authorization: Bearer {{access_token}} 40 | Content-Type: text/plain 41 | 42 | < ./srv/malware.test.txt 43 | 44 | ### Request-4 PUT Request 45 | #==================================================================# 46 | PUT {{protocol}}://{{host}}/media/MediaFiles({{postMediaEntry.response.body.$.ID}})/content 47 | Authorization: Bearer {{access_token}} 48 | Content-Type: text/plain 49 | 50 | < ./srv/test.txt 51 | 52 | 53 | ### Request-5 Read file Content 54 | #==================================================================# 55 | GET {{protocol}}://{{host}}/media/MediaFiles({{postMediaEntry.response.body.$.ID}})/content 56 | Authorization: Bearer {{access_token}} 57 | -------------------------------------------------------------------------------- /cap-media-malware/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopes": [], 3 | "attributes": [], 4 | "role-templates": [] 5 | } -------------------------------------------------------------------------------- /cap_resilient_timeout/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cap_resilient_timeout/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "es2022": true, 5 | "node": true, 6 | "jest": true, 7 | "mocha": true 8 | }, 9 | "globals": { 10 | "SELECT": true, 11 | "INSERT": true, 12 | "UPSERT": true, 13 | "UPDATE": true, 14 | "DELETE": true, 15 | "CREATE": true, 16 | "DROP": true, 17 | "CDL": true, 18 | "CQL": true, 19 | "CXL": true, 20 | "cds": true 21 | }, 22 | "rules": { 23 | "no-console": "off", 24 | "require-atomic-updates": "off" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cap_resilient_timeout/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap_resilient_timeout 2 | _out 3 | *.db 4 | *.sqlite 5 | connection.properties 6 | default-*.json 7 | .cdsrc-private.json 8 | gen/ 9 | node_modules/ 10 | target/ 11 | 12 | # Web IDE, App Studio 13 | .che/ 14 | .gen/ 15 | 16 | # MTA 17 | *_mta_build_tmp 18 | *.mtar 19 | mta_archives/ 20 | 21 | # Other 22 | .DS_Store 23 | *.orig 24 | *.log 25 | 26 | *.iml 27 | *.flattened-pom.xml 28 | 29 | # IDEs 30 | # .vscode 31 | # .idea 32 | -------------------------------------------------------------------------------- /cap_resilient_timeout/README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository is an showcase for resilience pattern called timeouts within the context of developing applications on BTP using the Cloud Application Programming Model (CAP). For more info please visit the following blog. 4 | 5 | [#SAPCAP: Resilience Pattern – Timeouts using CDS Middleware and Plugin Approach](https://blogs.sap.com/2023/11/09/sapcap-resilience-pattern-timeouts-using-cds-middleware-and-plugin-approach/) 6 | 7 | 8 | ## Getting Started 9 | 10 | File or Folder | Purpose 11 | ---------|---------- 12 | `app/` | It contains app router. 13 | `srv/` | Services are defined in service.cds 14 | `package.json` | project metadata and configuration 15 | `readme.md` | this getting started guide 16 | 17 | 18 | ## Local Run and Testing 19 | 20 | - Open cap_resilient_terminal folder in a new terminal and run `cds watch` to start the cap application. 21 | - Open cap_resilient_terminal/app/router folder in terminal and run PORT=4005 npm run start to start the router. 22 | 23 | 24 | ## Learn More / Resources 25 | 26 | Learn more at https://cap.cloud.sap/docs/get-started/. 27 | -------------------------------------------------------------------------------- /cap_resilient_timeout/app/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "approuter", 3 | "dependencies": { 4 | "@sap/approuter": "^14.0.0" 5 | }, 6 | "engines": { 7 | "node": "^18.0.0" 8 | }, 9 | "scripts": { 10 | "start": "node node_modules/@sap/approuter/approuter.js" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /cap_resilient_timeout/app/router/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [ 3 | { 4 | "source": "^/app/(.*)$", 5 | "target": "$1", 6 | "localDir": ".", 7 | "cacheControl": "no-cache, no-store, must-revalidate" 8 | }, 9 | { 10 | "source": "^/appconfig/", 11 | "localDir": ".", 12 | "cacheControl": "no-cache, no-store, must-revalidate" 13 | }, 14 | { 15 | "source": "^/(.*)$", 16 | "authenticationType":"none", 17 | "target": "$1", 18 | "destination": "srv-api", 19 | "csrfProtection": true 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /cap_resilient_timeout/db/undeploy.json: -------------------------------------------------------------------------------- 1 | [ 2 | "src/gen/**/*.hdbview", 3 | "src/gen/**/*.hdbindex", 4 | "src/gen/**/*.hdbconstraint" 5 | ] 6 | -------------------------------------------------------------------------------- /cap_resilient_timeout/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cap_resilient_timeout", 3 | "version": "1.0.0", 4 | "description": "A simple CAP project.", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@sap-cloud-sdk/resilience": "^3.6.0", 10 | "@sap/cds": "^7", 11 | "express": "^4", 12 | "resilience-plugin": "*", 13 | "@sap/cds-hana": "^2", 14 | "@sap/xssec": "^3", 15 | "passport": "^0" 16 | }, 17 | "devDependencies": { 18 | "@cap-js/sqlite": "^1" 19 | }, 20 | "scripts": { 21 | "start": "cds-serve" 22 | }, 23 | "workspaces": ["resilience-plugin"], 24 | "cds": { 25 | "requires": { 26 | "db": "sqlite", 27 | "auth": "mocked" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /cap_resilient_timeout/resilience-plugin/cds-plugin.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | 3 | const cds = require("@sap/cds"); 4 | const resilienceTimeout = require("./resilience_timeout"); 5 | 6 | const options = {}; 7 | options.timeout = 10000; 8 | options.onTimeout = function (req, res) { 9 | let message = { errorCode: "TimeOutError", 10 | errorMessage: "Your request could not processed within a timeframe" }; 11 | res.status(500).send(JSON.stringify(message)); 12 | }; 13 | 14 | cds.middlewares.add(resilienceTimeout.timeoutHandler(options)); 15 | 16 | module.exports = cds.server; 17 | -------------------------------------------------------------------------------- /cap_resilient_timeout/resilience-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "resilience-plugin", 3 | "version": "1.0.0", 4 | "description": "Resilience Plugin(s)", 5 | "main": "cds-plugin.js", 6 | "scripts": { 7 | "test": "node cds-plugin.js" 8 | }, 9 | "keywords": [ 10 | "cap", 11 | "cds-plugin", 12 | "resilience" 13 | ], 14 | "author": "Ajit Kumar Panda", 15 | "license": "ISC" 16 | } 17 | -------------------------------------------------------------------------------- /cap_resilient_timeout/resilience-plugin/resilience_timeout.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | /* eslint-disable no-undef */ 3 | // Default Options: Values and Functions 4 | const DEFAULT_DISABLE_LIST = [ "setHeaders", "write", "send", "json", "status", "type", 5 | "end", "writeHead", "addTrailers", "writeContinue", "append", 6 | "attachment", "download", "format", "jsonp", "location", 7 | "redirect", "render", "sendFile", "sendStatus" ]; 8 | const DEFAULT_TIMEOUT = 10 * 1000; 9 | const DEFAULT_ON_TIMEOUT = function (req, res){ 10 | res.status(503).send({error: 'Service is taking longer than expected. Please retry!'}); 11 | } 12 | 13 | //Implementation: Functions and Handlers 14 | initialiseOptions = (options)=>{ 15 | options = options || {}; 16 | 17 | if (options.timeout && (typeof options.timeout !== 'number' || options.timeout % 1 !== 0 || options.timeout <= 0)) { 18 | throw new Error('Timeout option must be a whole number greater than 0!'); 19 | } 20 | 21 | if (options.onTimeout && typeof options.onTimeout !== 'function') { 22 | throw new Error('onTimeout option must be a function!'); 23 | } 24 | 25 | if (options.disable && !Array.isArray(options.disable)) { 26 | throw new Error('disable option must be an array!'); 27 | } 28 | 29 | options.timeout = options.timeout || DEFAULT_TIMEOUT; 30 | options.onTimeout = options.onTimeout || DEFAULT_ON_TIMEOUT; 31 | options.disableList = options.disableList || DEFAULT_DISABLE_LIST; 32 | return options; 33 | } 34 | 35 | timeoutMiddleware = function (req, res, next){ 36 | req.connection.setTimeout(this.config.timeout); 37 | res.on('timeout', (socket)=>{ 38 | if (!res.headersSent) { 39 | this.config.onTimeout(req, res, next); 40 | this.config.disableList.forEach( method => { 41 | res[method] = function(){console.error(`ERROR: ${method} was called after TimeOut`)}; 42 | }); 43 | } 44 | }); 45 | next(); 46 | } 47 | 48 | timeoutHandler = (options)=>{ 49 | this.config = initialiseOptions(options); 50 | return timeoutMiddleware.bind(this); 51 | } 52 | 53 | module.exports = {timeoutHandler}; -------------------------------------------------------------------------------- /cap_resilient_timeout/srv/service.cds: -------------------------------------------------------------------------------- 1 | 2 | service MyService { 3 | 4 | function getData(wait: Boolean) returns array of String(20); 5 | 6 | } -------------------------------------------------------------------------------- /cap_resilient_timeout/srv/service.js: -------------------------------------------------------------------------------- 1 | const cds = require("@sap/cds"); 2 | const { setTimeout } = require("timers/promises"); 3 | 4 | module.exports = cds.service.impl(async function (srv) { 5 | 6 | srv.on("getData", async (req) => { 7 | 8 | if (req.data.wait && !req.res._headerSent) { 9 | console.log('[DB] reading data from db - started!'); 10 | await setTimeout(5 * 1000); 11 | console.log('[DB] reading data from db - finished!'); 12 | } 13 | 14 | if (req.data.wait && !req.res._headerSent) { 15 | console.log('[API] reading data from api - started!'); 16 | await setTimeout(5 * 1000); 17 | console.log('[API] reading data from api - finished!'); 18 | } 19 | 20 | if (req.data.wait && !req.res._headerSent) { 21 | console.log('processing both sets of data started!'); 22 | await setTimeout(5 * 1000); 23 | console.log('processing both sets of data finished!'); 24 | } 25 | 26 | return ['StringData1', 'StringData2']; 27 | 28 | }) 29 | 30 | }) -------------------------------------------------------------------------------- /cap_resilient_timeout/test.http: -------------------------------------------------------------------------------- 1 | ### Wait=TRUE, Timeout Happens 2 | GET http://localhost:4004/odata/v4/my/getData(wait=true) 3 | 4 | ### Wait=FALSE, Response should be received 5 | GET http://localhost:4004/odata/v4/my/getData(wait=false) 6 | -------------------------------------------------------------------------------- /cap_resilient_timeout/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopes": [], 3 | "attributes": [], 4 | "role-templates": [] 5 | } 6 | -------------------------------------------------------------------------------- /others/Actions_Ticket_Process.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/btp-cap-demo-usecases/29ca521b076aa6094a996f04e3aca9abf8a1509f/others/Actions_Ticket_Process.xlsx -------------------------------------------------------------------------------- /others/BusinessRules_ServiceTicketConfigurations.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/btp-cap-demo-usecases/29ca521b076aa6094a996f04e3aca9abf8a1509f/others/BusinessRules_ServiceTicketConfigurations.zip -------------------------------------------------------------------------------- /others/README.md: -------------------------------------------------------------------------------- 1 | # Other Files 2 | This folder contains files that are used in different blogs. 3 | 4 | ## [Leveraging ‘Events-to-Business Actions Framework’ for SAP Service Cloud Scenario](https://blogs.sap.com/2023/01/27/part-4-leveraging-events-to-business-actions-framework-for-sap-service-cloud-scenario/) 5 | 6 | ### [Actions_Ticket_Process.xlsx](./Actions_Ticket_Process.xlsx) 7 | ### [BusinessRules_ServiceTicketConfiguration](./BusinessRules_ServiceTicketConfigurations.zip) --------------------------------------------------------------------------------