Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstrate cds-feature-attachments with bookshop #377

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
35a59ed
Add dependency to cds-feature-attachments
mofterdinger Oct 7, 2024
298d31b
Added UI facets with translations
mofterdinger Oct 7, 2024
2e85b8b
fixed wrong target
mofterdinger Oct 7, 2024
925bc98
added further texts
mofterdinger Oct 7, 2024
02fc3d1
use version 1.0.3
mofterdinger Oct 7, 2024
6dc93dc
minor fixes
mofterdinger Oct 7, 2024
708dbfd
Update UI5 to version 1.129.0
mofterdinger Oct 7, 2024
d8964e5
Renamed attachmentsAndLinks to covers
mofterdinger Oct 7, 2024
4bcc3e5
use snapshot again
mofterdinger Oct 8, 2024
c9a10a2
workaround for etag issue
mofterdinger Oct 8, 2024
b650ec1
revert to released version
mofterdinger Oct 8, 2024
697ab0e
Merge branch 'main' into attachments
mofterdinger Oct 8, 2024
68889d6
Revert to UI5 1.128.0 to fix etag issue.
mofterdinger Oct 8, 2024
85c12f6
Downgrade to UI5 1.126.0
mofterdinger Oct 8, 2024
8df1897
Merge branch 'main' into attachments
mofterdinger Oct 9, 2024
dca1976
Update UI5 to 1.126.2
mofterdinger Oct 9, 2024
cdcd3b2
fixed broken link in README.md
mofterdinger Oct 10, 2024
95a2c87
for testing
mofterdinger Oct 10, 2024
bd0a970
disable etag for testing
mofterdinger Oct 10, 2024
2b429b4
Use 1.0.4-SNAPSHOT
mofterdinger Oct 14, 2024
651c17b
use Attachments from cds-feature-attachments-fs
mofterdinger Oct 14, 2024
d825673
revert to standard plugin
mofterdinger Oct 15, 2024
0bf6369
revert changes
mofterdinger Oct 15, 2024
e2460ba
removed unused labels
mofterdinger Oct 15, 2024
286d291
disable etag for testing
mofterdinger Oct 15, 2024
77748bc
fixed model
mofterdinger Oct 15, 2024
d3f4316
Merge branch 'main' into attachments
mofterdinger Oct 16, 2024
c0d552f
enhanced logging
mofterdinger Oct 16, 2024
7c48e06
use css annotations
mofterdinger Oct 17, 2024
e9ac89a
Use snapshot
mofterdinger Oct 17, 2024
0df64a9
Bump cds-feature-attachments to 1.0.4
mofterdinger Oct 22, 2024
749bbac
revert some logging changes
mofterdinger Oct 22, 2024
1641d43
revert formatting change
mofterdinger Oct 22, 2024
def3609
Use 1.0.5-SNAPSHOT
mofterdinger Oct 24, 2024
3f11505
use snapshot
mofterdinger Oct 24, 2024
d56fd14
Revert "Use 1.0.5-SNAPSHOT"
mofterdinger Oct 24, 2024
74ef51b
Revert "use snapshot"
mofterdinger Oct 24, 2024
091e3e8
enable etag on content field again and test with UI5 1.131 SNAPSHOT
mofterdinger Oct 28, 2024
a5d63fc
annotate up_ with UI.Hidden: true
mofterdinger Oct 29, 2024
2bb8afc
use snapshot
mofterdinger Oct 30, 2024
3a9c61b
Use cds-services 3.4.0
mofterdinger Oct 30, 2024
08b4a7e
Merge branch 'main' into attachments
mofterdinger Oct 30, 2024
231fed4
Update pom.xml
mofterdinger Oct 30, 2024
87a18e7
Update pom.xml
mofterdinger Oct 30, 2024
c3f239f
Merge branch 'main' into attachments
mofterdinger Oct 30, 2024
1defce9
increase app router timeout
mofterdinger Nov 4, 2024
ea54fb4
added binding to malware-scanner service
mofterdinger Nov 4, 2024
ad9be09
Removed malware scanner binding
mofterdinger Nov 11, 2024
1d87f11
Use 1.0.5 of cds-feature-attachments
mofterdinger Nov 11, 2024
0be1b6a
Merge branch 'main' into attachments
mofterdinger Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Welcome to the bookshop-java project. It demonstrates how to build business appl
- [Demonstrated Features](#demonstrated-features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Clone Build & Run](#clone-build--run)
- [Clone Build & Run](#clone-build-run)
- [Using VS Code](#using-vs-code)
- [Using Eclipse](#using-eclipse)
- [Building and Running](#building-and-running)
Expand Down
9 changes: 9 additions & 0 deletions app/_i18n/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ AddReview = Add Review
Notes = Notes
Note = Note
ISBN = ISBN

covers = Covers
attachment_content = Content
attachment_mimeType = MIME Type
attachment_fileName = File Name
attachment_status = Status
attachment_note = Note
attachment = Attachment
attachments = Attachments
9 changes: 9 additions & 0 deletions app/_i18n/i18n_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ AddReview = Rezension hinzufügen
Notes = Notizen
Note = Notiz
ISBN = ISBN

covers = Buchcovers
attachment_content = Inhalt
attachment_mimeType = MIME-Typ
attachment_fileName = Dateiname
attachment_status = Status
attachment_note = Notiz
attachment = Anhang
attachments = Anhänge
9 changes: 9 additions & 0 deletions app/admin/fiori-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ annotate AdminService.Books with @(UI : {
Label : '{i18n>Admin}',
Target : '@UI.FieldGroup#Admin'
},
{
$Type : 'UI.ReferenceFacet',
ID : 'AttachmentsFacet',
Label : '{i18n>covers}',
Target : 'covers/@UI.LineItem'
}
],
FieldGroup #General : {Data : [
{Value : title},
Expand Down Expand Up @@ -131,3 +137,6 @@ annotate AdminService.Books actions {
quantity @title : '{i18n>Quantity}'
)
}

// Hides technical field up__ID in View Setitings dialog for Books.covers
annotate AdminService.Books.covers:up_ with @UI.Hidden;
4 changes: 2 additions & 2 deletions app/fiori.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
};
</script>

<script id="sap-ushell-bootstrap" src="https://sapui5.hana.ondemand.com/1.129.0/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/1.129.0/resources/sap-ui-core.js"
<script id="sap-ushell-bootstrap" src="https://sapui5nightly.int.sap.eu2.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can external customers reach this URL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh, not sure, I suggest we wait until SAP UI5 1.131.0 is released. It contains the required fix for the eTag issue.

<script id="sap-ui-bootstrap" src="https://sapui5nightly.int.sap.eu2.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
data-sap-ui-compatVersion="edge"
data-sap-ui-theme="sap_horizon"
Expand Down
2 changes: 2 additions & 0 deletions db/books.cds
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using {
} from '@sap/cds/common';
using my.bookshop.Reviews from './reviews';
using my.bookshop.TechnicalBooleanFlag from './common';
using {sap.attachments.Attachments} from `com.sap.cds/cds-feature-attachments`;

@fiori.draft.enabled
entity Books : cuid, managed {
Expand All @@ -22,6 +23,7 @@ entity Books : cuid, managed {
reviews : Association to many Reviews
on reviews.book = $self;
isReviewable : TechnicalBooleanFlag not null default true;
covers : Composition of many Attachments;
}

entity Authors : cuid, managed {
Expand Down
41 changes: 41 additions & 0 deletions db/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>bookshop-parent</artifactId>
<groupId>my</groupId>
<version>${revision}</version>
</parent>

<artifactId>bookshop-db</artifactId>
<packaging>pom</packaging>

<build>
<plugins>
<plugin>
<groupId>com.sap.cds</groupId>
<artifactId>cds-maven-plugin</artifactId>
<version>${cds.services.version}</version>
<executions>
<execution>
<id>cds.clean</id>
<goals>
<goal>clean</goal>
</goals>
</execution>

<execution>
<id>cds.resolve</id>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
7 changes: 7 additions & 0 deletions mta-multi-tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ modules:
properties:
CDS_MULTITENANCY_APPUI_URL: ~{app-url}
- name: cf-logging
- name: malware-scanner
provides:
- name: srv-api
properties:
Expand Down Expand Up @@ -81,6 +82,7 @@ modules:
url: ~{srv-url}
forwardAuthToken: true
strictSSL: true
timeout: 600000
- name: bookshop-mt-uaa
provides:
- name: app-api
Expand Down Expand Up @@ -133,3 +135,8 @@ resources:
parameters:
service: application-logs
service-plan: lite
- name: malware-scanner
mofterdinger marked this conversation as resolved.
Show resolved Hide resolved
type: org.cloudfoundry.managed-service
parameters:
service: malware-scanner
service-plan: clamav
7 changes: 7 additions & 0 deletions mta-single-tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ modules:
- name: bookshop-hdi-container
- name: bookshop-uaa
- name: cf-logging
- name: malware-scanner
provides:
- name: srv-api
properties:
Expand Down Expand Up @@ -62,6 +63,7 @@ modules:
url: ~{srv-url}
forwardAuthToken: true
strictSSL: true
timeout: 600000
- name: bookshop-uaa
provides:
- name: app-api
Expand Down Expand Up @@ -93,3 +95,8 @@ resources:
parameters:
service: application-logs
service-plan: lite
- name: malware-scanner
type: org.cloudfoundry.managed-service
parameters:
service: malware-scanner
service-plan: clamav
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
<xsuaa.version>3.5.3</xsuaa.version>
<cf-java-logging-support.version>3.8.4</cf-java-logging-support.version>
<cds.cdsdk-version>8.4.0</cds.cdsdk-version>
<cds-feature-attachments.version>1.0.5-SNAPSHOT</cds-feature-attachments.version>
</properties>

<modules>
<module>db</module>
<module>srv</module>
<module>integration-tests</module>
</modules>
Expand Down Expand Up @@ -74,6 +76,14 @@
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-feature-attachments</artifactId>
<version>${cds-feature-attachments.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<!-- JAVA VERSION -->
Expand Down
Loading