Вы находитесь на странице: 1из 15

openSAP

Developing Java-Based Apps on SAP Cloud


Platform (Update Q1/2017)
Week 1 Unit 1

00:00:11 Hello, and welcome to Week 1 Unit 1 of the openSAP course "Developing Java-based Apps
on SAP HANA Cloud Platform". In this first unit I would like to welcome you and give you an
overview of this course.
00:00:28 So what is SAP HANA Cloud Platform? It's the platform-as-a-service offering from SAP,
00:00:37 and you can use it to build new applications in the cloud to extend on-premise and cloud
applications and to integrate cloud applications with your on- premise landscapes and cloud
applications among each other.
00:00:55 What does the platform offer you? At the bottom you see the infrastructure layer. So the
platform runs in SAP-certified data centers.
00:01:05 Then you see the platform services that are offered by Cloud Platform. Those are, for
example, data and storage services with the persistence service and the SAP HANA
database there.
00:01:18 Those are core platform services with integration, with UX services, with mobile services,
with collaboration, security services, and more. Then we have some business services at
the top which are also offered.
00:01:34 And we offer several services for DevOps, and we offer runtimes and development
languages which you can use. On this course, we will be focusing on the Java Runtime, on
the Java programming language.
00:01:50 We will use this, and we will use many services, for example, also the persistence service or
the collaboration service and UX services. On the left, you also see some on-premise
products from SAP, or SAP HANA Enterprise Cloud so a managed cloud offering.
00:02:07 Those can be extended with SAP HANA Cloud Platform. And on the right, you see some
software-as-a- service products, and those can also be extended with SAP HANA Cloud
Platform.
00:02:19 But here SAP HANA Cloud Platform is really the innovative platform in the cloud where you
build new applications, you build extensions and integrations.
00:02:32 To get a full introduction to Cloud Platform, I would advise you to join the openSAP course
"SAP HANA Cloud Platform Essentials". Just click on the link here and you can do this
course now in a self-paced mode.
00:02:49 Then the cockpit. The SAP HANA Cloud Platform cockpit is really your main point of
administration and deployment and handling, managing of applications.
00:03:04 So you can use this to do most or all of your operational needs for the platform it's your
entry point for the platform in the Web. And you can see there, for example, your sources in
your account, your applications in your account, your users and much more.
00:03:20 So you might also know some of those slides already from a previous course or from the
system preparation, but I would like to show them again and talk a bit about them again.
00:03:31 If you don't want to do the hands-on exercises and you didn't do the system preparation
week, then this is the information here for you. If you have already done the system
preparation, just skip forward a couple of minutes.
00:03:45 So with the cockpit, where you can also do all your Web-based administration parts, then
the question is: Okay, what are we actually using on this course and with the application
which we are using on this course?
00:03:58 So our main runtime will be the Java Runtime, and it really enables developers to leverage
existing knowledge which they have if they are Java developers
00:04:09 and to bring applications into SAP HANA Cloud Platform and onto SAP HANA as a
database as well. We offer Java Tomcat servers on our cloud platform, which you can use
to run your Java applications.
00:04:24 We currently support Java 6, 7, and 8, and you can see this also from the SDKs which we
currently offer on our tools page.
00:04:36 And we really want to evangelize standards-based Java development here so you can really
leverage the huge ecosystem that is out there. And this is not really SAP-specific, but it's
really general standards-based Java development.
00:04:54 The same here also with our developer environment. We encourage you to use the Eclipse
IDE as your developer environment for Java development,
00:05:05 and there you can install the SAP HANA Cloud Platform tools for Java. You can also get
them on our tools page.
00:05:13 If you don't have this set up yet and you want to have it set up, then just have a look at the
system preparation. And here we really use the Eclipse IDE as an open-source developer
environment,
00:05:30 so that the huge ecosystem that is already there around the Eclipse IDE can be leveraged,
you can use the plug-ins available in Eclipse for your applications.
00:05:42 And we also offer our own plug-ins with our SAP HANA Cloud Platform tools for Java to
integrate into Eclipse so that you can, for example, deploy an application directly from
Eclipse to Cloud Platform
00:05:57 and do a couple of other things there as well. And here we also use the Eclipse IDE
because many of you,
00:06:06 especially if you are Java developers, you have previous experience with Eclipse, and so
now you can really leverage this here as well for SAP HANA Cloud Platform development.
00:06:17 You can also use another Java IDE, but this is the one recommended and supported by us.
Now the ESPM application scenario.
00:06:26 So ESPM Enterprise Sales and Procurement Model is the sample application which we
will be using throughout all the weeks and units of this course.
00:06:40 And the scenario for this application is that we have on the one side customers, and they
can order products online, and they can rate products and write reviews for those products,

