Sie sind auf Seite 1von 17

openSAP

Developing Java-Based Apps on SAP HANA


Cloud Platform
Week 1 Unit 1
00:00:12

Hi, welcome to Week 1 Unit 1 of the openSAP course "Developing Java-Based Apps on SAP
HANA Cloud Platform".It's really great to see you all on this course, and now let's start with this
first unit, where you will get an overview over the whole course.

00:00:31

This course is aimed at you if you want to learn how to develop Java-based apps on SAP
HANA Cloud Platform, and as a cloud platform is such an integral part of all of this, let's kick it
off with an elevator pitch.

00:00:46

As the first point, lets talk about all those HANAs.SAP HANA is SAPs in-memory database
this should be known all around by now.

00:00:56

SAP S/4HANA as you can see in the top right and top left is SAPs cloud-first, mobile-first
optimized business suite with modules such as ERP, finance, and more.

00:01:11

SAP HANA Enterprise Cloud as you can see on the left is SAPs managed cloud product,
meaning you can give SAP your SAP application landscape,

00:01:22

and SAP will run this for you in SAP data centers like you would in your own data center.SAP
HANA Cloud Platform, on the other hand, is SAPs Platform as a Service offering in short,
PaaS.

00:01:37

This gives you access to numerous services that enable your developers to rapidly build
extensions, integrations, and completely new innovative applications.

00:01:50

Starting now bottom up, SAP offers a certified, secure infrastructure-as-a-service layer with
SAP data centers around the world for SAP HANA Cloud Platform.

00:02:02

At its core, SAP HANA Cloud Platform is a platform-as-a-service offering, as I said before.It
offers the elements that we see in the middle.

00:02:13

On the left and right we have SAP on-premise or managed cloud, as well as software-as-aservice solutions, for which extensions and integrations are easily built with SAP HANA Cloud
Platform.

00:02:26

Now lets focus on the platform-as-a-service part.SAP offers data and storage services with
SAP ASE and also SAP HANA.

00:02:37

A large set of platform services in the categories integration, UX, analytics, collaboration,
security, mobile, and IoT is offered, as well as business services through SAP Hybris as a
Service.

00:02:53

The main supported runtimes are Java, XSJS for SAP HANA native applications, and HTML5
with our SAPUI5 libraries.SAP HANA Cloud Platform also offers very good support for
development and operations

00:03:10

with the SAP Web IDE for developing SAPUI5 applications, also with Eclipse plug-ins, for
example, for Java development, and SDKs and the Cloud Cockpit.

00:03:23

Now we've just heard very briefly what SAP Cloud Platform is.Here you see the information for
the SAP HANA Cloud Platform Essentials openSAP course.

00:03:37

There you get a full introduction to Cloud Platform from a theoretical as well as a practical
perspective.You can also set up your free developer account you get instructions for this, as
well as for your local developer environment.

00:03:54

You also learn how you can deploy applications to the cloud, and you see how you can use
many of the services that SAP HANA Cloud Platform provides.

00:04:04

So this Essentials course is a prerequisite for the advanced course you're listening to now, so
if you haven't yet had a chance to look at this course,

00:04:15

please take a look now, you'll find the link in the bottom left-hand corner, And with the link to
this course, Week 1 is especially important because there you learn

00:04:28

how to sign up for your developer account, set up your environment, and that is really
important because we won't cover this information here in the advanced course.

00:04:38

Now this course is called "Developing Java- Based Apps".Let's first look at the Java Runtime.

00:04:46

The Java Runtime on SAP HANA Cloud Platform enables developers to leverage existing
knowledge and use that to bring applications to the cloud.

00:04:58

We have the Tomcat stack included.We ourselves use the Tomcat stack, and it's a Tomcat
server that your Java applications will run on.

00:05:09

We support Java EE 6, 7, and 8, and the JVMs are then 7 and 8.

00:05:17

You can deploy and run Java applications, and you can use the Eclipse Developer
environment to develop those applications.

00:05:26

Applications run on a runtime container, where they can use all the platform services APIs,
and also the Java standard APIs.It's full standards-based Java development that you'll know if
you're a Java developer.

00:05:45

Next we'll take a look at the Eclipse IDE the integrated developer environment.It's also
integrated with plug-ins from SAP, which are offered through our tools page,

00:06:02

where you can install those plug-ins and then very easily develop Java applications for SAP
HANA Cloud Platform.Capabilities of this developer environment are that it runs local on your
machine, so you don't necessarily need an Internet connection.

00:06:17

Of course you need this connection to deploy the applications, but just for pure development,
you don't need it you can even develop on the go if you don't have access.

00:06:28

The SAP HANA studio is the version with the SAP HANA tools if you want to do HANA
development.We also have the SAP HANA Cloud Platform tools for Java, which you need to
install via additional features for the environment

00:06:46

if you want to develop Java applications for SAP HANA Cloud Platform.Also, you really gain
the advantage of having this whole ecosystem

00:06:56

because Eclipse has a very broad ecosystem where many other plug-ins support your
development.And, of course, you can also leverage your existing knowledge if you've used
Eclipse before.

00:07:12

Third, we have our SAP HANA Cloud Platform cockpit.This is really the one-stop shop for all
your administrative needs on SAP HANA Cloud Platform.

00:07:24

