cancel
Showing results for 
Search instead for 
Did you mean: 

How to load openui5 using the file system reusing 'resources' folder between projects?

FabioPagoti
Active Contributor
0 Kudos

I was able to install Tomcat on my Eclipse Luna running on Mavericks.

I just have one doubt: what should be my bootstrap if I want to use openui5 locally (using the file system)?

After downloading openui5 (SDK) using the link below I was able to easily locate 'resources' and folder 'sap-ui-core-all.js'.

OpenUI5 - Download

However copying this folder inside my project has two main issues

  1. The folder has 50MB and Eclipse just gets crazy when trying to deploy the project to Tomcat. I found heap memory issues and the deploy just takes too long.
  2. The SDK/Runtime is not reused. I would like to reuse the SDK/Runtime in many projects so copying and pasting 'resources' folder inside each project doesn't seems the right way of doing that.

So I tried to use the local file directly in the bootstrap, as below.

    <script src="file:///Users/fabiopagoti/Dev/hana/openui5-sdk/resources/sap-ui-core-all.js"
   id="sap-ui-bootstrap"
   data-sap-ui-libs="sap.ui.commons"
   data-sap-ui-theme="sap_bluecrystal">
   </script>

However when I open my index.html file openui5 (sap-ui-core-all.js) is not located. I tried to copy and paste "resources" folder inside a tomcat's folder as well but it has the same effect.

ReferenceError: sap is not defined
sap.ui.localResources("nyt-launchpad");

I can find the file normally using Finder and opening it inside the browser. So, the bootstrap path is not wrong because the file exists.

Could someone please help me sort that out?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

jmoors
Active Contributor
0 Kudos

OpenUI5 now includes the ability to easily run a simple node.js server via grunt, see the following instructions

openui5/developing.md at master · SAP/openui5 · GitHub

I expect the browser security is preventing the direct access to the files, have you tried running with the --allow-file-access-from-files flag in Chrome?

It might be easier to provide a relative path to the resources directory, i.e. if the resources directory is at the same level as the app directory you could do something like :

<script src="../resources/sap-ui-core-all.js"

Regards,

Jason

FabioPagoti
Active Contributor
0 Kudos

Unfortunately --allow-file-access-from-files doesn't seem to solve the issue.


I tried running chrome like this, I made "security.fileuri.strict_origin_policy" setting from Mozilla = false and it didn't work out. Finally I tried 2 Mozilla extension which supposedly would scan html files being loaded looking for local files but nothing... 😞 Thanks for the tip anyway..


The relative path didn't work as well.. I had tried it beforehand including openui5 runtime inside a tomcat folder.


Well... that's why I have always hated Tomcat. Probably the root cause is related with it. I will try this grunt, npm, noje.js stuff and get back here.


Thanks for now Jason!

FabioPagoti
Active Contributor
0 Kudos

I'm back...

Well.. I am reading about node.. it's totally new for me and it will take some time to benefit from its advantages.

Finally I downloaded OpenUI5 runtime and SDK and I stored both in a folder which I can reference inside all my projects using the relative path as you said .

Then, I downloaded a plugin for Mozilla Firefox (Local Filesystem Links) which enables me to run my projects locally without using a server like Tomcat or Grunt. So far it's working great. I know this might represent security problems but that's ok until I become familiar with node.

Thanks Jason!! I will unmark your answer as helpful and them make it correct.

Answers (0)