Compare commits

..

29 Commits

Author SHA1 Message Date
Christian Georgi
baccf26a56 Merge pull request #190 from Oschm/openSAP-week3-unit3
Open sap week3 unit3
2021-01-26 09:22:32 +01:00
Oliver Schmidt
0d6ee73920 changed loading of fe library and usage of fe AppComponent because of changes in library structure 2021-01-25 15:20:11 +00:00
Oliver Schmidt
e3159afdc2 hardcode squlite version because version 5.0.1 cant't be installed. 2021-01-25 14:52:04 +00:00
Christian Georgi
ad9a374381 Update README.md 2020-04-20 17:10:36 +02:00
Christian Georgi
9d285805cd Add package-lock.json, fix readme 2020-04-02 15:59:21 +02:00
Matthias Bühl
2faf34d264 Merge pull request #42 from SAP-samples/comment-out-@requires
comment out @requires again CatalogService.Orders
2020-03-25 17:05:10 +01:00
johannes-vogel
1de3528b45 comment out @requires again CatalogService.Orders 2020-03-25 16:22:42 +01:00
Christian Georgi
e399b9d76e Update readme 2020-03-23 17:08:23 +01:00
Harini Gunabalan
dd30cd10f8 Update README.md 2020-03-21 23:45:53 +01:00
Harini Gunabalan
fa724d4c9c Adding codebase of OpenSAP week3 unit3 demo 2020-03-21 23:46:06 +01:00
Harini Gunabalan
6cc2741c3e Adding demo codebase of OpenSAP week3 unit1 2020-03-21 23:39:12 +01:00
Daniel
06755978b2 Removed work-around for auto-exposed entities 2020-02-15 14:31:07 +01:00
Daniel
02469acebb Moved @odata.draft.enabled to app model 2020-02-15 14:25:15 +01:00
Dr. David Kunz
e2b47228db Update services.js 2020-02-12 17:13:35 +01:00
Christian Georgi
13480ad99e Added issue URL again 2020-02-04 09:11:28 +01:00
Daniel
8071faa62d Adding requires.db: {kind:'sql'} 2020-02-03 07:55:56 +01:00
johannes-vogel
9ea294586a remove link 2020-01-31 08:49:54 +01:00
Lakshmi C Rajeev
a56a11ff3e Create index.cds 2020-01-28 10:58:24 +05:30
Matthias Bühl
b4084b45cb rollback change in master 2020-01-27 15:33:14 +01:00
Matthias Bühl
26e3c0d753 check autthorization in cat service 2020-01-27 15:29:43 +01:00
Lakshmi C Rajeev
6d0194acc0 Merge pull request #12 from LakshmiCR/master
Media-server implementation
2020-01-17 15:02:15 +05:30
Lakshmi C Rajeev
db75a99808 Merge branch 'master' into master 2020-01-17 15:01:59 +05:30
Volker Buzek
a04755efed feat(npm): add .npmrc for @sap-scope
- `npm set @sap...` is unnecessary
- update README.md accordingly
2020-01-14 14:55:36 +01:00
Lakshmi C Rajeev
ba72d7f478 Update package.json 2020-01-03 14:29:53 +05:30
Lakshmi C Rajeev
cd808c76dd Update media-service.js 2020-01-03 14:07:17 +05:30
Lakshmi C Rajeev
630bb2b19c Update package.json 2019-12-19 10:59:57 +05:30
Lakshmi C Rajeev
f9a7aa59de Update media-service.js 2019-12-19 10:43:22 +05:30
Lakshmi C Rajeev
9205e0893a Update media-service.js 2019-12-02 15:27:38 +05:30
Lakshmi C Rajeev
7137bf227e Media-server 2019-11-29 12:30:07 +05:30
39 changed files with 2102 additions and 164 deletions

24
Jenkinsfile vendored
View File

@@ -1,24 +0,0 @@
#!/usr/bin/env groovy
/*
* This file bootstraps the codified Continuous Delivery pipeline for extensions of SAP solutions, such as SAP S/4HANA.
* The pipeline helps you to deliver software changes quickly and in a reliable manner.
* A suitable Jenkins instance is required to run the pipeline.
* The Jenkins can easily be bootstraped using the life-cycle script located inside the 'cx-server' directory.
*
* More information on getting started with Continuous Delivery can be found in the following places:
* - GitHub repository: https://github.com/SAP/cloud-s4-sdk-pipeline
* - Blog Post: https://blogs.sap.com/2017/09/20/continuous-integration-and-delivery
*/
/*
* Set pipelineVersion to a fixed released version (e.g. "v15") when running in a productive environment.
* To find out about available versions and release notes, visit: https://github.com/SAP/cloud-s4-sdk-pipeline/releases
*/
String pipelineVersion = "v28"
node {
deleteDir()
sh "git clone --depth 1 https://github.com/SAP/cloud-s4-sdk-pipeline.git -b ${pipelineVersion} pipelines"
load './pipelines/s4sdk-pipeline.groovy'
}

