diff --git a/.cdsrc.json b/.cdsrc.json index 751f9d85..d7bd9b1f 100644 --- a/.cdsrc.json +++ b/.cdsrc.json @@ -4,11 +4,5 @@ "extensibility": true, "toggles": true }, - "profile": "with-mtx-sidecar", - "cdsc": { - "newParser": true - }, - "sql": { - "native_hana_associations": false - } + "profile": "with-mtx-sidecar" } diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..8f68f1ef --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,44 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "maven" + directories: + - "/" + - "/srv" + schedule: + interval: "weekly" + groups: + all-maven-dependencies: + patterns: + - "*" + ignore: + - dependency-name: "com.sap.cloud.security:*" + versions: + - ">=4" + - dependency-name: "org.springframework.boot:*" + versions: + - ">=4" + - package-ecosystem: "npm" + directories: + - "/" + - "/mtx/sidecar" + - "/db" + - "/app" + schedule: + interval: "weekly" + groups: + all-npm-dependencies: + patterns: + - "*" + ignore: + - dependency-name: "express" + # For Express, ignore all updates for version 5 becaue @sap/cds requires express version 4 + versions: ["5.x"] + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f083578d..521144ea 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -13,6 +13,9 @@ on: - main - postgres +permissions: + contents: read + jobs: build: @@ -20,11 +23,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Set up JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: - java-version: 21 + java-version: 25 distribution: 'sapmachine' - name: Build with Maven run: mvn -ntp -B clean install diff --git a/.reuse/dep5 b/.reuse/dep5 deleted file mode 100644 index 57d1ebed..00000000 --- a/.reuse/dep5 +++ /dev/null @@ -1,29 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: cloud-cap-samples-java -Upstream-Contact: -Source: https://github.com/SAP-samples/cloud-cap-samples-java -Disclaimer: The code in this project may include calls to APIs (“API Calls”) of - SAP or third-party products or services developed outside of this project - (“External Products”). - “APIs” means application programming interfaces, as well as their respective - specifications and implementing code that allows software to communicate with - other software. - API Calls to External Products are not licensed under the open source license - that governs this project. The use of such API Calls and related External - Products are subject to applicable additional agreements with the relevant - provider of the External Products. In no event shall the open source license - that governs this project grant any rights in or to any External Products,or - alter, expand or supersede any terms of the applicable additional agreements. - If you have a valid license agreement with SAP for the use of a particular SAP - External Product, then you may make use of any API Calls included in this - project’s code for that SAP External Product, subject to the terms of such - license agreement. If you do not have a valid license agreement for the use of - a particular SAP External Product, then you may only make use of any API Calls - in this project for that SAP External Product for your internal, non-productive - and non-commercial test and evaluation of such API Calls. Nothing herein grants - you any rights to use or access any SAP External Product, or provide any third - parties the right to use of access any SAP External Product, through API Calls. - -Files: * -Copyright: 2019-2020 SAP SE or an SAP affiliate company and cap-cloud-samples-java -License: Apache-2.0 diff --git a/README.md b/README.md index b652330c..3ff8f8b9 100644 --- a/README.md +++ b/README.md @@ -90,9 +90,9 @@ User Interface related Features: - [Model Localization](https://cap.cloud.sap/docs/guides/i18n) for [English](app/_i18n/i18n.properties) and [German](app/_i18n/i18n_de.properties) language for static texts - [Custom File Upload extension](app/admin/webapp/extension/Upload.js) which provides a button for uploading `CSV` files - A simple Swagger UI for the CatalogService API at -- UI5 [Tree Table](app/genres/webapp/manifest.json) with Value Help for [GenreHierarchy](app/admin/fiori-service.cds) -- [Custom event handlers](https://cap.cloud.sap/docs/java/provisioning-api) for Tree Table such as the [Custom business logic for GenreHierarchy](srv/src/main/java/my/bookshop/handlers/HierarchyHandler.java). - Please note, that Tree Tables must be used with HANA. Custom event handler in this case provides a limited support ment for local testing. +- UI5 [Tree Table](app/genres/webapp/manifest.json) with CRUD requests and Value Help for [GenreHierarchy](app/admin/fiori-service.cds). + Please note, that Tree Tables must be used with HANA (for productive usage) or H2 (for local development and testing). +- [Custom actions](https://cap.cloud.sap/docs/cds/cdl#actions) such as `moveSibling` in the [Admin Service](srv/admin-service.cds). This action demonstrates experimental UI feature [ChangeNextSiblingAction](https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/Hierarchy.md#template_changenextsiblingaction-experimental). The Action implementation is in the [Hierarchy Sibling Action Handler](srv/src/main/java/my/bookshop/handlers/HierarchySiblingActionHandler.java) CDS Maven Plugin Features: diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 00000000..aca2fe39 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,11 @@ +version = 1 +SPDX-PackageName = "cloud-cap-samples-java" +SPDX-PackageSupplier = "" +SPDX-PackageDownloadLocation = "https://github.com/SAP-samples/cloud-cap-samples-java" +SPDX-PackageComment = "The code in this project may include calls to APIs (“API Calls”) of\n SAP or third-party products or services developed outside of this project\n (“External Products”).\n “APIs” means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project’s code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls." + +[[annotations]] +path = "**" +precedence = "aggregate" +SPDX-FileCopyrightText = "2019-2020 SAP SE or an SAP affiliate company and cap-cloud-samples-java" +SPDX-License-Identifier = "Apache-2.0" diff --git a/app/_i18n/i18n.properties b/app/_i18n/i18n.properties index a12b718d..94df904d 100644 --- a/app/_i18n/i18n.properties +++ b/app/_i18n/i18n.properties @@ -5,6 +5,7 @@ Created = Created Modified = Modified ModifiedBy = Modified By General = General +Contents = Contents Details = Details Admin = Administrative Translations = Translations @@ -63,7 +64,11 @@ Text = Text Image = Image Genres = Genres Genre = Genre - +PageNumber = Page Number +Informations = Informations +Page = Page +ContentsLevel = Contents Level +ContentsLevels = Contents Levels AddReview = Add Review Notes = Notes diff --git a/app/_i18n/i18n_de.properties b/app/_i18n/i18n_de.properties index 63c111fb..a134ff55 100644 --- a/app/_i18n/i18n_de.properties +++ b/app/_i18n/i18n_de.properties @@ -5,6 +5,7 @@ Created = Angelegt Modified = Bearbeitet ModifiedBy = Bearbeitet von General = Generelles +Contents = Buchinhalt Details = Details Admin = Administratives Translations = Übersetzungen @@ -63,6 +64,11 @@ Text = Text Image = Bild Genres = Genre Genre = Genre +PageNumber = Seitenzahl +Informations = Informationen +Page = Seite +ContentsLevel = Inhaltsebene +ContentsLevels = Inhaltsebenen AddReview = Rezension hinzufügen diff --git a/app/addresses/webapp/index.html b/app/addresses/webapp/index.html index a59fa7d2..c3592960 100644 --- a/app/addresses/webapp/index.html +++ b/app/addresses/webapp/index.html @@ -13,7 +13,7 @@ + + +
+ + diff --git a/app/browse-genres/webapp/manifest.json b/app/browse-genres/webapp/manifest.json new file mode 100644 index 00000000..3814bfa7 --- /dev/null +++ b/app/browse-genres/webapp/manifest.json @@ -0,0 +1,124 @@ +{ + "_version": "1.8.0", + "sap.app": { + "id": "browse-genres", + "type": "application", + "title": "{{appTitle}}", + "description": "{{appDescription}}", + "applicationVersion": { + "version": "1.0.0" + }, + "dataSources": { + "CatalogService": { + "uri": "/api/browse/", + "type": "OData", + "settings": { + "odataVersion": "4.0" + } + } + }, + "crossNavigation": { + "inbounds": { + "Genres-show": { + "signature": { + "parameters": {}, + "additionalParameters": "allowed" + }, + "semanticObject": "GenreHierarchy", + "action": "show" + } + } + } + }, + "sap.ui5": { + "dependencies": { + "minUI5Version": "1.122.0", + "libs": { + "sap.fe.templates": {} + } + }, + "models": { + "i18n": { + "type": "sap.ui.model.resource.ResourceModel", + "uri": "i18n/i18n.properties" + }, + "": { + "dataSource": "CatalogService", + "settings": { + "synchronizationMode": "None", + "operationMode": "Server", + "autoExpandSelect" : true, + "earlyRequests": true, + "groupProperties": { + "default": { + "submit": "Auto" + } + } + } + } + }, + "routing": { + "routes": [ + { + "pattern": ":?query:", + "name": "GenreHierarchyList", + "target": "GenreHierarchyList" + }, + { + "pattern": "GenreHierarchy({key}):?query:", + "name": "GenreHierarchyDetails", + "target": "GenreHierarchyDetails" + } + ], + "targets": { + "GenreHierarchyList": { + "type": "Component", + "id": "GenreHierarchyList", + "name": "sap.fe.templates.ListReport", + "options": { + "settings" : { + "contextPath" : "/GenreHierarchy", + "navigation" : { + "GenreHierarchy" : { + "detail" : { + "route" : "GenreHierarchyDetails" + } + } + }, + "controlConfiguration": { + "@com.sap.vocabularies.UI.v1.LineItem": { + "tableSettings": { + "hierarchyQualifier": "GenreHierarchyHierarchy", + "type": "TreeTable" + } + } + } + } + } + }, + "GenreHierarchyDetails": { + "type": "Component", + "id": "GenreHierarchyDetails", + "name": "sap.fe.templates.ObjectPage", + "options": { + "settings" : { + "contextPath" : "/GenreHierarchy" + } + } + } + } + }, + "contentDensities": { + "compact": true, + "cozy": true + } + }, + "sap.ui": { + "technology": "UI5", + "fullWidth": false + }, + "sap.fiori": { + "registrationIds": [], + "archeType": "transactional" + } +} diff --git a/app/browse/fiori-service.cds b/app/browse/fiori-service.cds index 953c39dc..fc6e1e59 100644 --- a/app/browse/fiori-service.cds +++ b/app/browse/fiori-service.cds @@ -13,7 +13,7 @@ annotate CatalogService.Books with @(UI : { TypeName : '{i18n>Book}', TypeNamePlural : '{i18n>Books}', Title : {Value : title}, - Description : {Value : author.name} + Description : {Value : author_ID} }, Identification : [ {Value : title}, @@ -161,6 +161,19 @@ annotate CatalogService.Reviews with @(UI : { ]} }); +annotate CatalogService.GenreHierarchy with @UI: { + PresentationVariant : { + $Type : 'UI.PresentationVariantType', + RequestAtLeast: [name], + Visualizations: ['@UI.LineItem'], + }, + LineItem : [{ + $Type: 'UI.DataField', + Value: name, + Label : '{i18n>Genre}' + }], +}; + annotate CatalogService.Books actions { @( Common.SideEffects : { diff --git a/app/browse/webapp/index.html b/app/browse/webapp/index.html index 99f40f32..c65c2de3 100644 --- a/app/browse/webapp/index.html +++ b/app/browse/webapp/index.html @@ -13,7 +13,7 @@ - - +