Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

Add an existing SAPUI5 project to the Cloud

$
0
0

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:

 

p1.png

My Eclipse project:

p2.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...":

p3.png

Fill in a name:

p4.png

Select your created application:

p5.png

In the tab "Development", you'll find the GIT URL.

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

p6.png

In Eclipse, Open perspectives and select "Git Repository Exploring":

p7.png

Select "Clone a Git repository"

p8.png

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

p9.png

Select master

p10.png

And Finish.

 

This is how your "Git Repositories" will look like:

p12.png

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

p13.png

Select Git:

p14.png

Select your created repository and your project

p15.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.

p16.png

Add a message, select all files and hit "Commit and push"

p17.png

Just hit OK

p18.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.

p19.png

We'll start by creating a first version:p20.png

Enter a name for your version:

p21.png

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

p22.png

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

p23.png

When I hit this URL, I get an HTTP Status 404... This is not what I've expected...

p24.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

p25.png

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

p26.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


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>