Skip to content

Commit 04545da

Browse files
committed
Review comments for ReadMe
1 parent 86b5ae3 commit 04545da

1 file changed

Lines changed: 30 additions & 27 deletions

File tree

README.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ This plugin can be consumed by the CAP application deployed on BTP to store thei
1818
- Multiple attachment facets: Provides the capability to define multiple attachment facets/sections in the CAP Entity.
1919
- Technical user support: Provides the capability to consume the plugin using technical user.
2020
- 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.
2522

2623
## Table of Contents
2724

@@ -564,31 +561,15 @@ This plugin provides capability to copy attachments from one entity to another.
564561

565562
## Support for link type attachments
566563

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.
568565
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',
579-
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$'
580-
@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.
586567

587568
### Steps to Enable Row-Press for Open Link
588569

589570
1. **Add the `openAttachment` action to application's service definition**
590571

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.
592573

593574
```cds
594575
action openAttachment() returns String;
@@ -641,7 +622,7 @@ This plugin provides the capability to create, open, rename and delete attachmen
641622

642623
3. **Add controlConfiguration for Row Press**
643624

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)
645626

646627
```json
647628
"controlConfiguration": {
@@ -661,7 +642,7 @@ This plugin provides the capability to create, open, rename and delete attachmen
661642

662643
4. **Register the Custom Controller Extension**
663644

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)
665646

666647
```json
667648
"extends": {
@@ -680,9 +661,31 @@ This plugin provides the capability to create, open, rename and delete attachmen
680661
- Replace `books` in `"controllerName": "books.controller.custom"` with the SAPUI5.Component name from your
681662
`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.
682663

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',
676+
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$'
677+
@Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
678+
);
679+
```
680+
- 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.
684687

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)
686689

687690
```cds
688691
annotate my.Books.attachments with @UI: {

0 commit comments

Comments
 (0)