View File

@@ -2,20 +2,6 @@
Find here the samples for the openSAP course [Building Applications with the SAP Cloud Application Programming Model](https://open.sap.com/courses/cp7).
## Notes on the Demo in Week 4 Unit 4
To add all pipeline specific file to your project, run the following command:
```sh
cds add pipeline
```
Details on how to start your Jenkins in your own environment can be found in the [Operations Guide](https://github.com/SAP/devops-docker-cx-server/blob/master/docs/operations/cx-server-operations-guide.md).
Please note that other than shown in the video Jenkins now is secured by default with an admin user and password.
After you have started Jenkins with the command `cx-server start`, you can get the initial password by running `./cx-server initial-credentials`.
The pipeline documentation can be found [here](https://sap.github.io/jenkins-library/pipelines/cloud-sdk/introduction/).
## Get Access to SAP Business Application Studio
The recommended environment for the course is SAP Business Application Studio. Watch [unit 2 of week 1](https://open.sap.com/courses/cp7/items/51pzQUzbXHr2kdbOmVs6jI) for how to get access.
@@ -25,8 +11,8 @@ In SAP Business Application Studio, open a terminal.
Then clone the repo with this specific branch:
```sh
git clone https://github.com/sap-samples/cloud-cap-samples -b openSAP-week4-unit4
cd cloud-cap-samples
git clone https://github.com/sap-samples/cloud-cap-samples projects/cloud-cap-samples -b openSAP-week3-unit3
cd projects/cloud-cap-samples
```
In the `cloud-cap-samples` folder run:
@@ -34,6 +20,17 @@ In the `cloud-cap-samples` folder run:
npm install
```
## Run
Now you're ready to run the samples, for example:
```sh
cd packages/bookshop
cds watch
```
After that, watch out for the little popup in the lower right corner of SAP Business Application Studio that asks you to open the application in your browser.
## Get Support
Check out the cap docs at https://cap.cloud.sap. <br>

1
lerna.json Normal file
View File

@@ -0,0 +1 @@
{"packages":["packages/*"],"version":"1.0.0"}

28
package-lock.json generated
View File

@@ -1,8 +1,7 @@
{
"name": "@sap/capire-bookshop",
"version": "1.0.0",
"lockfileVersion": 1,
"name": "@sap/capire-samples",
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@sap/cds": {
"version": "3.33.1",
@@ -193,29 +192,6 @@
"winston": "^3.2.1"
}
},
"@sap/hana-client": {
"version": "2.4.191",
"resolved": "https://npm.sap.com/@sap/hana-client/-/hana-client-2.4.191.tgz",
"integrity": "sha512-OkdZPJenVuoFbkMBcgBN0nd75xVEi4Szf5NdeUyCQfpE5UecuPrn1rJj4sW9QJdsPammB+fY1ihF7ErgDe4gFg==",
"requires": {
"debug": "3.1.0"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"@sap/odata-server": {
"version": "1.6.0",
"resolved": "https://npm.sap.com/@sap/odata-server/-/odata-server-1.6.0.tgz",

View File

@@ -1,29 +1,29 @@
{
"name": "@sap/capire-bookshop",
"version": "1.0.0",
"description": "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages.",
"license": "SAP SAMPLE CODE LICENSE",
"name": "@sap/capire-samples",
"description": "The umbrella project for all samples to easily setup for local development and tests.",
"repository": "https://github.com/SAP-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com",
"private": true,
"scripts": {
"lerna": "npx --no-install lerna -v > /dev/null || npm i lerna --no-save",
"install": "(npm -s run lerna) && lerna bootstrap --hoist",
"cleanup": "lerna clean -y && rm -fr node_modules",
"bookshop": "cds watch packages/bookshop",
"bookshop-enhanced": "cds watch packages/bookshop-enhanced",
"reviews-service": "cds watch packages/reviews-service",
"bookstore": "cds watch packages/bookstore",
"media-server": "cds watch packages/media-server"
},
"dependencies": {
"@sap/cds": "^3",
"express": "^4",
"@sap/hana-client": "^2.4.182"
"express": "^4"
},
"devDependencies": {
"sqlite3": "^4.1.1"
"sqlite3": "*"
},
"scripts": {
"start": "cds run",
"watch": "cds watch"
"--add-these-to-devDependencies-for-tests": {
"@types/jest": "*",
"jest": "*"
},
"cds": {
"requires": {
"db": {
"kind": "hana",
"model": [
"db",
"srv"
]
}
}
}
"license": "SAP SAMPLE CODE LICENSE"
}

View File

@@ -1,4 +1,4 @@
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("admin.Component", {
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("admin.Component", {
metadata:{ manifest:'json' }
}))

View File

@@ -24,7 +24,9 @@
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe": {}
"sap.fe.core": {},
"sap.fe.macros": {},
"sap.fe.templates": {}
}
},
"models": {

View File

@@ -1,4 +1,4 @@
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("bookshop.Component", {
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("bookshop.Component", {
metadata:{ manifest:'json' }
}))

View File

@@ -24,7 +24,9 @@
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe": {}
"sap.fe.core": {},
"sap.fe.macros": {},
"sap.fe.templates": {}
}
},
"models": {

View File

@@ -1,4 +1,4 @@
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("orders.Component", {
sap.ui.define(["sap/fe/core/AppComponent"], ac => ac.extend("orders.Component", {
metadata:{ manifest:'json' }
}))

View File

@@ -24,7 +24,9 @@
"sap.ui5": {
"dependencies": {
"libs": {
"sap.fe": {}
"sap.fe.core": {},
"sap.fe.macros": {},
"sap.fe.templates": {}
}
},
"models": {

View File

@@ -1,6 +1,6 @@
####### Generated mta.yaml based on template version 0.2.0
####### appName = capire-bookshop
####### language=nodejs; multiTenant=
####### language=nodejs; multiTenant=false
####### approuter=
_schema-version: '3.1'
@@ -27,15 +27,7 @@ modules:
EXIT: 1 # required by deploy.js task to terminate
requires:
#### Resources extracted from CAP configuration ####
- name: capire-bookshop-db
provides:
- name: srv-binding # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
############################################################
############## SIDECAR MODULE #########################
@@ -47,18 +39,6 @@ modules:
app-name: capire-bookshop-db
requires:
#### Hana and xsuaa resources extracted from CAP configuration ####
- name: capire-bookshop-db
############################################################
############## RESOURCES ##################################
resources:
##### Services extracted from CAP configuration ####
##### 'service-plan' can be configured via 'cds.requires.<name>.vcap.plan'
- name: capire-bookshop-db
type: com.sap.xs.hdi-container
parameters:
properties:
hdi-service-name: ${service-name} # required for Java case
############################################################

2027
packages/bookshop/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
{
"name": "@sap/capire-bookshop",
"version": "1.0.0",
"description": "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages.",
"license": "SAP SAMPLE CODE LICENSE",
"dependencies": {
"@sap/cds": "^3",
"express": "^4",
"sqlite3": "^5.0.0"
},
"scripts": {
"start": "cds run --in-memory?",
"watch": "cds watch"
},
"cds": {
"requires": {
"db": {
"kind": "sql"
}
}
}
}

View File

@@ -10,7 +10,7 @@ service AdminService @(_requires:'authenticated-user') {
annotate AdminService.Orders with @odata.draft.enabled;
// annotate AdminService.Books with @odata.draft.enabled;
// Temporary workaround -> https://github.wdf.sap.corp/cap/issues/issues/3121
// Temporary workaround -> cap/issues#3121
extend service AdminService with {
entity OrderItems as select from my.OrderItems;
}

View File

@@ -23,4 +23,4 @@ async function _reduceStock (req) {
`${OrderItems[i].amount} exceeds stock for book #${OrderItems[i].book_ID}`
)
}))
}
}