You can easily access this cockpit via the Web, and there you can also deploy applications,
you can stop and start applications,

00:07:35

you can have a look at the log files, and much more besides.It's really the one entry point for
SAP HANA Cloud Platform,

00:07:44

and also when you're logging in to your account, you're directly redirected to the cockpit.You
can also change application configurations, especially in the security area.

00:07:57

We'll look at that in Week 3 of this course.You can also access the SAP Web IDE and develop
HTML5 applications directly in the cloud.

00:08:08

For Java applications, you develop them in Eclipse and then publish them either via the
cockpit or directly from Eclipse.You also have access to monitoring of all the resources,
databases, and applications that you have,

00:08:24

and what you're using of those resources.It's really the one point of contact for SAP HANA
Cloud Platform for all your administrative needs,

00:08:35

and all completely Web-based, so you can access it from any device.Now the Enterprise Sales
and Procurement Model (ESPM) application.

00:08:47

It's really also a very important part of this course because we will feature this application
throughout all five content weeks of the course,

00:08:56

and develop very specific parts of this application so you can really see how for one bigger
application you can develop such a Java-based application.

00:09:07

Now in this unit I would like to talk a bit about a scenario, and as ESPM already says, you can
shop for products, you can order products.

00:09:18

So in the bottom left-hand corner we have the customer, who can browse products online in a
store, and he can buy products, and he can also rate products and write product reviews.

00:09:33

Second, we also have the retailer role, who instead gains access from the back end, so from
behind it.

00:09:43

After a sales order has been created by a customer, the retailer can accept or reject such a
sales order.And the retailer can also update product stock information so that enough products
are always in stock.

00:09:59

This is an authenticated user, and we will take a closer look at this in Week 3, the security
week, where I will show you a few interesting things.So what's the scope of this course?

00:10:16

We will be deploying and playing around with the ESPM application a bit to really get to know it
in this first week.In the second week, we will develop specific parts of this application,

00:10:29

so more the core parts with the front end, the back end, and the database connection.In the
third week, we will go into security and identity management and see a few things there.

00:10:41

In the fourth week, we will look at collaboration, so an integration with SAP Jam Collaboration,
and we will also look at the SAP HANA Cloud Platform document service

00:10:51

and how you can integrate this in such an application.In the fifth week, we will look at some
additional features,

00:10:59

so we will feature SAP API Management, or SAP HANA Cloud Platform API Management
service, make use of this, and we will also take a look at SAP Translation Hub, to help with all
our translation needs.

00:11:16

So what have you learned in this unit? You have heard the SAP HANA Cloud Platform
elevator pitch,

00:11:23

and you have seen where you can get a full theoretical and practical introduction by having a
look at the SAP HANA Cloud Platform Essentials openSAP course.

00:11:34

You have also learned what the capabilities and benefits of the Java Runtime, the Eclipse IDE,
and the SAP HANA Cloud Platform cockpit are.

00:11:44

Last but not least, you have also got an overview of the ESPM application and of the scope of
this course.That's it for this unit.

00:11:53

Thanks a lot and see you in the next unit.Bye bye.

Week 1 Unit 2
00:00:15

Hi, welcome to Week 1 Unit 2 of the openSAP course "Developing Java-Based Apps on SAP
HANA Cloud Platform".In this unit, you will learn about Git,

00:00:26

as well as how the ESPM application makes use of Git.We will also do our first hands-on
exercise.

00:00:36

So covering Git in a very short overview, Git is a version control system which allows
distributed versioning,

00:00:46

so many different people can collaborate on the same project and Git enables this via version
control.Git was initially created in 2005 for Linux kernel development,

00:01:00

so you see the Linux logo on the right-hand side, and also the Git logo.Git really enables
collaborative workflows,

00:01:11

and in comparison to a couple of other version control systems, there is no central authority,
so each developer has the complete history on his local machine as well as it being in the
remote.

00:01:26

Versions are created locally, as are branches.So when we have a look at this diagram on the
right,

00:01:35

we see the central server where a developer can clone this repository.Each developer has this
repository with all the information and branches in it, so he can take whatever file he needs,

00:01:55

he can modify it and also check it in again, he can commit it or push it to the server,

00:02:03

so it's back on the server, and all other developers can then pull it from the server so they have
the latest version.How can Eclipse make use of Git?

00:02:17

Git can be used together with Eclipse through the EGit plug-in for Eclipse.EGit is an Eclipse
Team provider for Git

00:02:26

and it's included in Eclipse for Java EE Developers, so the version you should be using if you
want to develop Java-based apps for SAP HANA Cloud Platform.

00:02:39

You can also use or both together Git in the command line, or GitHub Desktop as an
addition.

00:02:47

So we will be focusing on the use of Git via Eclipse, but of course you can switch to whatever
Git tool you want.

00:02:59

Now the ESPM application.In the previous unit we covered the scenario,

00:03:03

so really a Web shop scenario where a customer can place an order, rate and review
products, and then also the retailer in the second role can approve or reject those sales
orders, as well as modify stock information.

00:03:19

Here on the left we see the architecture of the application.So we have first a UI layer written in
UI5 with the UI5 libraries for HTML5 by SAP,

00:03:34

and this then has two different views depending on whether you are a customer or a
retailer.This UI layer accesses the data from the back end via OData.

