on 09-11-2015 6:29 AM
Hello,
By checking the following documentation:
https://openui5.hana.ondemand.com/#docs/guide/003f755d46d34dd1bbce9ffe08c8d46a.html
I see that there is a recommendation to put all the app content in a folder called webapp.
But when I do that in the Web IDE, the bootstraping does not work anymore.
Here is the content of my neo-app.json file:
{
"routes": [
{
"path": "/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": "SAPUI5 Resources"
},
{
"path": "/test-resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/test-resources"
},
"description": "SAPUI5 Test Resources"
}
],
And here is the content of the bootstrapping in index.html:
src="resources/sap-ui-core.js"
In debug, I can see a 404 error because it tries to get the framework at the URL https://<myapp>/webapp/resources/sap.ui.core.js
Here is the folder structure in the IDE:
- Local
--- Project
-------webapp
----------index.html
----------manifest.json
-------project.json
-------user.project.json
-------neo-app.json
So from there what's the best solution:
- Change the path in neo-app.json to be /webapp/resources ?
- or change the index.html to be something like ./resources/sap-ui-core.js ?
What's the best practice?
Thanks,
Guillaume
Ok if you want to stick to the proposed (non working) configuration why not simply change the route to the resources?
- {
- "routes": [
- {
- "path": "/resources",
- "target": {
- "type": "service",
- "name": "sapui5",
- "entryPath": "../resources"
- },
- "description": "SAPUI5 Resources"
- },
- {
- "path": "/test-resources",
- "target": {
- "type": "service",
- "name": "sapui5",
- "entryPath": "../test-resources"
- },
- "description": "SAPUI5 Test Resources"
- }
- ],
I'm not sure if you should switch entryPath or path but just navigate one level up to compensate the fact, that with your app you work a level below the (in my opinion ) intended structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solve the issue, it was a code mistake on my side.
Reading the following documentation, at step 3, the index.html is also created in a subfolder from the root where neo-app.json is created.
But I was missing the "/" at the beginning of the src path:
src="/resources/sap-ui-core.js"
https://sapui5.hana.ondemand.com/#docs/guide/13ced9493472408999143bc99bbb73b9.html
So I think it's better like that, keeping the structure as mentioned in the documentation, with a separate webapp folder.
I think it's easier when taking a UI5 app repo developed locally and cloning it for the use in SAP Web IDE on the HANA Cloud Platform, or vice-versa.
Because then I can have all the files related to build, projects, documentation separated from the code, but still in the git repo.
Regards,
Guillaume
Please mark this Discussion with a Correct Answer (closes, but does not lock the Discussion) and Helpful Answer where appropriate. See http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be.
Do not use Assumed Answered as it confuses anyone looking for the specific answer.
Thanks, Mike (Moderator)
SAP Technology RIG
Hi Guillaume,
when i use the WebIDE on the HANA Cloud Platform, i do not use such a structure. Even if i create a new application from the official templates, i get the following application structure:
-Local
---NameOfMyApp
-----i18n
-----views
-----index.html
-----neo-app.json
It seems to me that under your project you have created another folder called webapp. This seems to me like a missunderstanding of the official documentation you have linked because you use an additional folder level called "Project"! But this is already your webapp!
So could you please try to erase this folder level and stick to the folder structure i proposed!?
If it worked please let me know!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I do that it works fine, but my projects files, readme, etc will not be in a separate folder from the webapp. If I follow the documentation, the goal is to have a webapp folder with only the deployable files.
And in the screenshots of the documentation link I provided, it's the same; the neo-app.json is not in the same folder as the index.html..... Comparing to the documentation, I assume the root folder is my ui5tutorial folder.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.