diff --git a/packages/bookstore/app/bookList/webapp/Component.js b/packages/bookstore/app/bookList/webapp/Component.js new file mode 100644 index 00000000..3bc9ab27 --- /dev/null +++ b/packages/bookstore/app/bookList/webapp/Component.js @@ -0,0 +1,12 @@ +/* global hasher */ +sap.ui.define([ + "sap/fe/AppComponent" +], function (AppComponent) { + "use strict"; + + return AppComponent.extend("ns.bookList.Component", { + metadata: { + "manifest": "json" + } + }); +}); diff --git a/packages/bookstore/app/bookList/webapp/WEB-INF/web.xml b/packages/bookstore/app/bookList/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..d0c20200 --- /dev/null +++ b/packages/bookstore/app/bookList/webapp/WEB-INF/web.xml @@ -0,0 +1,118 @@ + + + + OData v4 + + + + + + + ResourceServlet + ResourceServlet + com.sap.ui5.resource.ResourceServlet + + + ResourceServlet + /resources/* + + + ResourceServlet + /test-resources/* + + + + + com.sap.ui5.resource.ACCEPTED_ORIGINS + * + + + + + + + com.sap.ui5.resource.DEV_MODE + true + + + + + + + + + + CacheControlFilter + CacheControlFilter + com.sap.ui5.resource.CacheControlFilter + + + CacheControlFilter + *.html + + + CacheControlFilter + *.js + + + CacheControlFilter + *.css + + + CacheControlFilter + *.json + + + CacheControlFilter + *.xml + + + CacheControlFilter + *.gif + + + CacheControlFilter + *.png + + + CacheControlFilter + *.jpg + + + CacheControlFilter + *.properties + + + CacheControlFilter + *.tmpl + + + + + + + + + SimpleProxyServlet + com.sap.ui5.proxy.SimpleProxyServlet + + + SimpleProxyServlet + /proxy/* + + + + + + + + + test.html + + + + \ No newline at end of file diff --git a/packages/bookstore/app/bookList/webapp/i18n/i18n.properties b/packages/bookstore/app/bookList/webapp/i18n/i18n.properties new file mode 100644 index 00000000..de7a26ed --- /dev/null +++ b/packages/bookstore/app/bookList/webapp/i18n/i18n.properties @@ -0,0 +1,7 @@ +# This is the resource bundle for bookList#Texts for manifest.json + +#XTIT: Application name +appTitle=bookList + +#YDES: Application description +appDescription=bookList diff --git a/packages/bookstore/app/bookList/webapp/index.html b/packages/bookstore/app/bookList/webapp/index.html new file mode 100644 index 00000000..de09dcb9 --- /dev/null +++ b/packages/bookstore/app/bookList/webapp/index.html @@ -0,0 +1,39 @@ + + + + + + + + {{appTitle}} + + + + + + + + + + \ No newline at end of file diff --git a/packages/bookstore/app/bookList/webapp/manifest.json b/packages/bookstore/app/bookList/webapp/manifest.json new file mode 100644 index 00000000..0aa7e1f4 --- /dev/null +++ b/packages/bookstore/app/bookList/webapp/manifest.json @@ -0,0 +1,134 @@ +{ + "_version": "1.15.0", + "sap.app": { + "id": "ns.bookList", + "type": "application", + "i18n": "i18n/i18n.properties", + "applicationVersion": { + "version": "1.0" + }, + "title": "{{appTitle}}", + "description": "{{appDescription}}", + "ach": "CA-UI5-FE", + "dataSources": { + "mainService": { + "uri": "catalog/", + "type": "OData", + "settings": { + "odataVersion": "4.0" + } + } + }, + "offline": false, + "resources": "resources.json", + "sourceTemplate": { + "id": "ui5template.fiorielements.v4.lrop", + "version": "1.0.0" + } + }, + "sap.ui": { + "technology": "UI5", + "icons": { + "icon": "", + "favIcon": "", + "phone": "", + "phone@2": "", + "tablet": "", + "tablet@2": "" + }, + "deviceTypes": { + "desktop": true, + "tablet": true, + "phone": true + } + }, + "sap.ui5": { + "resources": { + "js": [], + "css": [] + }, + "dependencies": { + "minUI5Version": "1.60.1", + "libs": { + "sap.fe": {} + } + }, + "models": { + "i18n": { + "type": "sap.ui.model.resource.ResourceModel", + "uri": "i18n/i18n.properties" + }, + "": { + "dataSource": "mainService", + "settings": { + "synchronizationMode": "None", + "operationMode": "Server", + "autoExpandSelect": true, + "earlyRequests": true + } + } + }, + + "routing": { + "routes": [ + { + "pattern": "", + "name": "BooksList", + "target": "BooksList" + }, + { + "pattern": "Books({key})", + "name": "BooksObjectPage", + "target": "BooksObjectPage" + } + ], + "targets": { + "BooksList": { + "type": "Component", + "id": "BooksList", + "name": "sap.fe.templates.ListReport", + "options": { + "settings" : { + "entitySet" : "Books", + "variantManagement": "Page", + "navigation" : { + "Books" : { + "detail" : { + "route" : "BooksObjectPage" + } + } + } + } + } + }, + "BooksObjectPage": { + "type": "Component", + "id": "BooksObjectPage", + "name": "sap.fe.templates.ObjectPage", + "options": { + "settings" : { + "entitySet" : "Books" + } + } + } + } + }, + "contentDensities": { + "compact": true, + "cozy": true + } + }, + "sap.platform.abap": { + "_version": "1.1.0", + "uri": "" + }, + "sap.platform.hcp": { + "_version": "1.1.0", + "uri": "" + }, + "sap.fiori": { + "_version": "1.1.0", + "registrationIds": [], + "archeType": "transactional" + } +} \ No newline at end of file diff --git a/packages/bookstore/app/bookList/xs-app.json b/packages/bookstore/app/bookList/xs-app.json new file mode 100644 index 00000000..a99e120d --- /dev/null +++ b/packages/bookstore/app/bookList/xs-app.json @@ -0,0 +1,23 @@ +{ + "welcomeFile": "/index.html", + "authenticationMethod": "none", + "logout": { + "logoutEndpoint": "/do/logout" + }, + "routes": [ + { + "source": "^/catalog/(.*)$", + "target": "$1", + "destination": "srv-api", + "csrfProtection": false, + "authenticationType": "none" + }, + { + "source": "^(.*)$", + "target": "$1", + "service": "html5-apps-repo-rt", + "authenticationType": "xsuaa" + } + ] +} + diff --git a/packages/bookstore/app/booksAnnotation.cds b/packages/bookstore/app/booksAnnotation.cds new file mode 100644 index 00000000..18d33e83 --- /dev/null +++ b/packages/bookstore/app/booksAnnotation.cds @@ -0,0 +1,66 @@ + using sap.capire.bookstore.CatalogService as CatalogService from '../srv/services'; + + //////////////////////////////////////////////////////////////////////////// + // + // Books Lists + // + annotate CatalogService.Books with @( + UI: { + HeaderFacets: [ + {$Type: 'UI.ReferenceFacet', Label: 'Description', Target: '@UI.FieldGroup#Descr'}, + ], + Facets: [ + {$Type: 'UI.ReferenceFacet', Label: 'Details', Target: '@UI.FieldGroup#Price'}, + ], + FieldGroup#Descr: { + Data: [ + {Value: descr}, + ] + }, + FieldGroup#Price: { + Data: [ + {Value: price}, + {Value: currency.symbol, Label: 'Currency'}, + ] + }, + Identification: [{Value:title}], + SelectionFields: [ ID, price, currency_code ], + LineItem: [ + {Value: ID}, + {Value: title}, + {Value: author_ID, Label:'Author ID'}, + {Value: stock}, + {Value: price}, + {Value: currency.symbol, Label:''}, + ] + } + + ); + + //////////////////////////////////////////////////////////////////////////// + // + // Books Details + // + annotate CatalogService.Books with @( + UI: { + HeaderInfo: { + TypeName: 'Book', + TypeNamePlural: 'Books', + Title: {Value: title}, + + }, + } + ); + + //////////////////////////////////////////////////////////////////////////// + // + // Books Elements + // + annotate CatalogService.Books with { + ID @title:'ID' @UI.HiddenFilter; + title @title:'Title'; + author @title:'Author ID'; + price @title:'Price'; + stock @title:'Stock'; + descr @UI.MultiLineText; + }