00:06:53 and then we have retailers, so an authenticated user who can accept or reject sales orders
which are created from orders from the customers, and then the retailers can also update
product stock information,
00:07:09 meaning they can update how many products of a certain type they still have in stock.
That's the scenario of the application.
00:07:18 And now, what will we be covering on this course? We will be covering that you deploy the
ESPM application on your account,
00:07:28 and then we will play around a bit with the application, getting to know it. And then,
especially in the second week, we will have a very deep look into the application.
00:07:37 We will look at different parts of the application the front end, the back end, the database
connection and see how this was developed, and then do some exercises and develop
the parts of this as well to really get familiar with the concepts used here.
00:07:56 Then we will go into security and identity management and show you some features that the
Cloud Platform offers in that area, also together again with the ESPM application.
00:08:08 Next, in Week 4, we have collaboration and the document service. So we will show you an
integration with SAP Jam and the ESPM application,
00:08:18 we will see how the ESPM application makes use of the document service. And then in
Week 5 we look into some additional features, for example integration with API
management or with SAP Translation Hub.

2
00:08:33 So with this we are also again at the end of this unit. We have covered the elevator pitch of
SAP HANA Cloud Platform.
00:08:43 We have looked a bit at the cockpit, the Java Runtime, and the Eclipse IDE. We've gotten to
know why this is used together with our Cloud Platform and what some of the benefits and
capabilities of this are.
00:09:03 Then we got to know the scenario of the ESPM application, that of the Web shop and the
customers and retailers there. And then we got to know the scope of this course.
00:09:17 Thanks for listening to this unit and see you in the next unit.

3
Week 1 Unit 2

