Sunday, January 19, 2014

Kickstart the SDK

How can you get a quick start into the UI5 SDK?

What about just downloading the SDK and just open it inside Google Chrome?

1) First download the needed SDK

Download SDK

You can choose betweeen the UI5 Runtime, the UI5 Runtime Mobile or the complete SDK.

For getting docs and everthing around UI5 download the complete SDK for developing browser and mobile applications.

After extraction you will get a folder like this

OpenUI5 SDK
2) Launch SDK

Normally you would like to open "index.html" directly from browser using an URI like this
file:///C:/UI5/sdk/index.html
The result will be a blank page inside the browser, because the SDK tries to load needed JavaScript library parts on special needs using "Require.js" which is part of the UI5 library.

For that reason you normally have to use a web server like Apache or Nginx to get your hands on the SDK, but you can also use the Google Chrome browser to start the SDK by using a special command line parameter.

On windows, the easiest way is to create a shortcut to "chrome.exe" with the following target:
"C:\Users\USER\AppData\Local\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files file:///C:/UI5/sdk/index.html

This small chrome parameter allows JavaScript to load other files right from inside JavaScript.

Now you will not get any JavaScript errors concerning Cross-Domain issues.

Thats it! Start your chrome browser with the symbolic link and you will be able to run it from the local file system.

Special notice on SAPUI5!
The SAPUI5 SDK is also delivered as a WAR file that can be deployed on a J2EE Server like "Apache Tomcat". It includes a special servlet doing special tasks like cache-busting and resource handling.

This is only thought as a SDK quickstart to get your hands on it. You will have more fun with dynamic data services on the server side. You can use a classic html server like Apache or maybe use node.js fot that job.

In the node.js section of this site you will find the needed server script to run static files from inside node.

2 comments:

  1. Hello
    I am using following command in run dialog box but chrome is showing blank page. Cam you tell me whats the error

    "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files "file:///I:/Projects .net (ZAROONS-PC)/openui5-sdk-1.24.4/index.html"

    ReplyDelete
  2. If you have errors, use F12 to open Chrome Developer Tools ang open console. I think you will see some red errors concerning "Cross origin requests", "XMLHttpRequest" o r"Network Error".

    Currently chrome runs also as a background task (even if you close all windows). Make sure you have deleted chrome from the SysTray via the context menu. Check windows tasks (there should not be any chrome.exe task). Then retry to open the Shortcut!

    This only works on a fresh chrome start.

    Hope this helps.

    Cheers Holger

    ReplyDelete

Thank you for your comment!

The comment area is not intended to be used for promoting sites!
Please do not use such links or your comment will be deleted.

Holger

Note: Only a member of this blog may post a comment.