00:03:47

And for this we have here in the back end a layer with an OData provider, for which we are
using Apache Olingo.We will talk about this in a later unit.

00:03:59

There are two APIs: one for the customer UI and one for the retailer UI.Also in the back end
we have a JPA layer,

00:04:10

where the JPA the Java Persistence API is used to handle the database connection, to
model the products, and to then also have them directly in the database.

00:04:27

There EclipseLink is used, which is the reference implementation for the JPA.We also see the
database as is.

00:04:38

We will be using an SAP HANA database here, but in a database nothing really has to be
done that's all handled via the JPA in the Java code.

00:04:48

On the right-hand side you see the ESPM application in its used version, which was very
recently released.It's available on GitHub, where you can access it via this link, which we will
be doing in a minute.

00:05:04

And then we will be cloning this application to our local Git.So what will we do in this first
hands-on exercise?

00:05:16

We will first go to GitHub and the application, we'll take a look at the application there, then we
will copy the HTTPS URI for cloning,

00:05:27

we will open our Eclipse, which you should have set up before you started the course.If you
haven't yet set it up, please go back, have a look at the Essentials course,

00:05:38

and see how we set up our Eclipse and local developer environment there.We will look at the
Git perspective, we will clone the repository,

00:05:50

and that's it for this very first hands-on exercise in this unit.So now let's switch to the browser,

00:06:00

where our URL has already been entered, and now you can all see the project.

00:06:08

So it's very... We had previous versions of the ESPM application, written two years ago, for
example, also for the cloud.There are also versions which are SAP HANA native applications,
so written in XSJS,

00:06:23

But this one is really the Java-based version written for SAP HANA Cloud Platform and is a
reference application for this.So here you can now see a snapshot of the code,

00:06:37

so as we saw in the architecture we have this JPA module.So this here is more or less the
back-end part with the JPA,

00:06:48

and also with the Olingo implementation in the back end.And we have our second module, the
"espm- cloud-web" module,

00:06:56

where we have the UI, the front-end layer.Also, all of this is a Maven application, so packaged
as a Maven Java application.

00:07:07

We will look at Maven in detail in the next unit.Also, we set up this ESPM application by
packaging the SAPUI5 application directly in the Java application.

00:07:21

So really you just have to deploy the Java application, and inside this Java application, you
then have the SAPUI5 application.Here we also have "readme" information about the
Enterprise Sales and Procurement Model application.

00:07:37

So you see the business scenario, which we've just covered in the previous unit.And you also
have a quick start guide, which explains to you how you can set up your local developer
environment.

00:07:52

And also for Git, if you are working behind a proxy, you can see here how to set up your Git
proxy in Eclipse for EGit, so that is also set up.

00:08:07

Now let's take a look here and copy the HTTP as a URI so that we can clone the repository to
our local machine.Next we go into Eclipse,

00:08:23

where you might first be in the Java EE perspective, so here just select "Perspective" and then
the "Git" perspective.

00:08:34

We'll be needing this Git perspective to clone the repository.Next just right-click,

00:08:44

and you'll see that as soon as you paste in the all the information is automatically filled.

00:08:52

So for "Authentication", my user and password are already entered.Here you need to provide
your github.com account information.

00:09:03

So not your SAP HANA Cloud Platform information it's your github.com account information

00:09:10

because you're cloning the application from github.com.Click "Next" and the branches are now
visible,

00:09:20

which the application also has in the browser.We can also see all the branches here.

00:09:28

First the master branch is the default branch which you see, but here are also a couple of
different branches which we will be using in later units of this course.

00:09:37

For example, to do the exercises or to show certain integration with a certain service.Okay, we
leave all branches selected.

00:09:50

We will probably be needing these in later units.And now we see the directory where the
application will be stored.

00:10:01

And now we can also finish cloning this application.Here at the bottom right, we see that the
application is currently cloned,

00:10:14

and I can also clone this, so here now we see how the application is cloned from the
github.com server to our local machine.And here, we were successful the application was
cloned.

00:10:32

And we see here that all the branches are also here.We have all the branches here under
"Remote tracking",

00:10:41

and we also have our Local branch, for which the master branch is currently selected.In
"Working Tree" we can also see directly what files and folders are in the application.

00:10:56

We can dive more deeply into those in the next units.So now switching back to the hands-on
exercise,

00:11:08

what did we just do? We had a look at the application

00:11:14

and then cloned it to our local Eclipse, which was actually successful.So what have you
learned in this unit?

00:11:24

You have learned what Git is and how it works, as well as how Eclipse and Git can work
together via the EGit plug-in for Eclipse,

00:11:34

which is preinstalled with Eclipse for Java EE Developers.Then you saw the architecture and
code of the ESPM application,

00:11:43

and you also cloned the ESPM application to your local machine, to your local Git via
Eclipse.That's it for this unit.

00:11:52

Thanks a lot and see you in the next unit.Bye bye.

Week 1 Unit 3
00:00:13

Hi, welcome to Week 1 Unit 3 of the openSAP course "Developing Java-Based Apps on SAP
HANA Cloud Platform".In this unit you will learn about Maven, as well as how the ESPM
application makes use of Maven.

00:00:28

We will also do our second hands-on exercise.Now I'll give you a short overview about Maven.

00:00:37

