cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CAP UI development - Java vs Node.js

neilprince
Participant
0 Likes
1,804

Hi

I am converting my CAP application from Java to Node.js. It consists of a HANA db, service and UI5 app. The server side development is straightforward. Where I am having issues is with the UI development within the WebIDE environment. In the Java world, I can create a new html application from a wizard (eg a worklist app) and run it by setting a runtime configuration for index.html in the Neo environment. On first launch of the app, a Neo destination is automatically created and from that point on the app just works out of the box. The Odata service is called and the data is populated. I am not able to do the same using node.js.

I took a step back from the real application and have created the following:

1. Create 2 CAP applications from the template, one using Java and the other using node. For the Java app, select Odata v4 (just to keep things consistent), keep the tickbox on for default data (bookshops,authors etc) and do not select XSUAA to keep it simple.

2. On both projects, build CDS, build Hana db and build and run service. No issues with any of this

3. For each project, right click and add HTML module, select the 'SAP Fiori worklist Application OData v4' template, select your odata service from the 'Current project', select 'standalone app' and map the view to the Books table.

4. Right click on the new html/UI5 module and create a runconfiguration for Neo running index.html. For the Java app, a new browser session is created and a popup to create a destination in Neo is shown requesting credentials. This is created in the background and then the applicatino launches and the list of books is shown. However, for the node application, no request to create a destination is received, the app is launched straight away but returns a 'technical error' in the popup which is due to the app being unable to read the metadata for the odata service. The UI5 app contains zero books.

I have reviewed the mta.yml, xs-app.json, manifest.json and they appear identical except for where differences are expected on the service definition for node vs Java.

What is required to make the UI5 app launch from the WebIDE in the same way the Java app does?

Regards

Neil

PS I was going to build the MTAR's and deploy to CF as another test, however, the MTAR builder does not seem to be working today. Once it comes good, I'll update with my findings

View Entire Topic
WouterLemaire
SAP Mentor
SAP Mentor
0 Likes

Hi Neil,

As Gregor already mentioned, it will probably just work fine when running in CF. If you want to try it on NEO, you will have to create the destination to your service manually.

Kr, Wouter