00:00:11 Hello, and welcome to Week 1 Unit 2 of the openSAP course "Developing Java-based Apps
on SAP HANA Cloud Platform". In this unit, we will have a look at Git together with the
ESPM application.
00:00:28 So what is Git? Git is a version control system for distributed versioning
00:00:35 which we will be using in this course to get our application, to clone our application, and
then to get a source code for the application which we are using.
00:00:46 Git was originally created in 2005 for Linux kernel development, and it very easily enables
collaborative workflows.
00:00:57 Git supports distributed versioning, and what this means is that what you see on the top part
of the graphic, with central versioning, a developer has only his local files and all versions of
an application are stored only on the central server.
00:01:14 With distributed versioning, like before you again have all the versions of an application
stored on the central server, but also each developer has all the code, so all the versions,
00:01:27 as well as his own files on which he is currently working. So there is no central authority and
each developer has the complete history,
00:01:37 and versions and branches are created locally. So what you would do... if a developer works
on a project together with other developers,
00:01:46 he would create his own branch and then work there on his own code, and then merge that
branch again into the master branch when he contributes his code to the master code line.
00:01:59 We will be using Git in a way that we will first, in this week, look at the master branch, so
really looking at the application in its whole path.
00:02:09 And then in the next weeks, we will also take specific branches in which we have put in
some specific code to showcase a certain part of SAP HANA Cloud Platform and the ESPM
application.
00:02:26 So... if you've already gone through the system preparation, just skip ahead a couple of
minutes, but here Git has an integration with Eclipse,
00:02:38 and this integration is already included with the recommended Eclipse IDE, which is the
Eclipse IDE for Java EE Developers. And if you have this, then you also already have your
Git client.
00:02:52 And you can also use this together with the Git command line or the GitHub Desktop client
in addition, but you don't have to use the two last parts.
00:03:03 Now the ESPM application. On the left side, you see here the full architecture of the
application.
00:03:13 So at the bottom you see our database layer we are using an SAP HANA database there,
and the three big parts here are customers, sales orders, and products,
00:03:27 Then we have in the back-end part... the back end is split into two parts. One part, the JPA
layer, which uses the EclipseLink framework as a JPA framework
00:03:41 to connect to the database and to handle all the database connections here automatically.
Then the second part of the back end is our OData provider.
00:03:53 There we are using the Apache Olingo framework to create OData interfaces for our front
end. And then the front end is written in SAPUI5, which follows the SAP Fiori design
guidelines.
00:04:13 And there we have two UIs: one for the customers and one for the retailers as shown in the
previous unit, where we introduced the ESPM scenario. We have customers who can create
orders,
00:04:28 and then retailers who can accept or reject those orders, update stock information, and the
customers can also rate products or write reviews for them.
00:04:40 So on the right side, you see here a link to the GitHub repository, and now let's switch to
this. So here we see the GitHub repository that's owned by SAP,
00:04:57 and there we have one project the "cloud-espm- v2" project and that is the version of the
ESPM application which we will be using throughout this course.

4
00:05:10 So what do you find there? You find a short description of the application to begin with, you
again find the business scenario, and then steps on how you can get started.
00:05:25 So if you also have a look at GitHub's various other sample applications which are offered
here under SAP, in the description in the readme file, you will often see a lot of information
on how to get started with this application for you as you follow this course.
00:05:46 This might be interesting, but we have also covered many aspects of what is written here in
previous videos, or we will cover them in other videos as well.
00:05:56 So you don't have to read through everything here, but as additional textual information, it's
always helpful to also read through these. And with this, here is a "Clone or download"
button,
00:06:12 and what's important here is that we need to copy this URL to Git, to our clipboard. And now
the steps covering what we will be doing in this unit, what the main part of this unit is, are
explained here,
00:06:27 which is that we take the ESPM application offered on GitHub and we clone this to our local
machine, so we clone this to EGit, to Git on our local machine via the EGit integration of
Eclipse.
00:06:47 So now first we need to copy the URL here, and then as a second part, we need to open up
our Eclipse and go to the Git view,
00:06:57 so you can just click here on "Views", open the Git view, or directly click on it if you already
see it here, and then you just do a right-click here and paste the repository,
00:07:11 or if it's written for you here, clone a repository so that's what we're doing now, we're
cloning a repository. You put this in here.
00:07:22 The main parts are filled out automatically, so the URI, the host, the path, the protocol
"https" is standard you can leave that. And then just put in your user and password for
GitHub.
00:07:38 So here, at github.com, a Git server offered by the GitHub company. So just sign up for an
account here, then you can put in your authentication, click on "Next",
00:07:55 and then all available branches are fetched from the server. And here you see that we have
the master branch, which is certainly the most important one.
00:08:05 And then we also have different branches to highlight different parts, or to do exercises with
different parts of the application and of SAP HANA Cloud Platform.
00:08:15 So "Directory"... that's fine, and then just click here on "Finish". That doesn't work for me
because I've already done this.
00:08:23 How long it takes for you to download all the branches depends on your Internet connection.
But what you see now is that here I've got the master branch checked out locally, and I've
got all other branches remotely as well.
00:08:42 And, for example, in the layer unit, if we want to use a different branch, we just double-click
here on the branch and check out that other branch.
00:08:52 For now, for this week, we just need the master branch so that's fine. And with this part in
Git now done,
00:09:01 we've actually successfully finished all the parts which are described here in the hands-on
part for this unit. So what have we learned in this unit?
00:09:12 We have learned what Git is and how it works. We have also seen how Eclipse and Git
work together: EGit the integration of Git for Eclipse.
00:09:25 And then we had a look at the ESPM application, we had a look at the architecture of the
ESPM application. And then we also saw where the code is hosted and we cloned the
ESPM application to our local machine.
00:09:42 Thanks a lot for listening and see you in the next unit.

