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:

/wp-content/uploads/2014/05/p1_451259.png

My Eclipse project:

/wp-content/uploads/2014/05/p2_451260.png

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…”:

/wp-content/uploads/2014/05/p3_451261.png

Fill in a name:

/wp-content/uploads/2014/05/p4_451262.png

Select your created application:

/wp-content/uploads/2014/05/p5_451263.png

In the tab “Development”, you’ll find the GIT URL.

We’ll use this url in Eclipse to upload our projects

/wp-content/uploads/2014/05/p6_451264.png

In Eclipse, Open perspectives and select “Git Repository Exploring”:

/wp-content/uploads/2014/05/p7_451265.png

Select “Clone a Git repository”

/wp-content/uploads/2014/05/p8_451266.png

Paste the GIT URL in the field “URI” (this will also fill in the host and repository path) + your user and password

/wp-content/uploads/2014/05/p9_451267.png

Select master

/wp-content/uploads/2014/05/p10_451268.png

And Finish.

This is how your “Git Repositories” will look like:

/wp-content/uploads/2014/05/p12_451270.png

Back to the JEE perspective, right click on the project name –> Team –> Share Project

/wp-content/uploads/2014/05/p13_451271.png

Select Git:

/wp-content/uploads/2014/05/p14_451272.png

Select your created repository and your project

/wp-content/uploads/2014/05/p15_451273.png

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.

/wp-content/uploads/2014/05/p16_451274.png

Add a message, select all files and hit “Commit and push”

/wp-content/uploads/2014/05/p17_451275.png

Just hit OK

/wp-content/uploads/2014/05/p18_451276.png

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.

/wp-content/uploads/2014/05/p19_451277.png

We’ll start by creating a first version:/wp-content/uploads/2014/05/p20_451278.png

Enter a name for your version:

/wp-content/uploads/2014/05/p21_451279.png

In the tab “Version Management” you can activate your created version.

/wp-content/uploads/2014/05/p22_451280.png

After activating the version, you’ll see an url for your application:

/wp-content/uploads/2014/05/p23_451281.png

When I hitthis URL, I get an HTTP Status 404… This is not what I’ve expected…

/wp-content/uploads/2014/05/p24_451282.png

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

/wp-content/uploads/2014/05/p25_451283.png

After adding the Project name (SAPUI5Tutorial1) + WebContent + index.html to the URL, I get my expected result:

/wp-content/uploads/2014/05/p26_451284.png

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:

  1. Import the root of the project as in this tutorial: SAP HANA Cloud Platform :Choose Import as general project
  2. 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

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

  1. Hemendra Sabharwal

    Thank you Wouter, I was actually pushing my head to explore how to add already existing SAPUI5 project to HANA Cloud platform.

    Thanks,

    Warm Regards

    Hemendra

    (0) 
  2. moreshwar thawkar

    Hi Wouter,

    Thanks you for this useful information. I am facing one issue with accessing SAPUI5 application on HANA cloud. I have shared application using Git, created and activated version. When I tried to open the link getting blank page.

    Could you please help me to resolve this issue.

    Thanks ,

    Moreshwar

    (0) 
  3. Vijay Kannan

    Hi Wouter,

         Thanks a lot. I struggled to find a way myself, but couldn’t. Luckily i saw the blog on google.

    Regards

    Vijay.K

    (0) 
  4. Ray Lv

    Hi Wouter,

       I have create a UI5 project in my eclipse studio, and then I followed the steps in your blog, commit and push all the files to git repository, and then active the application also, but in the last step, I access the application link with additional suffix “/MyAppName/WebContent/index.html”, but it shows a blank page to me, and then I debug and found the error message as below, so I just want to know if you have any ideal about this?

    4-13-2015 1-50-43 PM.png

    thanks and best reagards,

    Ray

    (0) 
      1. Michael Appleby

        Please create a Discussion marked as a Question (which is what Discussions are for) instead of posting as a Comment.

        Regards, Mike (Moderator)

        SAP Technology RIG

        (0) 

Leave a Reply