View File

@@ -1,47 +0,0 @@
###
# This file configures the SAP Cloud SDK Continuous Delivery pipeline of your project.
# For a reference of the configuration concept and available options, please have a look into its documentation.
#
# The documentation for the most recent pipeline version can always be found at:
# https://github.com/SAP/cloud-s4-sdk-pipeline/blob/master/configuration.md
# If you are using a fixed version of the pipeline, please make sure to view the corresponding version from the tag
# list of GitHub (e.g. "v15" when you configured pipelineVersion = "v15" in the Jenkinsfile).
#
# For general information on how to get started with Continuous Delivery, visit:
# https://blogs.sap.com/2017/09/20/continuous-integration-and-delivery
#
# We aim to keep the pipeline configuration as stable as possible. However, major changes might also imply breaking
# changes in the configuration. Before doing an update, please check the the release notes of all intermediate releases
# and adapt this file if necessary.
#
# This is a YAML-file. YAML is a indentation-sensitive file format. Please make sure to properly indent changes to it.
###
### General project setup
general:
productiveBranch: 'openSAP-week4-unit4'
### Step-specific configuration
steps:
### Stage-specific configuration
stages:
# integrationTests:
# credentials:
# - alias: 'mySystemAlias'
# credentialId: 'mySystemCredentialsId'
# s4SdkQualityChecks:
# nonErpDestinations:
# - 'myCustomDestination'
# productionDeployment:
# cfTargets:
# - org: 'myOrg'
# space: 'mySpace'
# apiEndpoint: 'https://api.cf.eu10.hana.ondemand.com'
# credentialsId: 'cf-deploy-sap'