Maven is a build management tool.It was initially created in 2002 to simplify the build
processes of the Jakarta Turbine project.

00:00:49

As in many cases, new innovations come out of completely different settings, so here this was
then later introduced as an Apache project,

00:00:59

and now it's been further developed by the Apache Software Foundation and all its
committers.It's based on the concept of a project object model (POM),

00:01:11

which we will also come to in a minute.Maven's primary goal is to allow a developer to


comprehend the complete state of a

00:01:22

development effort, or development project, in the shortest possible period of time.So really
getting a quick overview of a process and also during the build management process

00:01:36

so that you don't have to download each of the libraries and include them in your project
Maven handles all this for you.Now, looking at the POM in a bit more detail,

00:01:46

on the right-hand side of my screen you can see an extract of such a POM file.The POM file is
saved as a pom.xml file.

00:01:58

And you can see here, for example, the model version here it's 4.0.Also, for example, the
version of the application that should be created so here it's 1.0.

00:02:11

And also definitely very important: the dependencies.So with those dependencies you can
specify that in your application you want to use a certain library,

00:02:22

then in a certain version you specify both.And when you build your project with Maven,

00:02:29

Maven takes care of downloading this version of the library from the Internet, and then also
using this library, binding it to your application.

00:02:40

POM is essentially the basic unit of work for Maven, so everything that Maven has to do is
specified there.

00:02:50

Also, every Maven project has this pom.xml file, and we will also see that the ESPM
application has them.

00:02:59

In short, the POM contains every important piece of information about your project and is
essentially the one-stop-shop for finding anything related to your project.

00:03:14

How can Eclipse and Maven work together? It's similar to Git with the EGit plug-in for Eclipse.

00:03:21

There is a Maven plug-in for Eclipse called "M2Eclipse", or one of them is M2Eclipse, which is
the one that we'll be using.Sometimes it's abbreviated to M2E.

00:03:33

And it's essentially a Maven integration for Eclipse.As with EGit, it's included in Eclipse for
Java EE Developers, the version you should be using,

00:03:45

so you don't have to do anything.And of course you can also use the Maven command line,

00:03:51

so Maven is also available as a command line tool.You can use this in addition, but we will be
focusing on the Eclipse usage via M2Eclipse.

00:04:01

So, now coming to the hands-on exercise, what will we be doing in this unit?

00:04:08

In the previous unit, we cloned our Git repository from github.com to our local machine.Now
we will be importing this project, we will be building this project,

00:04:19

and we will be deploying it to SAP HANA Cloud Platform.In the next units, we will then look
into the deployed application in more detail.

00:04:32

One thing that's important with Maven is that we need to specify a "settings.xml" file.You can
find instructions about this on GitHub, in the readme of the ESPM application,

00:04:44

and we will have a look at this in a second.Now I'll go into GitHub,

00:04:51

and here, what we saw before where we got the URL for cloning the application, we also see
that there is a pom.xml file here,

00:05:01

and going into the documentation, we saw the scenario from before, a short introduction to the
developer environment, Git settings, and then we have the Maven settings.

00:05:12

So here, if you go to your settings in Eclipse, type in "maven" and then go to "User Settings",

00:05:19

you can find the user settings here, and if this file does not yet exist for you, then please create
a settings.xml file in the ".m2" folder.

00:05:29

The ".m2" folder is really the folder where Maven stores all its information.For example,
"settings" also has its own repository for all the libraries.

00:05:41

Here, as code, are the contents, or example contents, for the settings.xml file.This is the proxy
part.

00:05:51

If you don't have a proxy, then just put "false" instead of "true" here, or you can just leave the
proxy out altogether.

00:06:02

Because otherwise there would be an error when you're building or even importing the project,
because Maven can't get an Internet connection, and because of that, it can't download all the
libraries that it needs.

00:06:16

So here, if you're working behind a proxy, include it; if you're not working behind a proxy, don't
include it.Here we also have the instructions from the previous unit about cloning.

00:06:27

And next we have the instructions about building the Maven projects, so we will be using clean
install.

00:06:34

The POM file also contains written information about the SDK, so we have a minimum version
of the SDK, which is 2.87.

00:06:47

And we will be using the SAP HANA Cloud Platform SDK for Java EE 6 Web Profile.That's the
SDK we'll be needing for this application.

00:06:59

So please download this SDK if you haven't done so already, include it as a runtime in your
Eclipse,

00:07:06

and all being well, Maven should find this SDK.Okay, now I'll switch to Eclipse.

00:07:17

So previously we used the Git perspective now we are back in the Java EE perspective.And
we will "Import" and "Import...", so I just clicked on the project explorer and then "Import",
"Import...".

00:07:32

There is a folder "Maven" and "Existing Maven Projects".So the ESPM application is a Maven
project and it already exists, so we take this one: "Maven", "Existing Maven Projects".

00:07:45

Click on "Next >".And then we can specify the root directory of our application.

00:07:51

So Git usually stores all its information in your user folder, and then in a folder "git", and then
under the application name.

00:08:02

So here it's "cloud-espm-v2".And we will open this, and here we see that our project has three
POM files:

00:08:12

one parent POM file, and one for each module, so for the JPA module and for the Web
module.I will also add it to the working set, just to clean up my Eclipse.

00:08:24

You can do this as well but you don't have to.Now finish.

