Skip to content

Commit

Permalink
cap-fe-se-ca-de application added
Browse files Browse the repository at this point in the history
  • Loading branch information
AjitKP91 committed Jan 5, 2023
1 parent a1d4a6f commit b1f54df
Show file tree
Hide file tree
Showing 38 changed files with 2,365 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
1 change: 1 addition & 0 deletions cap-fe-se-ca-de/.cdsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
34 changes: 34 additions & 0 deletions cap-fe-se-ca-de/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# CAP cap-fe-sideeffects
_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
app/customers/webapp/test/**
app/orders/webapp/test/**
.vscode/**
25 changes: 25 additions & 0 deletions cap-fe-se-ca-de/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Introduction
This repository is an showcase for CAP application using Fiori Elements UI with Side Effects, Custom Actions and Dynamic Expression examples. For more info please visit the following blog.



# Getting Started

File or Folder | Purpose
---------|----------
`app/` | This has 2 UI frontends i.e. Customers and Orders
`db/` | Data model is defined in schema.cds
`srv/` | Services are defined in service.cds
`package.json` | project metadata and configuration
`readme.md` | this getting started guide


## Next Steps

- Open a new terminal and run `cds watch`
- (in VS Code simply choose _**Terminal** > Run Task > cds watch_)


## Learn More / Resources

Learn more at https://cap.cloud.sap/docs/get-started/.
42 changes: 42 additions & 0 deletions cap-fe-se-ca-de/app/customers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Application Details
| |
| ------------- |
|**Generation Date and Time**<br>Fri Dec 09 2022 07:02:35 GMT+0000 (Coordinated Universal Time)|
|**App Generator**<br>@sap/generator-fiori-elements|
|**App Generator Version**<br>1.8.3|
|**Generation Platform**<br>SAP Business Application Studio|
|**Template Used**<br>List Report Page V4|
|**Service Type**<br>Local Cap|
|**Service URL**<br>http://localhost:4004/service/admin/
|**Module Name**<br>customers|
|**Application Title**<br>Customers|
|**Namespace**<br>cap.fe.se|
|**UI5 Theme**<br>sap_horizon|
|**UI5 Version**<br>1.108.0|
|**Enable Code Assist Libraries**<br>False|
|**Enable TypeScript**<br>False|
|**Add Eslint configuration**<br>False|
|**Main Entity**<br>Customers|
|**Navigation Entity**<br>addresses|

## customers

Customers

### Starting the generated app

- This app has been generated using the SAP Fiori tools - App Generator, as part of the SAP Fiori tools suite. In order to launch the generated app, simply start your CAP project and navigate to the following location in your browser:

http://localhost:4004/customers/webapp/index.html

- It is also possible to run the application using mock data that reflects the OData Service URL supplied during application generation. In order to run the application with Mock Data, run the following from the generated app root folder:

```
npm run start-mock
```

#### Pre-requisites:

1. Active NodeJS LTS (Long Term Support) version and associated supported NPM version. (See https://nodejs.org)


142 changes: 142 additions & 0 deletions cap-fe-se-ca-de/app/customers/annotations.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
using adminservice as service from '../../srv/service';

annotate service.Customers with @(
UI.LineItem : [
{
$Type : 'UI.DataField',
Value : industry.id,
Label : 'Industry',
},
{
$Type : 'UI.DataField',
Label : 'First Name',
Value : firstname,
},
{
$Type : 'UI.DataField',
Label : 'Last Name',
Value : lastname,
},
{
$Type : 'UI.DataField',
Value : modifiedAt,
},
]
);
annotate service.Customers with @(
UI.FieldGroup #GeneratedGroup1 : {
$Type : 'UI.FieldGroupType',
Data : [
{
$Type : 'UI.DataField',
Value : industry_id,
Label : 'Industry',
},
{
$Type : 'UI.DataField',
Label : 'First Name',
Value : firstname,
},
{
$Type : 'UI.DataField',
Label : 'Last Name',
Value : lastname,
},
],
},
UI.Facets : [
{
$Type : 'UI.ReferenceFacet',
ID : 'GeneratedFacet1',
Label : 'General Information',
Target : '@UI.FieldGroup#GeneratedGroup1',
},
{
$Type : 'UI.ReferenceFacet',
Label : 'Addresses',
ID : 'Addresses',
Target : 'addresses/@UI.LineItem#Addresses',
},
]
);
annotate service.Addresses with @(
UI.LineItem #Addresses : [
{
$Type : 'UI.DataField',
Value : country,
Label : 'Country',
},{
$Type : 'UI.DataField',
Value : state,
Label : 'State',
},{
$Type : 'UI.DataField',
Value : city,
Label : 'City',
},{
$Type : 'UI.DataField',
Value : address1,
Label : 'Address',
},{
$Type : 'UI.DataField',
Value : zipcode,
Label : 'Zip Code',
},{
$Type : 'UI.DataField',
Value : default,
Label : 'Default',
},]
);
annotate service.Customers with @(
UI.HeaderInfo : {
TypeName : 'Customer',
TypeNamePlural : '',
Title : {
$Type : 'UI.DataField',
Value : ID,
},
}
);
annotate service.Industries with {
id @Common.Text : {
$value : descr,
![@UI.TextArrangement] : #TextLast,
}
};
annotate service.Industries with {
id @(Common.ValueList : {
$Type : 'Common.ValueListType',
CollectionPath : 'Industries',
Parameters : [
{
$Type : 'Common.ValueListParameterInOut',
LocalDataProperty : id,
ValueListProperty : 'id',
},
],
},
Common.ValueListWithFixedValues : true
)};
annotate service.Customers with {
industry @UI.MultiLineText : false
};
annotate service.Customers with {
industry @(Common.ValueList : {
$Type : 'Common.ValueListType',
CollectionPath : 'Industries',
Parameters : [
{
$Type : 'Common.ValueListParameterInOut',
LocalDataProperty : industry_id,
ValueListProperty : 'id',
},
],
},
Common.ValueListWithFixedValues : true
)};
annotate service.Customers with {
industry @Common.Text : {
$value : industry.descr,
![@UI.TextArrangement] : #TextLast,
}
};
15 changes: 15 additions & 0 deletions cap-fe-se-ca-de/app/customers/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "customers",
"version": "0.0.1",
"description": "Customers",
"keywords": [
"ui5",
"openui5",
"sapui5"
],
"main": "webapp/index.html",
"scripts": {
"deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf"
},
"devDependencies": { }
}
4 changes: 4 additions & 0 deletions cap-fe-se-ca-de/app/customers/ui5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
specVersion: "2.5"
metadata:
name: cap.fe.se.customers
type: application
12 changes: 12 additions & 0 deletions cap-fe-se-ca-de/app/customers/webapp/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sap.ui.define(
["sap/fe/core/AppComponent"],
function (Component) {
"use strict";

return Component.extend("cap.fe.se.customers.Component", {
metadata: {
manifest: "json"
}
});
}
);
18 changes: 18 additions & 0 deletions cap-fe-se-ca-de/app/customers/webapp/annotations/annotation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Common.xml">
<edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/>
</edmx:Reference>
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/UI.xml">
<edmx:Include Namespace="com.sap.vocabularies.UI.v1" Alias="UI"/>
</edmx:Reference>
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Communication.xml">
<edmx:Include Namespace="com.sap.vocabularies.Communication.v1" Alias="Communication"/>
</edmx:Reference>
<edmx:Reference Uri="/service/admin/$metadata">
<edmx:Include Namespace="adminservice"/>
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="local">
</Schema>
</edmx:DataServices>
</edmx:Edmx>
9 changes: 9 additions & 0 deletions cap-fe-se-ca-de/app/customers/webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is the resource bundle for cap.fe.se.customers

#Texts for manifest.json

#XTIT: Application name
appTitle=Customers

#YDES: Application description
appDescription=Customers
35 changes: 35 additions & 0 deletions cap-fe-se-ca-de/app/customers/webapp/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Customers</title>
<style>
html, body, body > div, #container, #container-uiarea {
height: 100%;
}
</style>
<script
id="sap-ui-bootstrap"
src="https://sapui5.hana.ondemand.com/1.108.0/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-resourceroots='{
"cap.fe.se.customers": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted"
></script>
</head>
<body class="sapUiBody sapUiSizeCompact" id="content">
<div
data-sap-ui-component
data-name="cap.fe.se.customers"
data-id="container"
data-settings='{"id" : "cap.fe.se.customers"}'
data-handle-validation="true"
></div>
</body>
</html>
Loading

0 comments on commit b1f54df

Please sign in to comment.