Compare commits
10 Commits
eslint-fla
...
compose-wi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c5a20bdb0 | ||
|
|
afd4df3f39 | ||
|
|
0228841260 | ||
|
|
24ad8a84da | ||
|
|
e3acbb9832 | ||
|
|
2e0a5aeb73 | ||
|
|
191e577e51 | ||
|
|
a9f040edcc | ||
|
|
86fb1d20d3 | ||
|
|
dfb7d80849 |
3
bookshop/cds-plugin.js
Normal file
3
bookshop/cds-plugin.js
Normal file
@@ -0,0 +1,3 @@
|
||||
cds.once('bootstrap',(app)=>{
|
||||
app.serve ('/bookshop') .from ('@capire/bookshop','app/vue')
|
||||
})
|
||||
@@ -21,5 +21,12 @@
|
||||
"genres": "cds serve test/genres.cds",
|
||||
"start": "cds run",
|
||||
"watch": "cds watch"
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"bookshop-services": {
|
||||
"model": "@capire/bookshop"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"@capire/reviews": "*",
|
||||
"@capire/orders": "*",
|
||||
"@capire/common": "*",
|
||||
"@capire/fiori": "*",
|
||||
"@capire/data-viewer": "*",
|
||||
"@sap/cds": ">=5",
|
||||
"express": "^4.17.1"
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
const cds = require ('@sap/cds')
|
||||
|
||||
// Add routes to UIs from imported packages
|
||||
cds.once('bootstrap',(app)=>{
|
||||
app.serve ('/admin-authors') .from ('@capire/fiori','app/admin-authors')
|
||||
app.serve ('/admin-books') .from ('@capire/fiori','app/admin-books')
|
||||
app.serve ('/browse-books') .from ('@capire/fiori','app/browse')
|
||||
})
|
||||
|
||||
// Add mashup logic
|
||||
cds.once('served', require('./srv/mashup'))
|
||||
|
||||
// Add routes to UIs from imported packages
|
||||
cds.once('bootstrap',(app)=>{
|
||||
app.serve ('/bookshop') .from ('@capire/bookshop','app/vue')
|
||||
app.serve ('/reviews') .from ('@capire/reviews','app/vue')
|
||||
app.serve ('/orders') .from('@capire/orders','app/orders')
|
||||
app.serve ('/data') .from('@capire/data-viewer','app/viewer')
|
||||
})
|
||||
|
||||
// Add Swagger UI
|
||||
require('./srv/swagger-ui')
|
||||
|
||||
// Returning cds.server
|
||||
module.exports = cds.server
|
||||
|
||||
// For didactic reasons in capire
|
||||
const { ReviewsService, OrdersService } = cds.requires
|
||||
if (!ReviewsService?.credentials && !OrdersService?.credentials) cds.requires.messaging = false
|
||||
|
||||
@@ -30,13 +30,3 @@ extend Orders with {
|
||||
book : Association to Books on product.ID = book.ID
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add orders fiori app (in case of embedded orders service)
|
||||
using from '@capire/orders/app/fiori';
|
||||
|
||||
// Add data browser
|
||||
using from '@capire/data-viewer';
|
||||
|
||||
// Incorporate pre-build extensions from...
|
||||
using from '@capire/common';
|
||||
|
||||
0
common/cds-plugin.js
Normal file
0
common/cds-plugin.js
Normal file
@@ -4,5 +4,12 @@
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@sap/cds": "*"
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"common-data": {
|
||||
"model": "@capire/common"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
168
compose/app/appconfig/fioriSandboxConfig.json
Normal file
168
compose/app/appconfig/fioriSandboxConfig.json
Normal file
@@ -0,0 +1,168 @@
|
||||
{
|
||||
"services": {
|
||||
"LaunchPage": {
|
||||
"adapter": {
|
||||
"config": {
|
||||
"catalogs": [],
|
||||
"groups": [
|
||||
{
|
||||
"id": "Bookshop",
|
||||
"title": "Bookshop",
|
||||
"isPreset": true,
|
||||
"isVisible": true,
|
||||
"isGroupLocked": false,
|
||||
"tiles": [
|
||||
{
|
||||
"id": "BrowseBooks",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Browse Books",
|
||||
"targetURL": "#Books-display"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "BrowseGenres",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Browse Genres (OData v2)",
|
||||
"targetURL": "#Genres-display"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "Administration",
|
||||
"title": "Administration",
|
||||
"isPreset": true,
|
||||
"isVisible": true,
|
||||
"isGroupLocked": false,
|
||||
"tiles": [
|
||||
{
|
||||
"id": "ManageBooks",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Manage Books",
|
||||
"targetURL": "#Books-manage"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ManageAuthors",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Manage Authors",
|
||||
"targetURL": "#Authors-display"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ManageOrders",
|
||||
"tileType": "sap.ushell.ui.tile.StaticTile",
|
||||
"properties": {
|
||||
"title": "Manage Orders",
|
||||
"targetURL": "#Orders-manage"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"NavTargetResolution": {
|
||||
"config": {
|
||||
"enableClientSideTargetResolution": true
|
||||
}
|
||||
},
|
||||
"ClientSideTargetResolution": {
|
||||
"adapter": {
|
||||
"config": {
|
||||
"inbounds": {
|
||||
"BrowseBooks": {
|
||||
"semanticObject": "Books",
|
||||
"action": "display",
|
||||
"title": "Browse Books",
|
||||
"signature": {
|
||||
"parameters": {
|
||||
"Books.ID": {
|
||||
"renameTo": "ID"
|
||||
},
|
||||
"Authors.books.ID": {
|
||||
"renameTo": "ID"
|
||||
}
|
||||
},
|
||||
"additionalParameters": "ignored"
|
||||
},
|
||||
"resolutionResult": {
|
||||
"applicationType": "SAPUI5",
|
||||
"additionalInformation": "SAPUI5.Component=bookshop",
|
||||
"url": "/browse/webapp"
|
||||
}
|
||||
},
|
||||
"BrowseAuthors": {
|
||||
"semanticObject": "Authors",
|
||||
"action": "display",
|
||||
"title": "Browse Authors",
|
||||
"signature": {
|
||||
"parameters": {
|
||||
"Books.author.ID":{
|
||||
"renameTo": "ID"
|
||||
}
|
||||
},
|
||||
"additionalParameters": "ignored"
|
||||
},
|
||||
"resolutionResult": {
|
||||
"applicationType": "SAPUI5",
|
||||
"additionalInformation": "SAPUI5.Component=authors",
|
||||
"url": "/admin-authors/webapp"
|
||||
}
|
||||
},
|
||||
"BrowseGenres": {
|
||||
"semanticObject": "Genres",
|
||||
"action": "display",
|
||||
"title": "Browse Genres",
|
||||
"signature": {
|
||||
"parameters": {
|
||||
"Genre.ID": {
|
||||
"renameTo": "ID"
|
||||
}
|
||||
},
|
||||
"additionalParameters": "ignored"
|
||||
},
|
||||
"resolutionResult": {
|
||||
"applicationType": "SAPUI5",
|
||||
"additionalInformation": "SAPUI5.Component=genres",
|
||||
"url": "/genres/webapp"
|
||||
}
|
||||
},
|
||||
"ManageBooks": {
|
||||
"semanticObject": "Books",
|
||||
"action": "manage",
|
||||
"title": "Manage Books",
|
||||
"signature": {
|
||||
"parameters": {},
|
||||
"additionalParameters": "allowed"
|
||||
},
|
||||
"resolutionResult": {
|
||||
"applicationType": "SAPUI5",
|
||||
"additionalInformation": "SAPUI5.Component=books",
|
||||
"url": "/admin-books/webapp"
|
||||
}
|
||||
},
|
||||
"ManageOrders": {
|
||||
"semanticObject": "Orders",
|
||||
"action": "manage",
|
||||
"signature": {
|
||||
"parameters": {},
|
||||
"additionalParameters": "allowed"
|
||||
},
|
||||
"resolutionResult": {
|
||||
"applicationType": "SAPUI5",
|
||||
"additionalInformation": "SAPUI5.Component=orders",
|
||||
"url": "/orders/webapp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
compose/package.json
Normal file
12
compose/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@capire/bookstore",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@capire/bookshop": "*",
|
||||
"@capire/reviews": "*",
|
||||
"@capire/fiori": "*",
|
||||
"@capire/orders": "*",
|
||||
"@sap/cds": ">=5",
|
||||
"express": "^4.17.1"
|
||||
}
|
||||
}
|
||||
8
compose/server.js
Normal file
8
compose/server.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const cds = require ('@sap/cds')
|
||||
|
||||
// Add Swagger UI
|
||||
require('./srv/swagger-ui')
|
||||
|
||||
// For didactic reasons in capire
|
||||
const { ReviewsService, OrdersService } = cds.requires
|
||||
if (!ReviewsService?.credentials && !OrdersService?.credentials) cds.requires.messaging = false
|
||||
10
compose/srv/swagger-ui.js
Normal file
10
compose/srv/swagger-ui.js
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Adding Swagger UI - see https://cap.cloud.sap/docs/advanced/openapi
|
||||
const cds = require ('@sap/cds')
|
||||
try {
|
||||
const cds_swagger = require ('cds-swagger-ui-express')
|
||||
cds.once ('bootstrap', app => app.use (cds_swagger()) )
|
||||
} catch (err) {
|
||||
if (err.code !== 'MODULE_NOT_FOUND') throw err
|
||||
}
|
||||
3
data-viewer/cds-plugin.js
Normal file
3
data-viewer/cds-plugin.js
Normal file
@@ -0,0 +1,3 @@
|
||||
cds.once('bootstrap',(app)=>{
|
||||
app.serve ('/data') .from('@capire/data-viewer','app/viewer')
|
||||
})
|
||||
@@ -9,5 +9,12 @@
|
||||
"app",
|
||||
"srv",
|
||||
"index.cds"
|
||||
]
|
||||
}
|
||||
],
|
||||
"cds": {
|
||||
"requires": {
|
||||
"orders-service": {
|
||||
"model": "@capire/data-viewer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
9
fiori/cds-plugin.js
Normal file
9
fiori/cds-plugin.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// install OData v2 adapter
|
||||
const cds = require("@sap/cds")
|
||||
const proxy = require('@cap-js-community/odata-v2-adapter')
|
||||
const opts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
|
||||
cds.once('bootstrap', app => {
|
||||
app.use(proxy(opts)) // install proxy
|
||||
// cds.log('cov2ap','silent') // suppress anoying log outpout, e.g. for `npm run mocha -- --reporter nyan`
|
||||
app.serve ('/fiori-apps') .from ('@capire/fiori','app/fiori-apps.html')
|
||||
})
|
||||
@@ -1 +1,8 @@
|
||||
using from './db/sqlite/index';
|
||||
using from './app/services';
|
||||
using from './app/genres/fiori-service';
|
||||
using from './app/browse/fiori-service';
|
||||
using from './app/admin-books/fiori-service';
|
||||
using from './app/admin-authors/fiori-service';
|
||||
using from './db/common';
|
||||
using from './app/common';
|
||||
@@ -22,6 +22,9 @@
|
||||
"kind": "odata",
|
||||
"model": "@capire/orders"
|
||||
},
|
||||
"self": {
|
||||
"model": "@capire/fiori"
|
||||
},
|
||||
"messaging": {
|
||||
"[production]": {
|
||||
"kind": "enterprise-messaging"
|
||||
|
||||
3
orders/cds-plugin.js
Normal file
3
orders/cds-plugin.js
Normal file
@@ -0,0 +1,3 @@
|
||||
cds.once('bootstrap',(app)=>{
|
||||
app.serve ('/orders') .from('@capire/orders','app/orders')
|
||||
})
|
||||
@@ -4,5 +4,12 @@
|
||||
"dependencies": {
|
||||
"@capire/common": "*",
|
||||
"@sap/cds": ">=5"
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"orders-service": {
|
||||
"model": "@capire/orders"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
package-lock.json
generated
1
package-lock.json
generated
@@ -52,6 +52,7 @@
|
||||
"@capire/bookshop": "*",
|
||||
"@capire/common": "*",
|
||||
"@capire/data-viewer": "*",
|
||||
"@capire/fiori": "*",
|
||||
"@capire/orders": "*",
|
||||
"@capire/reviews": "*",
|
||||
"@sap/cds": ">=5",
|
||||
|
||||
3
reviews/cds-plugin.js
Normal file
3
reviews/cds-plugin.js
Normal file
@@ -0,0 +1,3 @@
|
||||
cds.once('bootstrap',(app)=>{
|
||||
app.serve ('/reviews') .from ('@capire/reviews','app/vue')
|
||||
})
|
||||
@@ -12,6 +12,10 @@
|
||||
},
|
||||
"cds": {
|
||||
"requires": {
|
||||
"ReviewsService": {
|
||||
"kind": "odata",
|
||||
"model": "@capire/reviews"
|
||||
},
|
||||
"messaging": {
|
||||
"[development]": { "kind": "file-based-messaging" },
|
||||
"[hybrid]": { "kind": "enterprise-messaging-shared" },
|
||||
|
||||
Reference in New Issue
Block a user