5
Week 1 Unit 3

00:00:11 Hello, and welcome to Week 1, Unit 3 of the openSAP course "Developing Java-based
Apps on SAP HANA Cloud Platform". In this unit, we will have a look at Maven together with
the ESPM application,
00:00:25 and especially what we will be doing is building our application and then deploying it to SAP
HANA Cloud Platform. So first, having a look at Maven if you've already followed the
system preparation, just skip forward a couple of minutes.
00:00:41 Maven is a build management tool which we are using in this course to handle the build
process and to fetch all the libraries used in the ESPM application
00:00:52 so that we don't have to provide them and this is handled automatically. Maven was created
in 2002 to simplify the build processes in the Jakarta Turbine project
00:01:04 so the Apache Turbine project which was part of the Jakarta projects and the basic
concept in Maven is the project object model, or "POM" for short.
00:01:19 And one of Maven's primary goals is also to allow a developer to comprehend the complete
state of a development process and of the development effort in the shortest possible
timeframe.
00:01:34 This is not one of the parts which we are really using Maven for here. For us, it's mainly a
build management tool with the focus on automatically fetching all the libraries which we are
using.
00:01:46 The POM, the project object model you see it on the right side there, for example, you
see the dependency to the "junit" library in version "4.11". So this project which has this
POM here, it's a bit simplified as POM, but would be just using this one library currently.
00:02:09 The POM is the basic unit of work in Maven and it's contained in the file "pom.xml". So each
Maven project needs to have one of these files.
00:02:20 And all the dependencies are really specified in that file, so if you encounter a Java project
that's based on Maven and uses Maven as the build management tool,
00:02:31 just have a look at the pom.xml file and you will see all the dependencies that this project
has to other projects. Again, similar to Git, there is a Maven integration for Eclipse that's
called M2Eclipse, or M2E.
00:02:48 And, again, this is also already included with Eclipse for Java EE Developers, which we are
using in this course. You can also install the command line client and use that in addition,
but you don't need to have that.
00:03:03 To find out how you can set this all up, just have a look at the system preparation. Now
getting into the hands-on stuff now it's a bit more that we are doing.
00:03:14 We will first check that our Maven is correctly configured and that the settings are there.
Then we will import our Git project, or we will import our project which we cloned before with

00:03:29 we will build that project, and then we will deploy it to our Cloud Platform. With this, let's go
into Eclipse, and here we can now go to "Preferences..." and type in "maven".
00:03:47 And then, in Maven, go into "User Settings". So here.
00:03:52 There is a file "settings.xml" which is contained in your user home folder under a subfolder
".m2". There is the settings file, so if you don't yet have a settings file there, please create
one.
00:04:06 It always needs to be under the subfolder ".m2" in your user home folder, then the file
"settings.xml". Here, in the GitHub project of the ESPM application, you can also scroll
down, and you see the same here.
00:04:26 So the Maven configuration, how that's created, and also if you don't yet have a Maven
configuration here, you can also copy this. Important if you're not working behind a proxy
just delete this proxy part here.
00:04:44 So I can open this file, and then I see here, okay, I'm not working behind a proxy so I don't
have that set up.

