You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-27Lines changed: 30 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,7 @@ This plugin can be consumed by the CAP application deployed on BTP to store thei
18
18
- Multiple attachment facets: Provides the capability to define multiple attachment facets/sections in the CAP Entity.
19
19
- Technical user support: Provides the capability to consume the plugin using technical user.
20
20
- Copy attachments: Provides the capability to copy attachments from one entity to another entity.
21
-
- Create link: Provides the capability to create a link type of attachment.
22
-
- Open link: Provides the capability the open link.
23
-
- Rename link: Provides the capability to rename links.
24
-
- Delete link: Provides the capability to remove links.
21
+
- Link as attachments: Provides the capability to support link or URL as attachments.
25
22
26
23
## Table of Contents
27
24
@@ -564,31 +561,15 @@ This plugin provides capability to copy attachments from one entity to another.
564
561
565
562
## Support for link type attachments
566
563
567
-
This plugin provides the capability to create, open, rename and delete attachments of link type.
564
+
> **Note:** Row-press is the new recommended approach for handling actions on attachment rows. With row-press enabled, the Attachments column will no longer appear as a separate action button. Instead, clicking on a row will automatically perform the appropriate action — opening a link or downloading a file, based on the attachment type.
568
565
569
-
### Steps to Enable Create Link Feature in CAP Application
570
-
571
-
1.**Add the `createLink` action to application's service definition**
572
-
573
-
See this [example](https://github.com/cap-java/sdm/blob/90cfc716967d844e114457a710daebdd55431965/cap-notebook/demoapp/srv/admin-service.cds#L12) from a sample Bookshop app:
574
-
575
-
```cds
576
-
action createLink(
577
-
in:many $self,
578
-
@mandatory @Common.Label:'Name' name: String @UI.Placeholder: 'Enter a name for the link',
@Common.Label:'URL' url: String @UI.Placeholder: 'Enter the link URL'
581
-
);
582
-
```
583
-
- Purpose: Enables users to create links with name and URL.
584
-
- Validation: Ensures only valid HTTP(S) URLs are accepted.
585
-
- UI Support: Provides labels and placeholders for better user experience.
566
+
This plugin provides the capability to create, open, rename and delete attachments of link type.
586
567
587
568
### Steps to Enable Row-Press for Open Link
588
569
589
570
1.**Add the `openAttachment` action to application's service definition**
590
571
591
-
See this [example](https://github.com/cap-java/sdm/blob/develop_deploy/cap-notebook/demoapp/srv/admin-service.cds) from a sample Bookshop app.
572
+
See this [example](https://github.com/cap-java/sdm/blob/90cfc716967d844e114457a710daebdd55431965/cap-notebook/demoapp/srv/admin-service.cds#L19) from a sample Bookshop app.
592
573
593
574
```cds
594
575
action openAttachment() returns String;
@@ -641,7 +622,7 @@ This plugin provides the capability to create, open, rename and delete attachmen
641
622
642
623
3.**Add controlConfiguration for Row Press**
643
624
644
-
In your `sap.ui5.routing.targets` section, under the relevant Object Page (e.g., `BooksDetails`), add or extend the `controlConfiguration` for the facet you want to enhance by copy and pasting below content:
625
+
In your `sap.ui5.routing.targets` section, under the relevant Object Page (e.g., `BooksDetails`), add or extend the `controlConfiguration` for the facet you want to enhance by copy and pasting below content. See this [example](https://github.com/cap-java/sdm/blob/90cfc716967d844e114457a710daebdd55431965/cap-notebook/demoapp/app/admin-books/webapp/manifest.json#L121)
645
626
646
627
```json
647
628
"controlConfiguration": {
@@ -661,7 +642,7 @@ This plugin provides the capability to create, open, rename and delete attachmen
661
642
662
643
4.**Register the Custom Controller Extension**
663
644
664
-
In the root of your `sap.ui5` section, add or extend the `extends` property to register your custom controller by copy and pasting below content:
645
+
In the root of your `sap.ui5` section, add or extend the `extends` property to register your custom controller by copy and pasting below content. See this [example](https://github.com/cap-java/sdm/blob/90cfc716967d844e114457a710daebdd55431965/cap-notebook/demoapp/app/admin-books/webapp/manifest.json#L159)
665
646
666
647
```json
667
648
"extends": {
@@ -680,9 +661,31 @@ This plugin provides the capability to create, open, rename and delete attachmen
680
661
- Replace `books` in `"controllerName": "books.controller.custom"` with the SAPUI5.Component name from your
681
662
`app/appconfig/fioriSandboxConfig.json` file. Refer this [example](https://github.com/cap-java/sdm/blob/90cfc716967d844e114457a710daebdd55431965/cap-notebook/demoapp/app/appconfig/fioriSandboxConfig.json#L86) from a sample Bookshop app.
682
663
683
-
### UI Annotation Setup**
664
+
### Steps to Enable Create Link Feature in CAP Application
665
+
666
+
> **Note:** Enabling row-press for open link (see steps above) is a prerequisite for link support.
667
+
668
+
1.**Add the `createLink` action to application's service definition**
669
+
670
+
See this [example](https://github.com/cap-java/sdm/blob/90cfc716967d844e114457a710daebdd55431965/cap-notebook/demoapp/srv/admin-service.cds#L12) from a sample Bookshop app:
671
+
672
+
```cds
673
+
action createLink(
674
+
in:many $self,
675
+
@mandatory @Common.Label:'Name' name: String @UI.Placeholder: 'Enter a name for the link',
- Purpose: Enables users to create links with name and URL.
681
+
- Validation: Ensures only valid HTTP(S) URLs are accepted.
682
+
- UI Support: Provides labels and placeholders for better user experience.
683
+
684
+
### UI Annotation Setup
685
+
686
+
To enable the creation of links, you need to add a new button to the attachments table toolbar. This button will appear as a **menu button labeled "Create"** on the toolbar of the attachments table. When clicked, it will display a menu with the **"Link"** option, allowing users to create a new link-type attachment.
684
687
685
-
To enable Create and Link button on the toolbar, add the following annotation block to your app/common.cds file:
688
+
Add the following annotation block to your app/common.cds file. See this [example](https://github.com/cap-java/sdm/blob/4288ce6f58bc415a171a9e0340fa075aeac835ff/cap-notebook/demoapp/app/common.cds#L60)
0 commit comments