Skip to content
Merged
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
118 changes: 85 additions & 33 deletions cap-notebook/demoapp/app/common.cds
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,31 @@ annotate my.Books.attachments with @UI: {
{
$Type : 'UI.DataFieldForAction',
Label : 'Link',
Action: 'AdminService.createLink',
Action: 'AdminService.createLink'
}
]
},
{
@UI.Hidden: {$edmJson: {
$If: [
{ $Eq: [ { $Path: 'IsActiveEntity' }, true ] },
true,
{
$If: [
{ $Ne: [ { $Path: 'mimeType' }, 'application/internet-shortcut' ] },
true,
false
]
}
]
}
},
$Type : 'UI.DataFieldForAction',
Label : 'Edit Link',
Action: 'AdminService.editLink',
Action: 'AdminService.editLink',
Inline: true,
IconUrl: 'sap-icon://edit',
@HTML5.CssDefaults: {width: '4%'}
}
],
}
Expand All @@ -115,12 +132,12 @@ annotate Attachments with @Common: {SideEffects #ContentChanged: {
}}{};

annotate my.Books.references with @UI: {
HeaderInfo: {
$Type : 'UI.HeaderInfoType',
TypeName : '{i18n>Attachment}',
TypeNamePlural: '{i18n>Attachments}',
},
LineItem : [
HeaderInfo: {
$Type : 'UI.HeaderInfoType',
TypeName : '{i18n>Attachment}',
TypeNamePlural: '{i18n>Attachments}',
},
LineItem : [
{Value: type, @HTML5.CssDefaults: {width: '10%'}},
{Value: fileName, @HTML5.CssDefaults: {width: '25%'}},
{Value: content, @HTML5.CssDefaults: {width: '0%'}},
Expand All @@ -141,37 +158,55 @@ annotate my.Books.references with @UI: {
{
$Type : 'UI.DataFieldForAction',
Label : 'Link',
Action: 'AdminService.createLink',
Action: 'AdminService.createLink'
}
]
},
{
@UI.Hidden: {$edmJson: {
$If: [
{ $Eq: [ { $Path: 'IsActiveEntity' }, true ] },
true,
{
$If: [
{ $Ne: [ { $Path: 'mimeType' }, 'application/internet-shortcut' ] },
true,
false
]
}
]
}
},
$Type : 'UI.DataFieldForAction',
Label : 'Edit Link',
Action: 'AdminService.editLink',
Action: 'AdminService.editLink',
Inline: true,
IconUrl: 'sap-icon://edit',
@HTML5.CssDefaults: {width: '4%'}
}
],
} {
note @(title: '{i18n>Note}');
fileName @(title: '{i18n>Filename}');
modifiedAt @(odata.etag: null);
content
@Core.ContentDisposition: { Filename: fileName }
@(title: '{i18n>Attachment}');
folderId @UI.Hidden;
repositoryId @UI.Hidden ;
objectId @UI.Hidden ;
mimeType @UI.Hidden;
status @UI.Hidden;
}
{
note @(title: '{i18n>Note}');
fileName @(title: '{i18n>Filename}');
modifiedAt @(odata.etag: null);
content
@Core.ContentDisposition: { Filename: fileName }
@(title: '{i18n>Attachment}');
folderId @UI.Hidden;
repositoryId @UI.Hidden ;
objectId @UI.Hidden ;
mimeType @UI.Hidden;
status @UI.Hidden;
}

annotate my.Books.footnotes with @UI: {
HeaderInfo: {
$Type : 'UI.HeaderInfoType',
TypeName : '{i18n>Attachment}',
TypeNamePlural: '{i18n>Attachments}',
},
LineItem : [
HeaderInfo: {
$Type : 'UI.HeaderInfoType',
TypeName : '{i18n>Attachment}',
TypeNamePlural: '{i18n>Attachments}',
},
LineItem : [
{Value: type, @HTML5.CssDefaults: {width: '10%'}},
{Value: fileName, @HTML5.CssDefaults: {width: '25%'}},
{Value: content, @HTML5.CssDefaults: {width: '0%'}},
Expand All @@ -192,24 +227,41 @@ annotate my.Books.footnotes with @UI: {
{
$Type : 'UI.DataFieldForAction',
Label : 'Link',
Action: 'AdminService.createLink',
Action: 'AdminService.createLink'
}
]
},
{
@UI.Hidden: {$edmJson: {
$If: [
{ $Eq: [ { $Path: 'IsActiveEntity' }, true ] },
true,
{
$If: [
{ $Ne: [ { $Path: 'mimeType' }, 'application/internet-shortcut' ] },
true,
false
]
}
]
}
},
$Type : 'UI.DataFieldForAction',
Label : 'Edit Link',
Action: 'AdminService.editLink',
Action: 'AdminService.editLink',
Inline: true,
IconUrl: 'sap-icon://edit',
@HTML5.CssDefaults: {width: '4%'}
}
],
} {
note @(title: '{i18n>Note}');
fileName @(title: '{i18n>Filename}');
modifiedAt @(odata.etag: null);
content
@Core.ContentDisposition: { Filename: fileName }
@(title: '{i18n>Attachment}');
folderId @UI.Hidden;
@Core.ContentDisposition: { Filename: fileName }
@(title: '{i18n>Attachment}');
folderId @UI.Hidden;
repositoryId @UI.Hidden ;
objectId @UI.Hidden ;
mimeType @UI.Hidden;
Expand Down
13 changes: 10 additions & 3 deletions cap-notebook/demoapp/srv/admin-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ service AdminService @(requires: ['admin','system-user']) {
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$' @Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
);

action editLink(url:String);
action editLink(
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$' @Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
);
action openAttachment() returns String;
}

Expand All @@ -31,7 +33,9 @@ service AdminService @(requires: ['admin','system-user']) {
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$' @Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
);

action editLink(url:String);
action editLink(
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$' @Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
);
action openAttachment() returns String;
}

Expand All @@ -47,7 +51,10 @@ service AdminService @(requires: ['admin','system-user']) {
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$' @Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
);

action editLink(url:String);
action editLink(
@mandatory @assert.format:'^(https?:\/\/)(([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}|localhost)(:\d{2,5})?(\/[^\s]*)?$' @Common.Label:'URL' url: String @UI.Placeholder: 'Example: https://www.example.com'
);
action openAttachment() returns String;
}
}

Loading