6
00:04:51 I've got a development profile set up and automatically activated, so that's fine here. So
having set up our Maven correctly, now let's import the Maven project.
00:05:06 So here again, also go to Maven and then "Existing Maven Projects" that's important. And
then here, you can... you need to go into the "git" folder where you cloned the ESPM
application.
00:05:24 You can select that, and then you can also add this to a working set, which I like to do to
handle multiprojects. You can also just deactivate this here.
00:05:35 We see the ESPM application consists of three parts. Each of those parts has a POM file,
and one is the parent project which contains the parent
00:05:50 Now you can do a finish here and then your project is imported as an existing Maven
project. A first step which you should always do when you import a project here: Just mark
them and go to "Maven", and then here to "Update Project...".
00:06:09 And then just click on "OK" here. Sometimes if a regular Maven update doesn't do the trick,
you might want to use "Force Update..." here,
00:06:18 but usually just a regular update is totally fine. So having done this update of Maven, let's
have a look at what the next step is.
00:06:30 We see it here: Okay, we've imported this, and now the next step is to do a Maven build
with the command "clean install". So let's now select here and importantly only the
master, the parent POM,
00:06:47 then go to "Run As" and "Maven build..." with the three dots, which means you can put in
your additional goals, "clean install" were our two additional goals,
00:07:02 and then we run this. So now we see on the console how our project is built, how the tests
which are already in our project are executed,
00:07:12 and then how our application is assembled and put together in a WAR file. Okay, the build
was successful, so that's nice.
00:07:23 What's the next part? The next part, if we have a look here... okay, the build was successful
now we need to deploy our application.
00:07:32 So the result was a WAR file, so we now have a folder here "espm-cloud-web.war" and
that contains our application. Now we log in to our Cloud Platform, to our cockpit,
00:07:49 go to "Java Applications" and then to "Deploy Application". There, we select our WAR file.
00:07:59 So the WAR file is under the folder "deploy" in your "git" folder. So here you select the
application name, and then here I would suggest that you take the application name "espm".

00:08:17 So just "espm" as the application name for me, it tells me that this already exists, but for
you, this won't be the case. Then as the runtime, select "Java Web Tomcat 8" here,
because this was the runtime which we used to build our project
00:08:35 and which we are using in our project. JVM version "JRE 8" is then also usually
automatically selected and that's fine.
00:08:43 And then you just click on "Deploy", and when it's deployed it just takes a couple of
seconds you are asked if you want to start your application, and then please press "start
this application",
00:08:54 and then the start of the application will take a bit longer. And because of that, I've already
done this part, so my application's already started here.
00:09:04 And then when I click on my application, I see my application URL here. I can click on that,
open it up,
00:09:12 and then I see here my application deployed on the Cloud Platform, and automatically by
default, the Web shop opens. So that's the part here.
00:09:25 And here, now we can have a look at the application, at the Web shop part. But one more
thing which I would like to do to complete the setup of the application here:
00:09:38 Go to "Security" on the left, and then to "Roles", and then here we see a predefined retailer
role. And now we need to assign our user ID, which we can find here on the right under
"User Info" the P number.

7
00:09:57 And then I want to assign my P-user ID to the "Retailer" role. And that enables me to call
here in the second URL... the... retailer URL as well.
00:10:14 And then I'm authenticated automatically via this role, and now I can approve sales orders
and I can update the stock availability. With this, our application's now running, also the
retailer role is set up, and we have done all the steps described here.
00:10:31 So what have we learned in this unit? We have learned what Maven is and how it works.
00:10:37 We have also learned how Eclipse and Maven work together. And how our ESPM
application makes use of Maven in the build process.
00:10:46 We have also imported our project, we have updated the dependencies, built our project,
and deployed it to our Cloud Platform. Thanks a lot and see you in the next unit.

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

9
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,
00:07:09 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: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.

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

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

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

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

14
www.sap.com

2017 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://global12.sap.com/corporate-en/legal/copyright/index.epx 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.

Вам также может понравиться