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
66 changes: 66 additions & 0 deletions cap-notebook/demoapp/app/common.cds
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,72 @@ annotate Attachments with @Common: {SideEffects #ContentChanged: {
TargetEntities : [Books.attachments]
}}{};

annotate my.Books.references with @UI: {
HeaderInfo: {
$Type : 'UI.HeaderInfoType',
TypeName : '{i18n>Attachment}',
TypeNamePlural: '{i18n>Attachments}',
},
LineItem : [
{Value: fileName, @HTML5.CssDefaults: {width: '20%'}},
{Value: content, @HTML5.CssDefaults: {width: '20%'}},
{Value: createdAt, @HTML5.CssDefaults: {width: '20%'}},
{Value: createdBy, @HTML5.CssDefaults: {width: '20%'}},
{Value: note, @HTML5.CssDefaults: {width: '20%'}},

{
$Type : 'UI.DataFieldForAction',
Label : 'Copy Attachments',
Action: 'AdminService.copyAttachments',
}
]
} {
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 : [
{Value: fileName, @HTML5.CssDefaults: {width: '20%'}},
{Value: content, @HTML5.CssDefaults: {width: '20%'}},
{Value: createdAt, @HTML5.CssDefaults: {width: '20%'}},
{Value: createdBy, @HTML5.CssDefaults: {width: '20%'}},
{Value: note, @HTML5.CssDefaults: {width: '20%'}},

{
$Type : 'UI.DataFieldForAction',
Label : 'Copy Attachments',
Action: 'AdminService.copyAttachments',
}
]
} {
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;
}

////////////////////////////////////////////////////////////////////////////
//
// Books Elements
Expand Down
10 changes: 10 additions & 0 deletions cap-notebook/demoapp/srv/admin-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ service AdminService @(requires: ['admin','system-user']) {
@(Common.SideEffects : {TargetEntities: ['']},)
action copyAttachments(in:many $self,up__ID:String,objectIds:String);
}
entity Books.references as projection on my.Books.references
actions {
@(Common.SideEffects : {TargetEntities: ['']},)
action copyAttachments(in:many $self,up__ID:String,objectIds:String);
}
entity Books.footnotes as projection on my.Books.footnotes
actions {
@(Common.SideEffects : {TargetEntities: ['']},)
action copyAttachments(in:many $self,up__ID:String,objectIds:String);
}
}
Loading