00:08:29

And on the bottom right, you'll see that my project is currently imported.And also the
workspace yes, you can see it here the workspace is built.

00:08:38

So Maven has already done a couple of things there, just in the background during the import.

00:08:46

Okay.Now it's done, we have our project.

00:08:49

And as the next step, we will be updating the dependencies.So for me everything is currently
fine, but sometimes you might see a red exclamation mark here.

00:09:03

This means there is still an error with your project.With Maven, the first step to try to fix this is
to go to "Maven",

00:09:11

so right-click on the parent project, then to go "Maven",

00:09:15

and then to "Update Project...".Here you can also enable "Force Update...",

00:09:20

so snapshots and releases are forced to update.And then just click "OK".

00:09:28

And you see that the Maven project is updated, so more or less the dependencies are
synchronized, the POMs are synchronized, so if you faced an error before, it's probably fixed

00:09:42

As the next step, we will go to "Run As", so click on the parent project again, click on "Run As",

00:09:49

and then go to "Maven build..." because here in this view we will need to set the goals as
"clean install".

00:10:02

With the "clean" command we tell Maven that it should first clean in the background and then
install our project.

00:10:11

We go to "Run", and now it will take a minute or so while our project is cleaned and built in the
background.

00:10:22

We have also included several tests with this project, so we have unit tests and also
integration tests.

00:10:29

These are then also run in the background together with the build process.You can disable
them in the POM file if you don't want to run them,

00:10:39

but usually you can just let them run and everything should be fine.Afterwards, on the
Essentials course we directly deployed a Java application via a server created in Eclipse

00:10:59

and then deployed this to SAP HANA Cloud Platform.What we will be doing with this
application is that in the ESPM parent project there is a folder "deploy",

00:11:13

and the WAR file is created in this "deploy" folder.So that you also know how to do this, we will
now go to our cockpit

00:11:26

and directly select this war file, and then deploy this Java WAR file.Okay, now the build is
finished.

00:11:33

We see here it's a "BUILD SUCCESS", so all three of our modules the parent module, the
JPA, and the Web module have all been built successfully.

00:11:45

Okay, now going back to my browser and to my SAP HANA Cloud Platform account via the
cockpit...

00:11:57

so let me just refresh this here...and the first thing that we need to do is go to "Java
Applications"

00:12:06

and then to "Deploy Application".If you don't know the cockpit yet, have a look at the
Essentials course,

00:12:11

where I show you and explain what the cockpit is, what it does, and what you can do with it.So
here is the WAR file location.

00:12:19

You need to go to your "git" folder, and then, under the "deploy" folder, select your WAR file.

00:12:28

Let's open it.The application name is really important.

00:12:33

It has to be "espm".So if you don't have this application name, the URLs that we might specify
later won't work.

00:12:41

So just enter the application name "espm" and everything should be fine.

00:12:45

And the runtime "Java EE 6 Web Profile" is automatically selected, and also the JVM version
is "JRE 7".That's the newest one that works together with the Java EE 6 Web Profile SDK.

00:13:03

Okay, now let's click on "Deploy", and now the WAR file is uploaded to SAP HANA Cloud
Platform in the background,

00:13:12

where a Java server is created, the WAR file is deployed to this Java server, and then this
Java server is started so that... let's start it... "espm"...

00:13:28

and here we see that our server was created, the WAR file was uploaded, and now the server
is starting.

00:13:35

Now we will also see that the application URLs will change.Here we also see that the Java EE
6 Web Profile is used as we specified before.

00:13:48

We won't be looking at the application directly in this unit, but one thing which we should do...
let's switch here to the slides...

00:14:01

is that we will need to add a retailer role to our user.So switching back here...

00:14:09

and then going to "Roles"...So here we see that a predefined role "Retailer" was created.

00:14:17

And here I will need to assign my user ID.How do I do this?

00:14:26

I just take my user ID from the URL.And it's really important to note that your user of your SAP
HANA Cloud Platform account doesn't have this "trial" at the end.

00:14:36

So with "trial" it's your account name, and without "trial" it's your user name.Let's assign here...
successfully assigned.

00:14:48

And that was it for the ESPM application.This is still starting, but it should have started in a
couple of seconds.

00:14:55

We will be looking at the application in more detail in the next unit.So what have you learned in
this unit?

00:15:06

You have learned what Maven is and how it works, as well as how you can use Eclipse and
Maven together.You have also imported and built the ESPM application in your Eclipse,

00:15:18

and then also deployed it to your SAP HANA Cloud Platform account.That's it for this unit.

00:15:24

Thanks a lot and see you in the next unit.Bye bye.

Week 1 Unit 4
00:00:11

Hi, welcome to Week 1 Unit 4 of the openSAP course "Developing Java-Based Apps on SAP
HANA Cloud Platform".In this unit, we will investigate the ESPM application front end.

00:00:26

The front end is a UI layer written in SAPUI5, so first, let's start a bit with SAPUI5.By
embedding SAPUI5 front-end code in a Java application, as we do with the ESPM application,

00:00:42

the SAP Fiori design principles can be leveraged to build a great user experience for a Java
application.Key capabilities of SAPUI5 are that you can build modern HTML5 front ends,

00:00:59

and you leverage the SAPUI5 JavaScript libraries.In the ESPM application we then connect
via OData to the application back end.

