Skip to content

Commit

Permalink
Initial Commit Based on Standard Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
katansapdevelop committed Oct 26, 2023
1 parent 9e55b3b commit 0e8a680
Show file tree
Hide file tree
Showing 15 changed files with 1,543 additions and 2 deletions.
1 change: 1 addition & 0 deletions .cdsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
26 changes: 26 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "eslint:recommended",
"env": {
"es2022": true,
"node": true,
"jest": true,
"mocha": true
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"CDL": true,
"CQL": true,
"CXL": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off"
}
}
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CAP cap-media-demo
_out
*.db
*.sqlite
connection.properties
default-*.json
.cdsrc-private.json
gen/
node_modules/
target/

# Web IDE, App Studio
.che/
.gen/

# MTA
*_mta_build_tmp
*.mtar
mta_archives/

# Other
.DS_Store
*.orig
*.log

*.iml
*.flattened-pom.xml

# IDEs
# .vscode
# .idea
19 changes: 19 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"SAPSE.vscode-cds",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"mechatroner.rainbow-csv",
"qwtel.sqlite-viewer",
"humao.rest-client",
"sdras.night-owl"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "cds watch",
"request": "launch",
"type": "node",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "cds",
"args": [
"watch",
"--with-mocks",
"--in-memory?"
],
"skipFiles": [
"<node_internals>/**"
]
}
]
}
25 changes: 25 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "cds watch",
"command": "cds",
"args": ["watch"],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"type": "shell",
"label": "cds serve",
"command": "cds",
"args": ["serve", "--with-mocks", "--in-memory?"],
"problemMatcher": []
}
]
}
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# cap-media-demo
CAP Media Demo
# CAP Media Demo

A simple demo project to demonstrate how to incorporate media in a CAP App

This was copied from the [CAP Cloud Samples](https://github.com/SAP-samples/cloud-cap-samples/tree/main/media)


## Running the project
- Open a new terminal and run `cds watch`


## Running the Test Cases (.http files)
Requires REST Client for VS Code [humao.rest-client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)


13 changes: 13 additions & 0 deletions db/schema.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace sap.capire.media;

entity Media {

key id:Integer;
@Core.MediaType: mediaType
content : LargeBinary ;

@Core.IsMediaType: true
mediaType : String;
fileName : String;
applicationName:String;
}
2 changes: 2 additions & 0 deletions index.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
using from './db/schema';
using from './srv/media-service';
Loading

0 comments on commit 0e8a680

Please sign in to comment.