Hi,
In the SAP HANA Cloud Platform you can create SAPUI5 applications by creating Java applications or XSEngine application.But recently SAP has added an option specific for HTML5 Applications to the SAP HANA Cloud Platform. This new feature is actually a git in the HANA Cloud and has some new awesome features for SAPUI5 applications! Check out this blog this nice demo : Lightweight HTML5 apps and Git on SAP HANA Cloud Platform
You can also find al the required information on the sap help: SAP HANA Cloud Platform and a nice helloworld tutorial: SAP HANA Cloud Platform. Everything is well documented to start! But what if you already have a SAPUI5 application. How can we add an existing SAPUI5 Application? Well, just follow these steps:
First config your eclipse: SAP HANA Cloud Platform
I'll start from my SAPUI5 application that I've created in my previous blogs:
Get started with SAPUI5 and Routing
This is what I already had:
My Eclipse project:
Now I want to add this to the cloud!
Go to the SAP HANA Cloud: https://account.hanatrial.ondemand.com/cockpit
There you'll find the new HTML5 Applications option. In the details of the HTML5 Applications, you have to create the a "New Application...":
Fill in a name:
Select your created application:
In the tab "Development", you'll find the GIT URL.
We'll use this url in Eclipse to upload our projects
In Eclipse, Open perspectives and select "Git Repository Exploring":
Select "Clone a Git repository"
Paste the GIT URL in the field "URI" (this will also fill in the host and repository path) + your user and password
Select master
And Finish.
This is how your "Git Repositories" will look like:
Back to the JEE perspective, right click on the project name --> Team --> Share Project
Select Git:
Select your created repository and your project
If you wait a second, you'll see the git icons. Your project is shared, but you still have to commit your project to the GIT in the HANA Cloud.
Add a message, select all files and hit "Commit and push"
Just hit OK
Go back to the HANA Cloud and refresh the page, then you'll see your commit in the "Development" tab:
You could directly test by the url behind the comment or create a version. To activate your project and create a public url, you'll first need to create a version. This version can later be activated.
We'll start by creating a first version:
Enter a name for your version:
In the tab "Version Management" you can activate your created version.
After activating the version, you'll see an url for your application:
When I hit this URL, I get an HTTP Status 404... This is not what I've expected...
This is because our index.html is not directly in the Working Directory of our Git. We have to add the name of the project and WebContent
After adding the Project name (SAPUI5Tutorial1) + WebContent + index.html to the URL, I get my expected result:
My first SAPUI5 application in the cloud by using this new feature!!! But I don't want to change the url manually... Therefore I can add "neo-app.json" file to configure my index.html as my welcome page. You'll have to create this file in the root of the "Working Directory". To do this, you can just follow the documentation:
- Import the root of the project as in this tutorial: SAP HANA Cloud Platform :Choose Import as general project
- Create a "neo-app.json" in the root of the project : SAP HANA Cloud Platform
Add the following to the json file:
{ "welcomeFile": "/SAPUI5Tutorial1/WebContent/index.html", "sendWelcomeFileRedirect": "true" }
This will redirect the URL of the application to the the index.html.
Kind regards,
Wouter