Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This plugin can be consumed by the CAP application deployed on BTP to store thei
- Display attachments specific to repository: Lists attachments contained in the repository that is configured with the CAP application.
- Custom properties : Provides the capability to define custom properties for attachments.
- Maximum allowed uploads: Provides the capability to define the maximum number of uploads allowed for the user.
- Maximum file size: Provides the capability to specify the maximum file size for attachments.
- Multiple attachment facets: Provides the capability to define multiple attachment facets/sections in the CAP Entity.
- Technical user support: Provides the capability to consume the plugin using technical user.
- Copy attachments: Provides the capability to copy attachments from one entity to another entity.
Expand All @@ -34,6 +35,7 @@ This plugin can be consumed by the CAP application deployed on BTP to store thei
- [Support for Multitenancy](#support-for-multitenancy)
- [Support for Custom Properties](#support-for-custom-properties)
- [Support for Maximum allowed uploads](#support-for-maximum-allowed-uploads)
- [Support for Maximum File Size](#support-for-maximum-file-size)
- [Support for Multiple attachment facets](#support-for-multiple-attachment-facets)
- [Support for Technical user](#support-for-technical-user)
- [Support for Copy attachments](#support-for-copy-attachments)
Expand Down Expand Up @@ -492,6 +494,25 @@ SDM.maxCountErrorMessage = Maximale Anzahl von Anhängen erreicht
>
> Once the maxCount is configured, it is recommended not to alter it. If the maxCount is altered, the previously uploaded documents will still be visible.

## Support for Maximum File Size

This plugin allows you to specify the maximum file size for attachments by using the `@Validation.Maximum` annotation on the attachments content property. When a user attempts to upload a file that exceeds the defined limit, the upload will be rejected with "AttachmentSizeExceeded" error.

Refer the following example from a sample Bookshop app:

```cds

entity Books {
...
attachments: Composition of many Attachments;
}

annotate Books.attachments with {
content @Validation.Maximum : '200MB';
}
```
Supports both decimal (KB, MB, GB, TB) and binary (KiB, MiB, GiB, TiB) units with comprehensive validation and error handling.

## Support for Multiple attachment facets
The plugin supports creating multiple attachment facets or sections, each allowing various documents to be uploaded. The names of these facets are fully customizable. All existing operations available for the default attachment facet are also supported for any additional facets you create.

Expand Down Expand Up @@ -1316,4 +1337,4 @@ We as members, contributors, and leaders pledge to make participation in our com

## Licensing

Copyright 2024 SAP SE or an SAP affiliate company and <your-project> contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-java/sdm).
Copyright 2024 SAP SE or an SAP affiliate company and <your-project> contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cap-java/sdm).
2 changes: 1 addition & 1 deletion sdm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<test-generation-folder>src/test/gen</test-generation-folder>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<attachments_version>1.2.4</attachments_version>
<attachments_version>1.3.0</attachments_version>
<lombok.version>1.18.36</lombok.version>
<jacoco.version>0.8.7</jacoco.version>
<ehcache-version>3.10.8</ehcache-version>
Expand Down
Loading