Fiori apps with manage authors
Signed-off-by: Daniel <daniel.hutzel@sap.com>
This commit is contained in:
47
fiori/app/admin-authors/fiori-service.cds
Normal file
47
fiori/app/admin-authors/fiori-service.cds
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
using {AdminService} from '@capire/bookshop';
|
||||||
|
|
||||||
|
annotate AdminService.Authors with @odata.draft.enabled;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Authors Object Page
|
||||||
|
//
|
||||||
|
annotate AdminService.Authors with @(UI : {
|
||||||
|
HeaderInfo : {
|
||||||
|
TypeName : 'Author',
|
||||||
|
TypeNamePlural : 'Authors',
|
||||||
|
Description : {Value : lifetime}
|
||||||
|
},
|
||||||
|
Facets : [
|
||||||
|
{
|
||||||
|
$Type : 'UI.ReferenceFacet',
|
||||||
|
Label : '{i18n>Details}',
|
||||||
|
Target : '@UI.FieldGroup#Details'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$Type : 'UI.ReferenceFacet',
|
||||||
|
Label : '{i18n>Books}',
|
||||||
|
Target : 'books/@UI.LineItem'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
FieldGroup #Details : {Data : [
|
||||||
|
{Value : placeOfBirth},
|
||||||
|
{Value : placeOfDeath},
|
||||||
|
{Value : dateOfBirth},
|
||||||
|
{Value : dateOfDeath},
|
||||||
|
{
|
||||||
|
Value : age,
|
||||||
|
Label : '{i18n>Age}'
|
||||||
|
},
|
||||||
|
]},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Workaround to avoid errors for unknown db-specific calculated fields above
|
||||||
|
extend sap.capire.bookshop.Authors with {
|
||||||
|
virtual age : Integer;
|
||||||
|
virtual lifetime : String;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Workaround for Fiori popup for asking user to enter a new UUID on Create
|
||||||
|
annotate AdminService.Authors with { ID @Core.Computed; }
|
||||||
@@ -3,15 +3,15 @@
|
|||||||
"sap.app": {
|
"sap.app": {
|
||||||
"id": "authors",
|
"id": "authors",
|
||||||
"type": "application",
|
"type": "application",
|
||||||
"title": "Browse Authors",
|
"title": "Manage Authors",
|
||||||
"description": "Sample Application",
|
"description": "Sample Application",
|
||||||
"i18n": "i18n/i18n.properties",
|
"i18n": "i18n/i18n.properties",
|
||||||
"applicationVersion": {
|
"applicationVersion": {
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
"dataSources": {
|
"dataSources": {
|
||||||
"CatalogService": {
|
"AdminService": {
|
||||||
"uri": "/browse/",
|
"uri": "/admin/",
|
||||||
"type": "OData",
|
"type": "OData",
|
||||||
"settings": {
|
"settings": {
|
||||||
"odataVersion": "4.0"
|
"odataVersion": "4.0"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"subTitle": "{{appSubTitle}}",
|
"subTitle": "{{appSubTitle}}",
|
||||||
"icon": "sap-icon://SAP-icons-TNT/user",
|
"icon": "sap-icon://SAP-icons-TNT/user",
|
||||||
"indicatorDataSource": {
|
"indicatorDataSource": {
|
||||||
"dataSource": "CatalogService",
|
"dataSource": "AdminService",
|
||||||
"path": "Authors/$count",
|
"path": "Authors/$count",
|
||||||
"refresh": 1800
|
"refresh": 1800
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
"uri": "i18n/i18n.properties"
|
"uri": "i18n/i18n.properties"
|
||||||
},
|
},
|
||||||
"": {
|
"": {
|
||||||
"dataSource": "CatalogService",
|
"dataSource": "AdminService",
|
||||||
"settings": {
|
"settings": {
|
||||||
"synchronizationMode": "None",
|
"synchronizationMode": "None",
|
||||||
"operationMode": "Server",
|
"operationMode": "Server",
|
||||||
@@ -40,27 +40,6 @@ annotate AdminService.Books with @(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
annotate AdminService.Authors with @(
|
|
||||||
UI: {
|
|
||||||
HeaderInfo: {
|
|
||||||
Description: {Value: lifetime}
|
|
||||||
},
|
|
||||||
Facets: [
|
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Books}', Target: 'books/@UI.LineItem'},
|
|
||||||
],
|
|
||||||
FieldGroup#Details: {
|
|
||||||
Data: [
|
|
||||||
{Value: placeOfBirth},
|
|
||||||
{Value: placeOfDeath},
|
|
||||||
{Value: dateOfBirth},
|
|
||||||
{Value: dateOfDeath},
|
|
||||||
{Value: age, Label: '{i18n>Age}'},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@@ -93,3 +72,6 @@ using { sap } from '@sap/cds/common';
|
|||||||
extend service AdminService {
|
extend service AdminService {
|
||||||
@readonly entity Languages as projection on sap.common.Languages;
|
@readonly entity Languages as projection on sap.common.Languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround for Fiori popup for asking user to enter a new UUID on Create
|
||||||
|
annotate AdminService.Books with { ID @Core.Computed; }
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
sap.ui.define(["sap/fe/core/AppComponent"], function(AppComponent) {
|
sap.ui.define(["sap/fe/core/AppComponent"], function(AppComponent) {
|
||||||
"use strict";
|
"use strict";
|
||||||
return AppComponent.extend("admin.Component", {
|
return AppComponent.extend("books.Component", {
|
||||||
metadata: { manifest: "json" }
|
metadata: { manifest: "json" }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_version": "1.8.0",
|
"_version": "1.8.0",
|
||||||
"sap.app": {
|
"sap.app": {
|
||||||
"id": "admin",
|
"id": "books",
|
||||||
"type": "application",
|
"type": "application",
|
||||||
"title": "Manage Books",
|
"title": "Manage Books",
|
||||||
"description": "Sample Application",
|
"description": "Sample Application",
|
||||||
@@ -19,14 +19,6 @@
|
|||||||
"title": "Browse Books",
|
"title": "Browse Books",
|
||||||
"targetURL": "#Books-display"
|
"targetURL": "#Books-display"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "BrowseAuthors",
|
|
||||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
|
||||||
"properties": {
|
|
||||||
"title": "Browse Authors",
|
|
||||||
"targetURL": "#Authors-display"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -45,6 +37,14 @@
|
|||||||
"targetURL": "#Books-manage"
|
"targetURL": "#Books-manage"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "ManageAuthors",
|
||||||
|
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||||
|
"properties": {
|
||||||
|
"title": "Manage Authors",
|
||||||
|
"targetURL": "#Authors-display"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "ManageOrders",
|
"id": "ManageOrders",
|
||||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||||
@@ -75,10 +75,10 @@
|
|||||||
"signature": {
|
"signature": {
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"Books.ID": {
|
"Books.ID": {
|
||||||
"renameTo": "ID"
|
"renameTo": "ID"
|
||||||
},
|
},
|
||||||
"Authors.books.ID": {
|
"Authors.books.ID": {
|
||||||
"renameTo": "ID"
|
"renameTo": "ID"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalParameters": "ignored"
|
"additionalParameters": "ignored"
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
"resolutionResult": {
|
"resolutionResult": {
|
||||||
"applicationType": "SAPUI5",
|
"applicationType": "SAPUI5",
|
||||||
"additionalInformation": "SAPUI5.Component=authors",
|
"additionalInformation": "SAPUI5.Component=authors",
|
||||||
"url": "/authors/webapp"
|
"url": "/admin-authors/webapp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ManageBooks": {
|
"ManageBooks": {
|
||||||
@@ -117,8 +117,8 @@
|
|||||||
},
|
},
|
||||||
"resolutionResult": {
|
"resolutionResult": {
|
||||||
"applicationType": "SAPUI5",
|
"applicationType": "SAPUI5",
|
||||||
"additionalInformation": "SAPUI5.Component=admin",
|
"additionalInformation": "SAPUI5.Component=books",
|
||||||
"url": "/admin/webapp"
|
"url": "/admin-books/webapp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ManageOrders": {
|
"ManageOrders": {
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
using CatalogService from '@capire/bookshop';
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Authors Object Page
|
|
||||||
//
|
|
||||||
annotate CatalogService.Authors with @(UI : {
|
|
||||||
HeaderInfo : {
|
|
||||||
TypeName : 'Author',
|
|
||||||
TypeNamePlural : 'Authors',
|
|
||||||
Description : {Value : name}
|
|
||||||
},
|
|
||||||
HeaderFacets : [{
|
|
||||||
$Type : 'UI.ReferenceFacet',
|
|
||||||
Label : '{i18n>Description}',
|
|
||||||
Target : '@UI.FieldGroup#Descr'
|
|
||||||
}, ],
|
|
||||||
Facets : [{
|
|
||||||
$Type : 'UI.ReferenceFacet',
|
|
||||||
Label : '{i18n>Details}',
|
|
||||||
Target : 'books/@UI.LineItem'
|
|
||||||
}, ],
|
|
||||||
FieldGroup #Descr : {Data : [
|
|
||||||
{Value : name},
|
|
||||||
{Value : dateOfBirth},
|
|
||||||
{Value : dateOfDeath},
|
|
||||||
{Value : placeOfBirth},
|
|
||||||
{Value : placeOfDeath},
|
|
||||||
]},
|
|
||||||
});
|
|
||||||
@@ -8,7 +8,7 @@ annotate CatalogService.Books with @(UI : {
|
|||||||
HeaderInfo : {
|
HeaderInfo : {
|
||||||
TypeName : 'Book',
|
TypeName : 'Book',
|
||||||
TypeNamePlural : 'Books',
|
TypeNamePlural : 'Books',
|
||||||
Description : {Value : authorName}
|
Description : {Value : author}
|
||||||
},
|
},
|
||||||
HeaderFacets : [{
|
HeaderFacets : [{
|
||||||
$Type : 'UI.ReferenceFacet',
|
$Type : 'UI.ReferenceFacet',
|
||||||
@@ -47,7 +47,7 @@ annotate CatalogService.Books with @(UI : {
|
|||||||
Label : '{i18n>Title}'
|
Label : '{i18n>Title}'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Value : author.ID,
|
Value : author,
|
||||||
Label : '{i18n>Author}'
|
Label : '{i18n>Author}'
|
||||||
},
|
},
|
||||||
{Value : genre.name},
|
{Value : genre.name},
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
This model controls what gets served to Fiori frontends...
|
This model controls what gets served to Fiori frontends...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using from './admin/fiori-service';
|
using from './admin-authors/fiori-service';
|
||||||
|
using from './admin-books/fiori-service';
|
||||||
using from './browse/fiori-service';
|
using from './browse/fiori-service';
|
||||||
using from './authors/fiori-service';
|
|
||||||
using from './common';
|
using from './common';
|
||||||
using from '@capire/bookstore/srv/mashup';
|
using from '@capire/bookstore/srv/mashup';
|
||||||
|
|||||||
Reference in New Issue
Block a user