Skip to content

Commit

Permalink
Improve readme, SAP Business One
Browse files Browse the repository at this point in the history
Service Layer Endpoint
  • Loading branch information
gregorwolf committed Apr 28, 2020
1 parent 00ef801 commit 2f0d428
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# HTML5UserAPIforCF
HTML5UserAPI for Cloud Foundry
# HTML5UserAPI for Cloud Foundry

This project provides a simple MTA application which serves links to a Node.js backend that servers some Endpoints showing user information using Express. It can be deployed as an Multi Target Application to the SAP Cloud Platform - Cloud Foundry Environment.

## Deploy to SAP Cloud Platform - Cloud Foundry

### Prerequisite

- You have a [SAP Cloud Platform Trial account](https://hanatrial.ondemand.com/)
- The [Cloud MTA Build Tool (MBT)](https://sap.github.io/cloud-mta-build-tool/) is installed
- The [Cloud Foundry commandline tool](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html) is installed
- The [MultiApps CF CLI Plugin](https://github.com/cloudfoundry-incubator/multiapps-cli-plugin) is installed
- You've connected using `cf login`to your trial account
- You've connected a SAP Cloud Connector to your subaccount
- Principal Propagation is setup in the Cloud Connector to the ABAP Backend

### Preperation

Before you can deploy the application to your Cloud Foundry account the destinations to the backend system must be created. Please find here what I've used in my environment:

If you want to test the connection to a ABAP Backend, then the destination SAP_ABAP_BACKEND used by the approuter:

```
URL=http\://npl752.virtual\:44300
Name=SAP_ABAP_BACKEND
ProxyType=OnPremise
Type=HTTP
sap-client=001
Authentication=PrincipalPropagation
```

must be created. If you want to test the connection to the SAP Business One Service Layer, then the destination SAP_B1_BACKEND must be created:

```
URL=http\://b1server.virtual\:44300
Name=SAP_B1_BACKEND
ProxyType=OnPremise
Type=HTTP
Authentication=BasicAuthentication
```

As described in the answer to [B1 Service Layer Login Credentials as Destination Properties](https://answers.sap.com/answers/12688540/view.html) the credentials can be added as shown in this example:

```
username: {"UserName": "manager", "CompanyDB": "SBODEMOUS"}
password: 1234
```
### Build

`npm run build:cf`

### Deploy

`npm run deploy:cf`

7 changes: 7 additions & 0 deletions app/webapp/view/Home.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
</l:content>
</l:BlockLayoutCell>
</l:BlockLayoutRow>
<l:BlockLayoutRow accentCells="Backend">
<l:BlockLayoutCell id="BackendB1" width="2" title="Business One Backend">
<l:content>
<Link text="/b1s/v1/$metadata" href="/b1s/v1/$metadata" />
</l:content>
</l:BlockLayoutCell>
</l:BlockLayoutRow>
<l:BlockLayoutRow accentCells="Logout">
<l:BlockLayoutCell id="Logout" width="2" title="Logout">
<l:content>
Expand Down
5 changes: 5 additions & 0 deletions app/xs-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"target": "/sap/$1",
"destination": "SAP_ABAP_BACKEND"
},
{
"source": "/b1s/(.*)$",
"target": "/b1s/$1",
"destination": "SAP_B1_BACKEND"
},
{
"source": "^/app/logout.html$",
"localDir": "webapp",
Expand Down

0 comments on commit 2f0d428

Please sign in to comment.