00:01:13

It's more or less based on HTML5 development, so you can leverage knowledge which you
have from there with some SAPUI5-specific elements, but it should be easy to learn for all
HTML developers.

00:01:30

You develop once and can run anywhere, so you can automatically run SAPUI5 on any device
and change the UI depending on whether you are looking at it from a desktop browser or from
a mobile browser.

00:01:43

And that's also what we'll be doing in this unit we will look at the code in a desktop browser
and in a mobile browser.And, of course, if you're, for example, developing with SAP Web IDE,
so from-scratch development,

00:01:57

you can also leverage code templates and always SAP Best Practices to really rapidly build
new applications with great user interfaces.And with this, I would like to jump directly into the
hands-on part.

00:02:16

There we will launch the app first in the customer perspective, so on the right again we have
the architecture view,

00:02:25

and we will now be covering more or less the UI layer, so written in SAPUI5 with the customer
point of view and with the retailer point of view.

00:02:37

In this application, the customer is authenticated just by his e-mail address, so if the customer
really wants to do anything, he really needs to provide his e-mail address.

00:02:51

The retailer has real authentication with a login, so as we did in the previous unit, we added
the retailer role to our user on the SAP ID service.

00:03:07

So this involves genuine authentication, and only areas accessed by the retailer are secured,
so only someone who is authenticated can access those.

00:03:20

Okay, so now we will begin with the customer point of view, then we'll switch to the retailer
point of view,

00:03:28

and finally we will have a short look at the code of the Web module so that you get an
understanding of how the ESPM application front end is written.

00:03:40

Okay.So let's jump into our application deployed on SAP HANA Cloud Platform.

00:03:46

Here we are in the cockpit.We see that the application has the status "Started", so everything
is fine there.

00:03:53

And I'll just briefly switch to the roles.In the last unit we assigned our user here,

00:04:01

so really the PN with the numbers but not "trial" at the end, so just the users without "trial", and
the account name is with "trial".

00:04:11

So here we assigned the user to this role and everything's fine.And here we can take this
application URL,

00:04:20

and then we can paste this application URL in here.And we see that the Web front end loaded
in the desktop browser.

00:04:34

As I said before, the ESPM application is more or less a shopping application for electronic
products.Here we can search, filter, group, and we can update the page,

00:04:51

but really it's about selecting products so, for example, we want this modem so we add it to our
cart.We get the message that it was added to our cart.

00:05:06

And on the top right we see that our cart now has one item in it.Now by clicking on the cart, we
can change the quantity.

00:05:17

We can also delete the item from our cart again.But now we will go to the checkout,

00:05:25

and now we can review our cart that we want to check out, we can then provide a user
account if we already have an account.

00:05:39

But I'm a new user so I provide my name, and then I enter my e-mail address.

00:05:48

Here you can just use any e-mail address no real e-mails are currently sent the way the
application is set up.So we'll just use "@somewhere.com" and enter the date of birth.

00:06:01

For now this will just be... You don't have to give your real date of birth. It's just up to
you.Some street number... some postal code...

00:06:21

and your country.Okay, so that is set.

00:06:27

Next go to step 3.If you wanted to buy something here, you would enter your credit card
details.

00:06:35

These are just dummy fields.And we can review our order, so here our name and address, our
billing information,

00:06:46

and then we can place an order. Okay.Our order was created successfully.

00:06:52

With this we are brought back to the initial screen, And here there's this one item that we didn't
use before.

00:07:02

Let's click on this.And here we can now authenticate with our


e-mail address,
so it was "sven.kohlhaas@somewhere.com".And now we can get our sales order lists, so
here's our list of current sales orders.

00:07:09
00:07:26

We see this has "New" status.And we could download the PDF file of this order, so more or
less an invoice.

00:07:35

Okay.With this done, we have covered how the screen looks from the customer's point of view
in a desktop browser.

00:07:49

As the second point, let's switch to the retailer role.So when we are here, we see that the URL
just has "webshop" at the end.

00:08:01

The retailer is the same URL but just with "retailer" here.Okay, that automatically authenticates
with your user of your SAP HANA Cloud Platform account which you put in there.

00:08:19

In the background the SAP ID service is used, which is also used, for example, for SCN.Now
we can approve sales orders,

00:08:30

so here we can see all the sales orders, and now here our new sales order was posted with
my e-mail address here.

00:08:40

And now we can approve or reject this order. Let's approve it. Okay.Now it's approved and the
status is "In Process".

00:08:50

Okay, going back to the customer point of view, we can provide our e-mail address.And now
we see that here the status that was previously "New" is now "In Process".

00:09:12

Okay, so with this done, we have also seen a bit of the retailer.The retailer has two options as
to what he does next:

00:09:22

The first one is to approve or reject sales orders, which we've just done, and the second one is
that the retailer can view and update the stock availability of products.

00:09:34

So here, for example, the mouse currently has the setting that... we have it here... items in
stock and target.So currently 55 items are in stock and there should be a minimum of 10 items
in stock.

00:09:53

Here we could now change this to "100" because we say that at least 100 of those should
always be in stock

00:10:04

because a big order or many orders might come in in a very short period of time so we always
need those 100 items.And here we now see that the status has changed and is showing that
not enough items are in stock.

00:10:23

Okay, so that was the stock availability view.Okay, with this covered, I suggest we switch to
the mobile browser and have a look at that.

00:10:40

Okay, now here on the left-hand side you can see my phone, and there I just created a QR
code for the URL of the Web shop, so of the customer view,

00:10:55

and then scanned this QR code with my phone so I didn't have to type it in at the top.But of
course you can also just type it in.

00:11:06

Now we can see the application, and here we can also add something to our cart.We can then
see our cart, we can also, for example, go in here and change the quantity of the items,

00:11:26

so let's say we don't want one of those but five DVD players.We can then go to the checkout.

00:11:35

Here we can then say that we already have an account.And let's see... type in our e-mail
address...

00:11:52

"@"... ".com"...Let's see, was it right? No, it wasn't right.

00:12:04

I used a big "S", but... we... need to use a small "s" at the beginning...otherwise this whole
thing won't work...

00:12:42

Okay, let's get this done right...Okay, all the information we just provided has now been filled
in.

00:13:01

We can go to the next step: our credit card information.Let's provide this...

00:13:08

and...with this also provided, we can check our order,

00:13:15

and then we can place our order.And we see that the order was successfully created.

00:13:23

Okay, with this done, let's have a look at the retailer area again with the sales orders.So here
we can update this.

00:13:32

And here we see that a new order came in same user, quantity "5", and here's the price.But
in this case, let's try rejecting the order. Okay, let's do it.

00:13:47

And here we see the order that was rejected.Now we can also switch back here just because
it's clearer in a desktop browser let's check this one here.

00:14:06

So we are now back in the role of the customer.Check the order list and see here whether our
big order was put in.

00:14:17

The quantity was 5, but the order was cancelled because as the retailer we rejected this
order.Okay, so we've now also looked at the UI layer on a mobile phone, using the browser
there.

00:14:38

Next we'll go to Eclipse and have a look at the Web module.So here, back in my Eclipse, let's
zoom in a bit.

00:14:49

Okay, here we have the Web module.And this Web module first has the Java resources,

00:14:59

where we see a couple of packages in the "src/main/java" folder.Here we have, for example,
the Web package which handles the OData service provided by Apache Olingo.

00:15:20

For example, this is also included there we will have a look at this in a later unit.There are
also a couple of packages here: the builder, the PDF generator, which I used to generate and
handle those invoices.

00:15:36

And here are a couple of Java classes.But the really important part is the UI layer.

00:15:44

We also have here the deployed resources, and of those, we have here the Web shop
application, and that's really what we just accessed.

00:15:58

We also have the retailer application here.First let's have a look at the Web shop.

00:16:03

So here we have several different classes, which we will also go into later in more detail.But
just for now, we have our views here,

00:16:15

so the MVC model-view-controller principle is used, which should be familiar to many UI


developers.Here we also have the "i18n" file, which covers the properties for language.

00:16:32

And it's also the same for the retailer application.So here there are similar folders.

00:16:38

Here we have our controllers of the views, we have the views, we have the model.So it should
be more or less familiar to other SAPUI5 and HTML5 developers.

00:16:54

Okay, with this, perhaps just one more thing briefly.Here we have the "web.xml" file, which is
also really important.

00:17:05

Here we have the "manifest" files.If you want to have a look at SAPUI5, you can do that as
well.

00:17:15

That would contain much more explanation of those files.There are also several openSAP
courses about SAPUI5 on openSAP.

00:17:25

Okay, with this, let's zoom out and come back to our presentation.We had a very short look at
the Web module,

00:17:33

and in the second week of this course, we will then have a couple of units where we will also
go into more detail and develop parts of the Web module code.

00:17:45

So what have you learned in this unit? You have learned the capabilities and benefits of
SAPUI5.

00:17:52

And you have investigated the ESPM application front end in the browser, as well as its code
in the Web module.

00:18:01

That's it for this unit.Thanks a lot and see you in the next unit.

00:18:05

Bye bye.

Week 1 Unit 5
00:00:11

Hi, welcome to Week 1 Unit 5 of the openSAP course "Developing Java-Based Apps on SAP
HANA Cloud Platform".In this unit we will investigate the ESPM application back end and
database.

00:00:28

So let's start with a bit about SAP HANA because this is the database which we will be using
and it's very important to know a bit about

00:00:40

So, what is SAP HANA? SAP HANA is an in-memory database and application platform,

00:00:47

but in our case, we will be using just the in- memory database part.It's a standard relational
database management system,

00:00:59

and it's ACID and SQL-92 compliant.So generally what many other databases are as well.

00:01:10

It's accessible through JDBC, ODBC, JSON, and OData.But we will be using more or less the
JDBC access, which is wrapped in JPA a Java Persistence API.

00:01:27

So that's how we will be using SAP HANA.We will be using it as a service on SAP HANA
Cloud Platform.

00:01:37

We will be using it as our database.And our connection will be via JPA via JDBC.

00:01:49

Okay, with this we will go directly into the hands-on part.So first we will be going to the cockpit,

00:01:57

where we will see our data source binding and our corresponding database or schema, which
the application automatically created while creating the server and deploying the application.

00:02:13

Next we will investigate the module code, so the OData provider in the Web module, and also
the model classes in the JPA model.

00:02:26

So first we'll have a look at the part on the bottom right in the architecture, so the SAP HANA
database.And then we will move upwards, step by step, so next the JPA part.

00:02:42

And then the OData provider.So I'll switch to the browser to github.com, the location of the
ESPM application,

00:02:59

where we also have a deep-dive guide, so here you can also see the architecture and those
layers of the application.

00:03:10

And then also which we will come to in a minute you can access the JPA Class
diagram.We will see this shortly.

00:03:21

So we are in our ESPM application.In the cockpit we will go to "Data Source Bindings".

00:03:28

So of the Java application select the ESPM application and then "Data Source Binding".And
we see here that the default data source is "DB/Schema".

00:03:43

So here is a schema that was created while the application was being deployed.The database
system is "HANA (<shared>)",

00:03:50

so it's just a shared HANA system which I used here on the trial landscape.And we see the
database version.

00:03:58

We can also click on this schema, and here we see the binding is to the Java application
"espm".

00:04:08

And here this is the schema, which is of the type HANA as we saw before.

00:04:15

And when we go to all our databases and schemas, we also see here that this schema was
created for our ESPM application.

00:04:29

So by default a HANA shared schema is created for an application, but if you want to, you
could also create a HANA MDC database,

00:04:41

and create a database binding with a database user for the ESPM application here and then
this one would be used, but it's much easier to just use the default setting, which is the "HANA
(<shared>)" version.

00:04:56

But both would work fine.So next let's take a look at Eclipse.

00:05:05

So here we have the two modules: the Web module and the JPA module.First we'll look at the
JPA module, so let's zoom in a bit.

00:05:16

Here in the "src/main/java" part, we have our model classes, which are really all the JPA
classes that we need.

00:05:30

So let's, for example, open the customer class.Here we see all the JPA annotations that are
needed to put more or less this class

00:05:43

which we have here written in Java also into a database table.And all of that is automatically
handled by JPA.

00:05:55

Okay, so it's the same for all the other classes here.Here we also have two more packages
but, for example, here the data part is just to get

00:06:05

the data which is provided as a resource in XML to upload this into the application.And some
"util" classes.

00:06:15

Okay, so with this we also have here the resources which I just mentioned, and also the test.

00:06:24

The JPA Content is then here, which contains the "persistence.xml" file, where you can see
this class diagram.But here it's easier just to go to GitHub,

00:06:39

where you can select the class diagram and look at it.You can see all the important classes
and their attributes.

00:06:49

Sometimes it's useful to have a look there.Also, in this deep-dive guide, if you want to read a
bit,

00:06:57

you can do this here as well to really get a bit of an overview of the whole application.Okay,
with this JPA content covered,

00:07:08

let's now, as a second point, have another look at the Java code of the Web module.And here
in the Web package, we have our "EspmServiceFactory"

00:07:28

and the "JpaEntityManagerFactory".So those really are the main classes which implement the
OData service via Apache Olingo,

00:07:38

so Apache Olingo's libraries are used for this.And then we also have here
"EspmProcessingExtension",

00:07:45

for which the function implementation... they are used together.So those are needed to use the
specific names which go over what is given by default.

00:08:03

If you want to do more, you can specify such classes.We will also cover this in more detail in
Week 2 of this course.

00:08:12

Here we also have "StartupServlet" to get all this going, and "EspmServiceFactoryFilter",
which handles some security aspects.

00:08:21

As I mentioned before, we also have here some builder and PDF generator classes.Those are
used to communicate with the SAP HANA Cloud Platform, document service.

00:08:39

And we will go into those a bit in the units about the document service.Okay.

00:08:49

So with this covered as well, let's switch back to our slides.And what did we do here? What
have you learned in this unit?

00:09:05

You have learned what SAP HANA is and how we will be using SAP HANA in the ESPM
application and on this course.

00:09:14

You will also have investigated the ESPM application, its data source binding and
corresponding database or schema.

00:09:24

So here, in my case, it was the default schema that I used.And you have also investigated the
back end with the JPA module code

00:09:35

and also the code for the OData provider in the Web module.That's it for this unit.

00:09:42

Thanks a lot and see you next week.

www.sap.com

2016 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form
or for any purpose without the express permission of SAP SE or an SAP
affiliate company.
SAP and other SAP products and services mentioned herein as well as their
respective logos are trademarks or registered trademarks of SAP SE (or an
SAP affiliate company) in Germany and other countries. Please see
http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for
additional trademark information and notices. Some software products
marketed by SAP SE and its distributors contain proprietary software
components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for
informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in
the express warranty statements accompanying such products and services,
if any. Nothing herein should be construed as constituting an additional
warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue
any course of business outlined in this document or any related presentation,
or to develop or release any functionality mentioned therein. This document,
or any related presentation, and SAP SEs or its affiliated companies
strategy and possible future developments, products, and/or platform
directions and functionality are all subject to change and may be changed by
SAP SE or its affiliated companies at any time for any reason without notice.
The information in this document is not a commitment, promise, or legal
obligation to deliver any material, code, or functionality. All forward-looking
statements are subject to various risks and uncertainties that could cause
actual results to differ materially from expectations. Readers are cautioned
not to place undue reliance on these forward-looking statements, which
speak only as of their dates, and they should not be relied upon in making
purchasing decisions.

Das könnte Ihnen auch gefallen