“getting up and running” contents index the author...in many ways, sap hcp accounts are not unli...

27
Reading Sample In Chapter 2, you’ll set the stage for your future Java, native SAP HANA, and HTML5 applications by installing and configuring all the pieces and parts you need to get SAP HCP up and running. James Wood Getting Started with SAP HANA Cloud Platform 519 Pages, 2015, $69.95/€69.95 ISBN 978-1-4932-1021-3 www.sap-press.com/3638 First-hand knowledge. “Getting Up and Running” Contents Index The Author © 2015 by Rheinwerk Publishing, Inc. This reading sample may be distributed free of charge. In no way must the file be altered, or individual pages be removed. The use for any commercial purpose other than promoting the book is strictly prohibited.

Upload: others

Post on 28-Feb-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Reading SampleIn Chapter 2, you’ll set the stage for your future Java, native SAP HANA, and HTML5 applications by installing and configuring all the pieces and parts you need to get SAP HCP up and running.

James Wood

Getting Started with SAP HANA Cloud Platform519 Pages, 2015, $69.95/€69.95 ISBN 978-1-4932-1021-3

www.sap-press.com/3638

First-hand knowledge.

“Getting Up and Running”

Contents

Index

The Author

© 2015 by Rheinwerk Publishing, Inc. This reading sample may be distributed free of charge. In no way must the file be altered, or individual pages be removed. The use for any commercial purpose other than promoting the book is strictly prohibited.

Page 2: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

41

In this chapter, we’ll take a look at what it takes to get up and running with SAP HCP application development. By the end of this chapter, you’ll have everything you need to begin developing live applications on the plat-form.

2 Getting Up and Running

Now that you have a feel for what SAP HCP is from a conceptual perspective,you’re probably itching to take it for a test drive and see what it can do. We’llhave a chance to do just that in Chapter 3. However, in the meantime, there areseveral administrative items that we need to sort out.

First of all, in order to do any real work on SAP HCP, we need to get our hands onan SAP HCP developer account. This account will be used to log onto the plat-form, allocate and assign resources, deploy applications, and more. We’ll explorethe account provisioning process in Section 2.1. In Section 2.2, we’ll take a quickinventory of what’s included with an SAP HCP account. Finally, in Section 2.3,we’ll show you how to set up SAP HCP development tools on your local machine.With these tools in place, you’ll be ready to hit the ground running in Chapter 3when we start getting our hands dirty with application development.

2.1 Obtaining an SAP HCP Account

In order to access SAP HCP, we must apply for an account with SAP. In this sec-tion, we’ll take a look at the various account types offered by SAP and see howthey differ from one another. We’ll also show you how to set up a free developeraccount that you can use to take SAP HCP for a test drive.

2.1.1 Understanding the SAP HCP Account Concept

In many ways, SAP HCP accounts are not unlike the accounts you set up with util-ity companies, such as your local electricity or Internet service provider. If you

Page 3: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

42

have ever had the pleasure of setting up one of these accounts, then you’re nodoubt familiar with the basic procedure:

1. First, you choose among the various account types and/or service plans offeredby the service provider.

2. Then, you enter into some form of contract agreement whereby you as the cus-tomer agree to pay a certain fee, and the provider agrees to provide therequested services according to the service level agreements (SLAs) set forth inthe contract.

In the context of SAP HCP, accounts are used to determine the scope of resources/services a customer wishes to procure from SAP. Once a customer registers for anaccount, the account becomes the key to accessing the platform, deploying appli-cations, and much more.

At the time of this writing, SAP offers three different account types: developer,customer, and partner. These account types differ in terms of pricing model, theamount of cloud-based resources allocated, and usage conditions. Let’s take alook at each of the available account types in detail.

Developer Accounts

The first account type that we’ll take a look at is the free developer account. Thisaccount type is provided for developers who wish to explore SAP HCP and seewhat it has to offer. Unlike other SAP trial accounts that you may have workedwith in the past, the SAP HCP developer account never expires, so you can con-tinue to use it as a trial or sandbox account indefinitely.

For the most part, developer accounts provide access to the majority of featuresand services provided by SAP HCP. However, because this is a free account, SAPdoes limit the amount of resources you can consume using this account. In partic-ular, as of the time of writing, developer accounts come with the following lim-itations:

� You can only run a limited number of applications at a time.

� Only 1 GB of database storage and 1 GB of document storage is provided.

� Only one user can exist per account.

Obtaining an SAP HCP Account 2.1

43

Customer Accounts

As the name suggests, customer accounts are accounts that customers purchasefrom SAP in order to host productive applications in the cloud. Unlike the morelimited developer accounts, customer accounts offer full access to SAP HCP pro-ductive services as well as 24-7 support from SAP.

In order to support a wide range of customer types, SAP offers a multitude of con-figuration options, which allow customers to choose the configuration that bestmeets their needs. You can obtain a pricing sheet and browse through the variousconfiguration options by logging onto the SAP HANA Marketplace at http://marketplace.saphana.com/New/SAP-HANA-App-Services/p/1808. In most cases, youcan choose the target configuration and purchase the customer account rightfrom within the SAP HANA Marketplace. After the initial purchase, customershave the option over time to purchase more resources from SAP as the needarises.

Tip

To ensure fast response times for productive applications, customer accounts are hostedin regional data centers that are in close proximity to the target user base. At the timeof this writing, SAP has three data centers, covering the Americas, Europe, and Asia-Pacific regions.

Partner Accounts

This account type is provided for SAP partners who are interested in buildingcloud-based applications and selling them to customers. Access wise, partneraccounts are similar to customer accounts in that they have access to the full set ofSAP HCP productive services. However, because these types of accounts are nor-mally used for development and prototyping, the amount of allocated resourcestends to be less than for your average customer account. That being said, SAP willallow partners to purchase more resources as needed.

For more information about this account type and the SAP PartnerEdge program,log on to https://www.sapappsdevelopmentpartnercenter.com.

Page 4: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

44

2.1.2 Registering for a Free Developer Account

If this book is your first foray into the world of SAP HCP, then it probably makessense to start your journey by registering for a free developer account. The stepsrequired to sign up for a developer account are as follows:

1. Log onto the SAP HCP trial account landing page at https://account.hanatrial.ondemand.com, as shown in Figure 2.1.

Figure 2.1 Registering for a Free SAP HCP Developer Account: Part 1

Obtaining an SAP HCP Account 2.1

45

2. From the landing page, click on the Log On button. This will bring up the Log

On page shown in Figure 2.2. From here, you have one of two options. If youalready have an SAP ID or SAP SCN account, then you can plug in your accountcredentials into the Log On form and click on the Log On button to link thisaccount with your SAP HCP developer account. A quick acceptance of thelicense agreement, and you’re up and running.

Figure 2.2 Registering for a Free SAP HCP Developer Account: Part 2

3. If you don’t yet have an SAP ID and/or an SAP SCN account, then you’ll needto create one by clicking on the Register Now button shown on the left-handside of the screen in Figure 2.2. This will open up the Registration windowshown in Figure 2.3. Here, you must specify a minimal amount of contact infor-mation and agree to the terms and conditions in order to register. After yousubmit the form, you’ll receive a confirmation email, via which you can con-firm the registration and activate your account.

Page 5: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

46

Figure 2.3 Registering for a Free SAP HCP Developer Account: Part 3

Regardless of the approach you take, the account creation process ends with youlogged onto the SAP HCP Cockpit application shown in Figure 2.4. As you canimagine, we’ll be spending a considerable amount of time in this cockpit as wedevelop and deploy applications, provision resources, and so on. Therefore, it’s agood idea to bookmark the cockpit’s page for future use: https://account.hana-trial.ondemand.com/cockpit. Also, if this is the first time you’ve ever accessed SAPHCP, we’d encourage you to take a look around the cockpit and becomeacquainted with the various tab pages, which will give you a sense of what’sincluded with your SAP HCP account.

What’s in the Box? 2.2

47

Figure 2.4 Logging onto the SAP HCP Cockpit for the First Time

2.2 What’s in the Box?

Now that you’ve gotten your hands on a shiny new SAP HCP account, let’s take amoment to unwrap the packaging and see what’s included out of the box withSAP HCP. In addition to helping you understand more about what SAP HCP pro-vides on a technical level, this brief analysis will also help you recognize the typesof tools you’ll need to install and configure in order to start developing SAP HCPapplications.

2.2.1 Application Runtime Containers

As we noted in Chapter 1, SAP HCP was designed from the ground up to supporta wide variety of programming models. This BYOL (bring your own language)approach lowers the entry barrier to SAP HCP by allowing development teams toleverage preexisting skillsets when migrating to the platform.

Page 6: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

48

In order to support multiple programming languages, SAP HCP employs the useof a series of modular and lightweight runtime containers. These containers pro-vide a secure and scalable runtime environment for running applications basedon a particular programming model (e.g., Java).

Next, we’ll take a closer look at the types of runtime containers included with SAPHCP. We’ll also look ahead a bit and see what other container types SAP has onthe roadmap in the near term.

Runtime for Java

Going back to the days when it went by the codename “NEO,” SAP HCP hasalways had excellent support for Java-based application development. From atechnical perspective, the Java applications that we develop are deployed in a spe-cialized runtime container called Runtime for Java. Figure 2.5 illustrates the basicarchitecture of Runtime for Java. As you can see, the basis for this runtime envi-ronment is the Compute Unit. As consumers of SAP HCP, we can think of Com-pute Units as virtualized host machines complete with their own CPU(s), mainmemory, disk space, and an installed operating system.

Figure 2.5 Architecture of the Runtime for Java

From a Java development perspective, the basis of a Compute Unit is the Java Vir-tual Machine (JVM). Here, SAP utilizes a proprietary JVM derived from Oracle’s

Java Web Application

Application Runtime Container

Java Virtual Machine (JVM )

Compute Unit

What’s in the Box? 2.2

49

HotSpot JVM called the SAP JVM. Compared to the default JVM provided by Ora-cle, SAP JVM offers a number of useful features related to debugging, memoryprofiling, and instrumentation.

On top of the SAP JVM, we have the Application Runtime Container, shown in themiddle of the architecture diagram contained in Figure 2.5. If you’re familiar withEnterprise Java development, then you can think of the Application RuntimeContainer as being analogous to web containers you may have worked with, suchas Apache Tomcat or any of the number of leading Java EE application containerson the market. In essence, the Application Runtime Container furnishes our Java-based web applications with all of the libraries and services they need to get thejob done.

As of the time of writing, SAP allows us to configure the Application RuntimeContainer according to three different profiles:

� Java EE 6 Web This profile provides the full complement of APIs offered by the Java EE 6 Webprofile. Here, in addition to Servlets and JavaServer Pages (JSPs), we also haveaccess to Enterprise JavaBeans (EJBs), the Java Transaction API (JTA), the JavaPersistence API (JPA), and more. These APIs simplify the enterprise applicationdevelopment process by assuming ownership of lower-level technical con-cerns, such as transaction management, object-relational persistence, and soon. For more about the Java EE 6 Web profile, see the boxed note ahead.

� Java Web According to the online help documentation, the Java Web profile offers “asubset of Java EE standard APIs typical for a standalone Java Web Container.”An example of a typical web container is the popular Apache Tomcat container.Such containers provide support for developing Java web applications usingServlets, JSPs, and so on. They do not, on the other hand, support the entireJava EE API. This means that you cannot utilize other Java EE-based technolo-gies (such as EJBs) on the Java Web container. Of course, you still have accessto the full Java SE library, as well as all of the custom SAP HCP service APIs.

� Java Web Tomcat 7 This profile (which is in beta release as of the time of writing) offers similarfunctionality to the Java Web profile. The primary difference is that the webcontainer for this profile leverages the Apache Tomcat 7 web server without

Page 7: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

50

modifications. This implies that certain cloud-based services will not be avail-able at runtime.

What Is the Java EE 6 Web Profile?

The Java EE 6 Web profile was introduced in conjunction with the Java EE 6 specifica-tion. Conceptually, you can think of the Java EE 6 Web profile as a stripped-down ver-sion of the Java EE stack. Here, a subset of the common APIs used to develop Java-based web applications were grouped into a separate profile that application servervendors could use to build lighter-weight application containers. Naturally, such pro-files make a lot of sense for cloud-based software providers such as SAP.

As developers, it’s only natural to assume that “stripped down” implies “less awesome.”In this case, however, we think you’ll find that the APIs that were taken out have littleto do with cloud-based application development. For example, it’s probably unlikelythat you would need access to RMI/CORBA-based remoting when developing webapplications in the cloud. In other cases, you will find that there are cloud-based ser-vices that offer features that are similar (and arguably better) than the missing Java EEAPIs. We’ll find examples of this as we progress throughout the book.

One final distinction we should make here is with regards to EJB support in the Java EE6 Web profile. Although the profile does include support for EJB development, it uti-lizes a specialized specification called EJB Lite. EJB Lite is a subset of the EJB 3.1 speci-fication that provides support for session beans (stateful and stateless), singleton beans,and the associated container-based management features. Notably absent here aremessage-driven beans, JAX-WS endpoints, remoting, and backwards compatibility toEJB 2. Because these features aren’t really used for web application development, thisomission doesn’t really impact the way we approach application design, but it’s import-ant to understand the differences all the same.

We’ll have an opportunity to delve into Java-based application developmentbeginning in Chapter 3.

Further Resources

You can access the Java web help documentation online at http://help.hana.onde-mand.com. Within the SAP HANA Cloud Platform section, navigate to Java Develop-ment � Runtime for Java to learn more about the latest innovations in this space.

SAP HANA Runtime

One of the distinguishing features of SAP HCP is its built-in support for in-mem-ory computing with SAP HANA. This support exists on two levels:

What’s in the Box? 2.2

51

� Basic database access In this scenario, applications are developed using a general-purpose program-ming language (such as Java), and the SAP HANA database is used as the under-lying database. Here, the SAP HANA database is used just like any other rela-tional database management system (RDBMS), providing access using standardSQL.

� Full-scale native SAP HANA development In this scenario, applications are built from the ground up using native SAPHANA-based development artifacts (e.g., SQLScript-based stored procedures,server-side JavaScript, and custom view types). This approach is ideal for thedevelopment of analytical applications, which deal with lots of data.

In the latter usage scenario, the native SAP HANA development objects aredeployed on the SAP HANA Runtime, which is essentially a cloud-based SAPHANA Extended Application Services (SAP HANA XS) instance.

What Is SAP HANA XS?

If you’re not familiar with SAP HANA XS, then a brief introduction is in order. Inessence, SAP HANA XS introduces a full-featured application server that sits directly ontop of the SAP HANA database. This application server can be used to develop webapplications based on technologies such as SAPUI5, server-side JavaScript, and nativeSAP HANA development objects (e.g., SQLScript procedures and analytical views).

Because SAP HANA XS sits on top of (and is tightly integrated with) the SAP HANAdatabase, native applications deployed on this application server enjoy the benefits ofhaving localized access to data. By eliminating the overhead of transferring data fromthe database tier to the application tier, native applications can churn through largeamounts of data very quickly. For this reason, SAP HANA XS is well suited for buildinganalytical applications and the like.

Within SAP HCP, the SAP HANA XS application server plays a similar role as Run-time for Java: It provides an application server that we can use to create webapplications. Here, we can go about constructing SAP HANA native applicationsin much the same way that we would develop such applications on-premise.

To put all this into perspective, consider the basic architecture of an SAP HANAnative application deployed on SAP HCP. As you can see in Figure 2.6, the cli-ent tier of this application is based on SAPUI5 technology. The SAPUI5 contentis served up to clients by the SAP HANA XS engine, which includes a built-inweb server. Because of the ubiquitous nature of HTML5, such content can be

Page 8: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

52

consumed by PCs, tablets, or smartphones without requiring the installation ofany client software (e.g., the SAP GUI client).

Figure 2.6 Basic Architecture of an SAP HANA Native Application

On the server side of things, we can see how the application logic is distributedbetween the SAP HANA XS engine and underlying SAP HANA database. Whichlayer(s) we choose to implement our logic depends largely on the requirements.For example, if all we’re doing is performing simple CRUD (create, remove,update, and display) operations, then basic SQL/SQLScript should generally suf-fice. On the other hand, if the requirements call for lots of procedural logic, thenwe’ll need access to more general-purpose language, such as server-side Java-Script. In this case, it makes sense to exploit the capabilities of the SAP HANA XSengine in tandem with pure SQL/SQLScript.

The communication channels between the client tier and the SAP HANA XS back-end are primarily defined using the OData protocol. This REST-based protocol isused to create lightweight web services that can easily be consumed via JavaScriptand SAPUI5 widgets. We’ll have an opportunity to see how all this comestogether in Chapter 5.

SAP HCP

SAP HANA Runtime

SAP HANA XS(Procedural Application Logic)

Server-Side JavaScript, etc.

SAP HANA DB

R

Client

Web Browser ClientSAPUI5:HTML5 + JavaScript + CSS

R

(Data -Oriented Appl. Logic )SQL, SQLScript, Views

OData

What’s in the Box? 2.2

53

HTML5 Application Container

For UI-centric application scenarios, SAP HCP also provides support for thedeployment of HTML5 applications. These lightweight applications are deployedto a Git repository, from which their static resources (e.g., HTML, JavaScript, andCSS) are served up via a shared dispatcher service embedded within SAP HCPitself. We’ll learn more about how all this works in Chapter 7.

More Runtime Containers on the Horizon

As of the time of writing, SAP has made it made it known that there are plans fordramatically increasing the scope of SAP HCP language support based on strategicpartnerships with Cloud Foundry and Docker. Once this integration is in place,SAP HCP will truly support BYOL through a series of new runtime containers thatare more generic in nature. For now, support for most of the popular cloud devel-opment languages must be deployed via the Runtime for Java via third-partyimplementations, such as JRuby, Jython, and so forth.

2.2.2 SAP HCP Enablement Services

As a true PaaS solution, SAP HCP provides much more than just a series of stand-alone runtime containers. It includes a series of enablement services that providean abstraction around the access and consumption of cloud-based resources.Table 2.1 contains a list of the more prominent services provided by SAP HCP asof the time of writing. As you’re reading this, keep in mind that the service offer-ing continues to expand, so it’s definitely a good idea to periodically check inwith the SAP HANA Cloud Documentation to see what’s new.

Service Description

Persistence Service This service provides an abstraction on top of relational database instances deployed in the cloud. This abstraction provides developers with a common interface for accessing database instances while at the same time shielding them from the underlying complexities of scaling databases in the cloud.

Connectivity Service This service provides developers with a means of transpar-ently communicating with remote services that could be hosted either on-premise or elsewhere on the Internet.

Table 2.1 Enablement Services of SAP HCP

Page 9: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

54

2.2.3 Higher-Level Services

In addition to the core services described in Section 2.2.2, the SAP HCP PaaSoffering is rounded out by a series of higher-level application services that pro-vide specialized capabilities needed in certain cloud-based application scenarios.Next, we’ll highlight a few of the more prominent services included in this offer-ing.

SAP HANA Cloud Portal

SAP HANA Cloud Portal is a cloud-based portal solution that makes it easy to cre-ate lightweight portal sites that combine cloud applications, cloud applicationextensions, and on-premise content to create a seamless UI experience. By usingopen standards like HTML5 and OpenSocial, SAP HANA Cloud Portal makes iteasy to integrate content from disparate sources without having to reinvent thewheel. We’ll see how this works firsthand in Chapter 9.

SAP HANA Cloud Integration

In many respects, you can think of SAP HANA Cloud Integration (SAP HCI) as acloud-based version of SAP’s on-premise SOA middleware tool, SAP Process Inte-gration (PI). This is to say that SAP HCI is a cloud-based middleware service thatallows you to develop integration scenarios in the cloud. These scenarios might

Document Service This service provides access to a content repository for storing unstructured content. It can also be used to imple-ment a sort of virtualized file system as needed.

Identity Service The term “Identity Service” is the name given to a series of security-related services or features integrated into SAP HCP. Some highlights in this offering include support for single sign-on (SSO) scenarios, identity federation with the Security Assertion Markup Language (SAML), and authori-zation based on the OAuth protocol.

Feedback Service This service provides a framework for implementing user feedback scenarios in cloud applications.

Service Description

Table 2.1 Enablement Services of SAP HCP (Cont.)

Installing SAP HCP Development Tools 2.3

55

be needed for one-time uploads of on-premise data or ongoing real-time lookupsto on-premise systems. We’ll discuss SAP HCI in more detail in Chapter 10.

SAP HCP Mobile Services

This service is used to help developers roll out mobile applications. Some of themore prominent features provided with SAP HCP Mobile Services include the fol-lowing:

� Support for user onboarding

� Security and authorization services

� Support for implementing native push notifications

� Support for implementing offline support for mobile applications

� Administration and monitoring of mobile applications

We’ll take a closer look at SAP HCP Mobile Services in Chapter 12, which is avail-able for download at www.sap-press.com/3638.

2.3 Installing SAP HCP Development Tools

In the previous section, we learned how SAP is really focused on positioning SAPHCP as an open and inviting platform for developers. Although this openness isunquestionably a good thing, it does make the task of setting up our developmentenvironments a little bit more complex, because there are so many types of devel-opment objects that we have to account for.

In this section, we’ll take a look at what a typical tools setup looks like so thatyou’ll have the necessary tools in place to work through the examples described inthis book. We emphasize the term “typical” here because tool configurations willtend to differ in subtle ways between developers. Fortunately, because SAP HCP isstandardized around the extensible Eclipse integrated development environment(IDE), these differences usually amount to the installation of a few plug-ins hereand there.

Page 10: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

56

2.3.1 Setting Up the Eclipse IDE

SAP elected to standardize the SAP HCP toolset around the open-source EclipseIDE. This approach allows SAP to leverage the built-in development functions ofthe core Eclipse IDE and merely supplement with SAP HCP-specific features asneeded. Plus, because Eclipse is arguably the most popular IDE in the world, itoffers the added benefit of requiring little to no introduction for the averagedeveloper.

In this section, we’ll take a look at how to set up a new instance of Eclipse andinstall the relevant plug-ins from the SAP HCP Tools library.

Installing the Java SDK

Before you can install Eclipse, you first need to make sure that you have theappropriate version of Java installed on your local machine. Although modernversions of Eclipse only require the installation of the more lightweight Java Run-time Environment (JRE), we recommend that you go ahead and install the fullJava SE software development kit (SDK), which is available online at www.ora-cle.com/technetwork/java/javase/downloads/index.html. This will ensure that youhave the full complement of compiler tools needed to carry out various develop-ment tasks.

When installing the Java SDK, you’ll want to download the version that best fitswith the target Application Runtime Container profile you plan to work with inRuntime for Java (refer back to Section 2.2.1). For example, as of the time of writ-ing, the available container profiles are based on Java EE versions 6 and 7. There-fore, if you’re working with the Java Web Tomcat 7 profile, then you’d want todownload and configure version 7 of Java SE.

Downloading and Installing Eclipse

In order to maximize flexibility, SAP developed SAP HCP Tools to work withmost recent versions of the Eclipse IDE. Therefore, if you already have a recentversion of Eclipse lying around, it should be possible to install SAP HCP Tools ontop of that instance if you so choose. However, given the large number of plug-insassociated with an SAP HCP Tools instance, we recommend that you downloadand configure a separate instance of Eclipse for SAP HCP development.

Installing SAP HCP Development Tools 2.3

57

To download Eclipse, go to www.eclipse.org/downloads in your web browser.From the main Downloads page, download the latest version of Eclipse IDE for

Java Developers for your target operating system, as shown in Figure 2.7.

Figure 2.7 Downloading Eclipse IDE for Java Developers

The installation bundle that you download will be a zipped archive that you canunpack to a directory of your choosing. Once you unpack the bundle, you canlaunch Eclipse for the first time by opening up the Eclipse folder and running theexecutable eclipse file (e.g., eclipse.exe).

As Eclipse loads for the first time, you’ll likely be presented with the Workspace

Launcher dialog box shown in Figure 2.8. Within this dialog box, you mustselect a directory on your local machine that Eclipse can use to store project arti-facts and the like. Normally, it’s a good idea to select the Use this as the default

and do not ask again checkbox so that Eclipse will use the selected directory asits default location. That way, Eclipse won’t pester you about choosing a location

Page 11: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

58

every time you launch it, and you’ll know where to look to find development arti-facts created from within the IDE.

Figure 2.8 Selecting the Default Workspace Location in Eclipse

If all goes well, Eclipse will eventually load in a window similar to the one shownin Figure 2.9. If you’re new to Eclipse, then we recommend that you browsethrough a tutorial or two to become acquainted with the IDE layout, Eclipse-spe-cific terminology and features, and so on. For the most part, we think that you’llfind that Eclipse is fairly intuitive, but like most IDEs, it does have a few idiosyn-crasies.

Figure 2.9 Launching Eclipse for the First Time

Installing SAP HCP Development Tools 2.3

59

Before we move on, we should probably make mention of one minor housekeep-ing task you should be aware of if you’re working behind a proxy or firewall.Because Eclipse receives its updates over HTTP connections, you must configureyour proxy settings in order to extend Eclipse for use with SAP HCP. To configurea proxy server connection, perform the following steps:

1. From within Eclipse, select the Window � Preferences menu option within thetop-level menu bar, and then drill into General � Network Connections.

2. From the Network Connections panel shown in Figure 2.10, select the appro-priate schema (e.g., HTTP and/or HTTPS) in the Proxy entries table, and clickon the Edit… button.

Figure 2.10 Configuring Proxy Server Access in Eclipse

3. Then, in the Edit Proxy Entry subdialog box, enter the proxy host name andport, as well as authentication details as necessary. Click on the OK button toconfirm your selections.

4. Finally, as necessary, you can use the Proxy bypass table to configure a list ofhosts that you want to access without using the proxy server.

Page 12: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

60

Installing the SAP Development Tools

At this point, you should have a vanilla version of Eclipse installed on your localmachine. Although this Eclipse instance is fully functional, it doesn’t comeequipped with any SAP or SAP HCP-specific features. To add these features, wemust download and install the necessary plug-ins from SAP. This can be achievedby performing the following steps:

1. To begin, we need to log on to the SAP Development Tools for Eclipse installa-tion site, available online at https://tools.hana.ondemand.com/#cloud. As you cansee in Figure 2.11, this site provides installation sites for several recent Eclipsedistributions (e.g., Eclipse Luna 4.4 and Eclipse Kepler 4.3 as of the time ofwriting). Copy the URL for your version of Eclipse onto your clipboard.

Figure 2.11 Locating the SAP HCP Tools Installation Site

2. Next, open up the Eclipse IDE, and select Help � Install New Software… fromthe top-level menu bar.

3. This will open up the Install dialog box shown in Figure 2.12. From thisscreen, paste the installation site URL copied in step 1 into the Work with

input field, and click on the Add… button. In the Add Repository dialog box,give the repository a name, and click on the OK button. By naming the reposi-tory, we can use the same repository later on to check for updates and updatethe software as needed.

Installing SAP HCP Development Tools 2.3

61

Figure 2.12 Adding an Available Software Site in Eclipse

4. After the repository is defined, click on the Next > button to move to the nextstep in the installation wizard. At this point, Eclipse will connect to the instal-lation URL and search for available plug-ins to install.

5. At the Available Software step shown in Figure 2.13, you’ll be provided witha list of available software items to install. For the purposes of this book, themain items of interest will be the SAP HANA Cloud Platform Tools, SAP

HANA Tools, and UI Development Toolkit for HTML5. These items willensure that we have the necessary components in place to develop SAP HCP-based Java applications, native SAP HANA applications, and HTML5 applica-tions based on SAPUI5 technology. Of course, you can also choose other itemsof interest as desired.

Page 13: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

62

Figure 2.13 Choosing the Software Items to Install

6. Finally, once you choose the relevant items you wish to install, you can con-tinue through the installation wizard by accepting all of the defaults. At thispoint, Eclipse will download and install the relevant plug-ins.

As you’re running through the installation process, keep in mind that this stepcan take quite a while if you have a lot of items selected and/or a slow networkconnection. If all goes well, Eclipse will finish installing the plug-ins and let youknow that it must restart in order for the changes to take effect. After the restartis complete, you should be greeted with a revised welcome page, similar to theone shown in Figure 2.14. Here, you’ll notice a few new SAP and SAP HCP-related items that have been added to the welcome page.

Installing SAP HCP Development Tools 2.3

63

Figure 2.14 Revised Welcome Page after SAP HCP Tools Installation

2.3.2 Downloading the SAP HCP SDK

In addition to the SAP HCP-related plug-ins integrated into Eclipse, SAP also pro-vides a standalone SDK that includes a series of useful tools and examples to kickstart the development process. Among other things, this SDK includes the follow-ing:

� Platform API Java Archive (JAR) files

� API documentation

� A local SAP HCP runtime instance that can be used for offline testing

� A command line tool that can be used to administer SAP HCP instances

� Loads of full-scale example projects with annotated source code and documen-tation

Page 14: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

64

The SAP HCP SDK can be downloaded from the same site we used to locate theEclipse installation site for SAP HCP Tools: https://tools.hana.ondemand.com/#cloud. As you can see in Figure 2.15, SAP provides separate SDKs to support thedifferent Application Runtime Container profiles available in Runtime for Java.For a variety of reasons, we strongly recommend that you select the SDK versionthat coincides with your selected profile. For the purposes of this book, we’ll bedownloading the SDK for the Java EE 6 Web profile, because it contains the com-prehensive set of features needed for our demonstrations.

Figure 2.15 Downloading the SAP HCP SDK

Once you download the SDK version that’s right for you, you’ll want to unpackthe ZIP archive to an easily accessible directory on your local machine. After theZIP file is unpacked, we highly recommend that you browse through the SDKfolder structure and take a look at all of the goodies SAP provides.

Tip

For a variety of reasons, we would recommend that you refrain from nesting the SDKfolder too deep within your local file system. Doing so can cause issues with the localruntime due to extraordinarily long file names.

Installing SAP HCP Development Tools 2.3

65

Setting Up the Local Runtime Environment

As we noted earlier, the SAP HCP SDK includes a local runtime environment thatallows you to test SAP HCP applications on your local machine. Although you canadminister this local runtime environment from the command line, it’s muchmore convenient to install the local runtime environment as an available serverruntime in Eclipse. This integration can be achieved by performing the followingsteps:

1. Start Eclipse, select the Window � Preferences menu option, and expand theServersubmenu.

2. Inside the Server submenu, select the SAP HANA Cloud Platform node. Thiswill open the SAP HANA Cloud Platform panel shown in Figure 2.16. Withinthis panel, you’ll want to configure the relevant attributes as follows:

� Landscape host

This attribute needs to point to the host of your target SAP HCP instance. Ifyou’re using the free developer account, then the landscape host will be han-atrial.ondemand.com. Otherwise, it will be hana.ondemand.com.

� SDK location

In this field, you’ll want to specify the directory that you unpacked the SAPHCP SDK to.

� Account name

This attribute is used to keep track of your SAP HCP account name so thatSAP HCP Tools can automatically propose this value whenever you performactions that require you to specify your SAP HCP account.

� User name

This attribute is used to keep track of your user name so that SAP HCP Toolscan automatically propose this value whenever you perform actions thatprompt you to authenticate with the server-side SAP HCP instance.

Page 15: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

66

Figure 2.16 Adding the SDK Location to the SAP HCP General Settings

3. Once you’ve configured the directory location for the SAP HCP SDK, you’llwant to switch over to the Server � Runtime Environments node. From here,you can configure the SAP HCP local runtime environment by clicking on theAdd… button. This will open up the New Server Runtime Environment wiz-ard shown in Figure 2.17.

Installing SAP HCP Development Tools 2.3

67

Figure 2.17 Setting up the SAP HCP Local Runtime Environment: Part 1

4. From the initial wizard page, expand the SAP folder, and choose the appropri-ate local runtime environment based on your selected Java profile (see Figure2.17). Click on the Next > button to continue.

5. At the next screen (shown in Figure 2.18), you have an opportunity to choosethe location of the local runtime environment from your local machine.Because you configured the SDK location previously, this directory will be pro-posed automatically, so simply confirm the selection by clicking on the Finish

button.

Page 16: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

68

Figure 2.18 Setting up the SAP HCP Local Runtime Environment: Part 2

2.3.3 Installing the SAP JVM

One last item that we would encourage you to install when setting up your devel-opment environment is the SAP JVM. As we’ll learn in Chapters 3 and 4, thisoptional step allows us to tap into some of the powerful profiling capabilities ofthe SAP JVM when tuning Java applications.

The SAP JVM can be downloaded from the same downloads page we used todownload the SAP HCP SDK: https://tools.hana.ondemand.com/#cloud. In the SAP

JVM section of the page, simply download the appropriate bundle for your OSconfiguration. You can find installation instructions for your particular OS in theSAP HANA Cloud Documentation available online at https://help.hana.onde-mand.com/help/frameset.htm. Here, browse to Java Development � Getting

Started � Installing Java Tools for Eclipse and SDK � Installing SAP JVM.

After the SAP JVM is installed, you can associate it with the set of installed JREsin Eclipse by performing the following steps:

1. Open up Eclipse, and from the main menu select Window � Preferences.

2. Expand the Java � Installed JREs folders, and click on the Add… button.

Installing SAP HCP Development Tools 2.3

69

3. This will open up the Add JRE installation wizard shown in Figure 2.19. Acceptthe default Standard VM option, and click on the Next > button to continue.

Figure 2.19 Adding the SAP JVM as an Installed JRE in Eclipse: Part 1

4. On the next screen, you must browse to the directory location in which youinstalled the SAP JVM. Once you select the directory, the JRE name and systemlibraries will be configured automatically. To confirm the configuration, clickon the Finish button.

5. Finally, after the SAP JVM is configured as a JRE, you’ll want to select it as thedefault JRE by clicking on the checkbox adjacent to the Name column (see Fig-ure 2.21). With this setting in place, all new Java-based projects will be auto-matically configured to utilize the SAP JVM as the target JRE.

Page 17: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

Getting Up and Running2

70

Figure 2.20 Adding the SAP JVM as an Installed JRE in Eclipse: Part 2

Figure 2.21 Adding the SAP JVM as an Installed JRE in Eclipse: Part 3

Summary 2.4

71

2.4 Summary

In this chapter, we were able to work through all of the prerequisites for devel-oping cloud-based applications on SAP HCP. With these administrative tasks outof the way, we’re ready to proceed with some hands-on development exercises.We’ll get things started in Chapter 3 by learning how to develop Java-based webapplications.

Page 18: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

7

Contents

Foreword by Matthias Steiner .......................................................................... 15Preface ............................................................................................................. 17

PART I Foundations

1 Introduction to SAP HANA Cloud Platform .............................. 27

1.1 Introducing SAP HANA Cloud Platform ......................................... 271.2 The Cloud Computing Revolution .................................................. 29

1.2.1 What Is Cloud Computing? .............................................. 291.2.2 Understanding the Cloud Computing Service Models ....... 301.2.3 Some Historical Perspective .............................................. 35

1.3 A Strategic “Glue” Component for SAP .......................................... 371.3.1 Challenges of the Hybrid Landscape ................................. 371.3.2 Where SAP HANA Cloud Platform Fits In ......................... 38

1.4 Summary ....................................................................................... 39

2 Getting Up and Running ........................................................... 41

2.1 Obtaining an SAP HCP Account ..................................................... 412.1.1 Understanding the SAP HCP Account Concept ................. 412.1.2 Registering for a Free Developer Account ......................... 44

2.2 What’s in the Box? ........................................................................ 472.2.1 Application Runtime Containers ....................................... 472.2.2 SAP HCP Enablement Services .......................................... 532.2.3 Higher-Level Services ....................................................... 54

2.3 Installing SAP HCP Development Tools .......................................... 552.3.1 Setting Up the Eclipse IDE ................................................ 562.3.2 Downloading the SAP HCP SDK ....................................... 632.3.3 Installing the SAP JVM ..................................................... 68

2.4 Summary ....................................................................................... 71

Page 19: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

8

Contents

PART II Core Development Concepts

3 Developing Java Applications ................................................... 75

3.1 Overview ....................................................................................... 763.2 Creating Java Web Applications ..................................................... 77

3.2.1 Creating a Dynamic Web Project in Eclipse ....................... 773.2.2 Building the Servlet-Based Controller ............................... 823.2.3 Creating the View Layer Using JSPs .................................. 843.2.4 Testing the Application Locally ......................................... 86

3.3 Working with EJBs ......................................................................... 903.3.1 Refactoring for EJBs .......................................................... 903.3.2 Implementing Business Logic in an EJB ............................. 933.3.3 Incorporating EJBs into Servlets and JSPs .......................... 95

3.4 Debugging and Tuning Java Applications ....................................... 983.4.1 Debugging a Java Web Application .................................. 993.4.2 Profiling Java Web Applications ........................................ 102

3.5 Next Steps ..................................................................................... 1073.6 Summary ....................................................................................... 107

4 Managing and Deploying Java Applications ............................. 109

4.1 Overview ....................................................................................... 1094.2 Deploying Java Applications .......................................................... 112

4.2.1 Deployment Using the Eclipse IDE ................................... 1124.2.2 Deployment Using the Console Client .............................. 1234.2.3 Monitoring Deployments ................................................. 1284.2.4 Logging and Tracing Concepts .......................................... 132

4.3 Source Code Management ............................................................. 1384.3.1 Introduction to Git and GitHub ........................................ 1394.3.2 Getting Started with EGit ................................................. 1394.3.3 Defining a Git Repository on GitHub ................................ 1424.3.4 Cloning a Git Repository in Eclipse ................................... 1454.3.5 Adding Projects to Change Control ................................... 1484.3.6 Checking in Changes ........................................................ 1504.3.7 Where to Go From Here ................................................... 153

4.4 Build Automation with Apache Maven and Ant ............................. 1534.4.1 Getting Started with Apache Maven ................................. 1544.4.2 Working with Apache Ant ................................................ 163

4.5 Continuous Integration with Jenkins .............................................. 1654.5.1 Introducing Jenkins .......................................................... 166

Contents

9

4.5.2 Installing Jenkins on SAP HCP .......................................... 1664.5.3 Moving toward Continuous Integration ............................ 167

4.6 Summary ....................................................................................... 168

5 Developing Native SAP HANA Applications ............................. 171

5.1 Overview ....................................................................................... 1725.2 Getting Started .............................................................................. 174

5.2.1 Creating a Trial SAP HANA Instance ................................. 1745.2.2 Working with Eclipse and the SAP HANA Tools ................ 1765.2.3 Working with the SAP HANA Web-Based Development

Workbench ...................................................................... 1825.3 Creating an SAP HANA XS Project in Eclipse .................................. 1845.4 Building the Application Data Model ............................................. 188

5.4.1 Defining a Persistence Model Using Core Data Services .... 1895.4.2 Exposing the Data Model as an OData Service ................. 1925.4.3 Consuming the Data Model from Server-Side JavaScript ... 195

5.5 Developing the Application UI ...................................................... 1965.6 Finishing Touches .......................................................................... 198

5.6.1 Creating the Application Descriptor File ........................... 1985.6.2 Defining the Application Access File ................................. 2005.6.3 Defining a Security Role for Display Access ....................... 201

5.7 Deployment and Testing ................................................................ 2045.7.1 Activating the SAP HANA XS Project ................................ 2045.7.2 Assigning the Display Role to a User Account ................... 2065.7.3 Importing Test Data ......................................................... 2075.7.4 Launching the Application ................................................ 211

5.8 Summary ....................................................................................... 214

6 Consuming Cloud Services ........................................................ 217

6.1 Overview ....................................................................................... 2176.2 Using the Persistence Service ......................................................... 219

6.2.1 Conceptual Overview ....................................................... 2206.2.2 Managing Database Schemas ........................................... 2216.2.3 Working with the Java Persistence API ............................. 2276.2.4 Working with Java Database Connectivity ........................ 2436.2.5 Database Management Concepts ..................................... 249

6.3 Using the Connectivity Service ....................................................... 2606.3.1 Conceptual Overview ....................................................... 2606.3.2 Working with Destinations ............................................... 262

Page 20: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

10

Contents

6.3.3 Case Study: Calling On-Premise RFC Functions ................. 2676.3.4 Case Study: Consuming a RESTful Web Service ................. 2756.3.5 Case Study: Sending an E-Mail Message ........................... 278

6.4 Using the Document Service .......................................................... 2826.4.1 Conceptual Overview ....................................................... 2836.4.2 Working with the OpenCMIS API ..................................... 2846.4.3 Consuming the Document Service Externally .................... 287

6.5 Summary ....................................................................................... 288

7 Developing HTML5 Applications .............................................. 289

7.1 Overview ....................................................................................... 2897.2 Getting Started .............................................................................. 291

7.2.1 Defining a New HTML5 Application ................................. 2917.2.2 Accessing the Git Repository ............................................ 2927.2.3 Working with the SAP Web IDE ....................................... 2937.2.4 Activating the HTML5 Application Content in

the SAP HCP Cockpit ........................................................ 3077.2.5 Testing the Finished Product ............................................ 309

7.3 Advanced Concepts ....................................................................... 3107.3.1 Working with the Application Descriptor ......................... 3107.3.2 Integrating SAPUI5 Content ............................................. 3117.3.3 Accessing External Resources ........................................... 3137.3.4 Configuring Application Security ...................................... 3167.3.5 Putting It All Together ...................................................... 319

7.4 Summary ....................................................................................... 323

8 Securing Cloud Applications ..................................................... 325

8.1 Overview ....................................................................................... 3258.2 Introduction to Java EE Security Concepts ..................................... 327

8.2.1 Understanding the Java EE Security Model ....................... 3278.2.2 Technical Underpinnings .................................................. 329

8.3 Implementing Declarative Security with Java ................................. 3308.3.1 Configuring Authentication .............................................. 3318.3.2 Defining Security Roles and Constraints ............................ 3338.3.3 Role Assignment in the SAP HCP Cockpit ......................... 335

8.4 Implementing Programmatic Security in Java ................................. 3388.4.1 Checking Authorizations Programmatically ....................... 3388.4.2 Working with the User Management API ......................... 3408.4.3 Working with the Authentication API ............................... 342

Contents

11

8.4.4 Working with the Password Storage API .......................... 3448.4.5 Protecting Against Cross-Site Scripting Attacks ................. 345

8.5 Authentication and Authorization with SAML 2.0 .......................... 3498.5.1 SAML Overview ............................................................... 3508.5.2 Configuring Trusted Identity Providers ............................. 3528.5.3 Implementing Assertion-Based Group Mapping ............... 357

8.6 Protecting Web Resources with OAuth 2.0 .................................... 3638.6.1 What Is OAuth? ............................................................... 3638.6.2 Understanding the OAuth Authorization Flow .................. 3668.6.3 Securing Web Resources with OAuth ............................... 3688.6.4 Developing and Configuring OAuth Clients ...................... 372

8.7 Summary ....................................................................................... 379

PART III Advanced Concepts

9 Working with SAP HANA Cloud Portal .................................... 383

9.1 Introduction .................................................................................. 3839.1.1 What Is SAP HANA Cloud Portal? .................................... 3849.1.2 Architectural Overview ..................................................... 3859.1.3 How Is SAP HANA Cloud Portal Used? ............................. 389

9.2 Understanding SAP HANA Cloud Portal’s Content Model .............. 3909.3 Developing Content for SAP HANA Cloud Portal ........................... 391

9.3.1 Creating OpenSocial Widgets ........................................... 3919.3.2 Utilizing SAP HANA Cloud Portal Features ....................... 3989.3.3 Adapting Preexisting Web Applications ............................ 4049.3.4 Adding a Widget to the Portal’s Content Catalog ............. 405

9.4 Case Study: Building a Custom Portal Site ...................................... 4079.4.1 Creating a Site in the Site Directory .................................. 4079.4.2 Setting Up the Site’s Page Hierarchy ................................. 4189.4.3 Adding Content to the Pages ............................................ 4229.4.4 Publishing and Testing the Site ......................................... 428

9.5 Next Steps ..................................................................................... 4319.6 Summary ....................................................................................... 431

10 Introduction to SAP HANA Cloud Integration .......................... 433

10.1 Overview ....................................................................................... 43310.2 Use Cases ...................................................................................... 43610.3 Getting Started with the Eclipse IDE .............................................. 438

10.3.1 Installing SAP HANA Cloud Integration Plug-Ins ............... 438

Page 21: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

12

Contents

10.3.2 Configuring Eclipse ........................................................... 44010.4 Implementing a Simple SOAP-to-SOAP Scenario ........................... 442

10.4.1 Creating an Integration Flow ............................................ 44210.4.2 Configuring Sender and Receiver Systems ......................... 44410.4.3 Importing WSDL Files from SAP PI or Your Local

File System ....................................................................... 44510.4.4 Creating a Parameters File ................................................ 44610.4.5 Mapping between Sender and Receiver Systems .............. 44610.4.6 Configuring Sender and Receiver Communication

Channels .......................................................................... 44810.4.7 Deploying the Integration Project ..................................... 44910.4.8 Monitoring ...................................................................... 449

10.5 Introduction to the Web UI for SAP HANA Cloud Integration ........ 45010.5.1 The Discover Section (Integration Content Catalog) .......... 45110.5.2 The Design Section ........................................................... 45410.5.3 The Run Section ............................................................... 45710.5.4 The Monitor Section ........................................................ 458

10.6 Summary ....................................................................................... 460

11 Extension Scenarios with SAP HANA Cloud Platform .............. 461

11.1 The Need for Software-as-a-Solution Extensions ............................ 46211.2 The Architecture of an Extension ................................................... 464

11.2.1 Extension Application Frontend Layer .............................. 46811.2.2 Extension Application Backend Layer ............................... 47311.2.3 Extension Application Connectivity Layer ......................... 476

11.3 Integration Points for Extending SAP Cloud Solutions .................... 47811.3.1 Custom Business Objects and Views ................................. 47911.3.2 Workflows ........................................................................ 48011.3.3 Roles and Permissions ...................................................... 48011.3.4 API Clients ....................................................................... 48011.3.5 Rules ................................................................................ 48111.3.6 Configurable UIs ............................................................... 48111.3.7 Custom Code ................................................................... 48111.3.8 Home Page Tile Configuration .......................................... 48211.3.9 Navigation Configuration .................................................. 483

11.4 Extending SuccessFactors with SAP HCP Applications .................... 48311.4.1 SuccessFactors Administration Layers ............................... 48411.4.2 Account Onboarding ........................................................ 48511.4.3 Deploying Your First SuccessFactors Extension ................. 48911.4.4 SuccessFactors Extension Administration .......................... 490

Contents

13

11.4.5 SuccessFactors APIs .......................................................... 49311.4.6 Creating Custom MDF Objects and Consuming

Them from SAP HCP ........................................................ 49811.4.7 Creating Custom Home Page Tiles Hosted on SAP HCP .... 49811.4.8 Managing Custom Navigation Entries ............................... 50211.4.9 Troubleshooting SuccessFactors Extension Applications ... 503

11.5 Summary ....................................................................................... 508

The Authors .................................................................................................... 509Index ............................................................................................................... 511

Page 22: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

511

Index

A

ABAP, 189Amazon Web Services (AWS), 171AMP, 236Apache 2.0, 489Apache Ant, 153, 163

build model, 163trigger build, 165

Apache Chemistry, 288Apache Chemistry Project

CMIS API, 283Apache Derby, 258Apache HttpComponents Project, 266Apache Maven, 153, 154

command line, 162Eclipse, 156POM file, 158Project Object Model (POM) file, 155repository concept, 160

Apache Olingo, 241, 243limitations, 243

Apache Shindig, 386, 389Apache Tomcat, 112API, 465, 474, 480, 493

BizX OData, 474Connectivity and Destination, 260, 266Google Geocoding, 275Java Persistence, 227JDBC, 220JNDI, 247JPA, 220OpenCMIS, 284Password Storage, 344SAP Jam OData, 475SFAPI, 504SLF4J, 132SuccessFactors SF, 475User Management, 340

Application descriptor file, 310, 314access external resources, 313SAPUI5, 311

Application Runtime Container, 47, 49, 56profiles, 49

Application Runtime Container profilesJava EE 6 Web, 49, 50Java Web, 49Java Web Tomcat 7, 49

Application-managed persistence � AMPAriba, 462, 467, 479Ariba Query Language (AQL), 479AS Java, 28Authentication, 329, 331

definition, 326form-based authentication, 331form-based process flow, 331HTTPS client authentication, 331

Authentication APIJAAS, 342logging a user out, 343triggering a form-based login, 342

Authorization, 329definition, 326performing authorization checks in a JSP, 339performing authorization checks in

a Servlet, 339

B

Breakpoints, 99Business object definition

language (BODL), 479BYOL (bring your own language), 47, 75

C

Cascading Style Sheets (CSS), 413Cloud computing, 29, 35

benefits, 36service models, 30

Cloud Foundry, 53CMIS protocol, 475CMIS repository, 286Command-line interface (CLI), 154Composite applications (xApps), 260Concur, 462

Page 23: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

512

Index

Connectivity and Destination API, 260Connectivity Service, 53, 76, 218, 260, 276,

313, 477architecture and positioning, 261call RFC functions, 267consume RESTful service, 275destinations, 262integration scenarios, 262overview, 260send email, 278supported protocols, 260

Console Client, 123, 137, 165, 221, 222, 253launch, 124local deployment, 125remote deployment, 127use cases, 123

Container-managed persistence (CMP), 233Content delivery network (CDN), 404Content Management Interoperability Ser-

vices Protocol (CMIS), 283Content Repository, 282

features, 282Continuous integration, 165Core Data Services (CDS), 189Cross Origin Resource

Sharing (CORS), 472, 482Cross-site scripting (XSS), 345, 346CRUD, 241

operations, 194

D

Data definition language (DDL), 189create source file, 191

Data import wizard, 207Database management, 249Database schema bindings

JDBC, 224remove, 225

Database schemasaccess remotely, 249attributes, 222binding, 223connect to SAP HANA, 249create, 221create database tunnel, 253

Database schemas (Cont.)definition, 221dynamic creation, 223sharing, 226

Datacenters, 43Dell Boomi, 504Destinations

create a Mail destination, 279create destination, 263create HTTP destination, 276create RFC destination, 270

Docker, 53Document Service, 54, 282, 475

as a file system, 283consume externally, 287overview, 283

Dynamic branding, 468Dynamic Web project, 77, 80, 90, 156, 236

E

Eclipse, 55, 176Apache Maven, 156cloud-based server node, 116configuring loggers, 136create server node, 114create server nodes, 112Data Source Explorer view, 254debugging, 102download and install, 56Dynamic Web project, 78Java app deployment, 119JPA, 236launch, 58proxy server access, 59SAP HCP features, 60SAP JVM and JRE, 70SAP JVM Profiler, 104Servers view, 113setup, 56WAR file, 126

Eclipse Data Tools Platform (Eclipse DTP), 253, 256

Eclipse Web Tools Platform (WTP), 112EclipseLink, 231, 240EGit, 139, 148

installation, 140

Index

513

EJB, 49, 90, 233, 244, 284business logic, 93create, 91dependency injections, 95EJB Lite, 50implement JNDI lookup, 96servlets and JSPs, 95

EJB session beans, 94stateful vs. stateless, 95

Enterprise JavaBeans � EJBEntity classes, 240

annotations, 229mapping with XML deployment

descriptors, 229Entity records

fetching, 235Entity-relationship diagram, 189

F

Feedback Service, 54

G

Git, 138, 139, 141, 296, 306, 308check in changes, 150clone repository, 145commit, 151HTML5 applications, 292version control, 148

GitHub, 139, 142, 489account setup, 143Git repository, 142

Google App Engine, 171Google Chrome, 90Google Geocoding API, 275

calling the service, 277

H

HANA Cloud Portalwidget plug-in, 393

HTML, 195HTML5, 38, 53, 54, 76, 109, 139, 289,

468, 471

HTML5 app development, 289access external resources, 313activate content, 307application descriptor file, 310check in changes, 304clone Git repository, 297connect to Git repository, 296create content, 298create HTTP destination, 313create new app, 292define new role, 318Git repository, 292import content, 319integrate SAPUI5 content, 311model, 290SAP Web IDE, 293security, 316testing, 309version management, 308

HTML5 Application Container, 53HTTP, 260, 262HTTP basic authentication, 331, 332HTTP(s), 262Hudson � Jenkins

I

Identity propagation, 477, 478Identity provider (IdP), 332

Microsoft Active Directory Services, 352Identity Service, 54IDoc, 272Infrastructure-as-a-Service (IaaS), 31, 33Integration Platform-as-a-Service (iPaaS), 434Intellisense, 294, 302Internet of Things (IoT), 27

J

Java 6, 473Java 7, 473Java 8, 473Java app deployment, 112

Console Client, 123Eclipse, 112logging and tracing, 132

Page 24: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

514

Index

Java app deployment (Cont.)monitoring, 128synchronizing changes, 122to a server node, 118troubleshooting, 130

Java applications, 75access destination, 266call RESTful service, 277call RFC, 272

Java Authentication and Authorization Service (JAAS), 329

Java classescom.sap.cloud.security.oauth2.

OAuthAuthorization, 369com.sap.cloud.security.oauth2.

OAuthAuthorizationFilter, 369com.sap.cloud.security.password.

PasswordStorage, 344Java Connector (JCo), 272Java Data Objects (JDO), 228Java Database Connectivity � JDBCJava development, 109

deployment phase, 111, 112development phase, 111integration/testing, 111

Java EE 6 Web profile, 64, 76Java interfaces

com.sap.security.core.server.csi.IXSSEncoder, 349

com.sap.security.um.user.User, 341com.sap.security.um.user.UserProvider, 340javax.security.auth.login.LoginContext, 342javax.servlet.HttpServletRequest, 339

Java objects � POJOJava package, 81Java Persistence API � JPAJava SDK, 56Java Servlet, 195Java Servlet API, 78Java source code editor, 99Java Virtual Machine (JVM), 48, 49Java web applications

create Dynamic Web project, 77create JSP, 84create Servlet, 82debug, 99resource materials, 107

Java web applications (Cont.)SAP JVM Profiler, 102test, 86

Java Web Archive (WAR), 77Java Web profile, 49JavaScript, 195, 471JavaServer Pages � JSPJBoss, 112JDBC, 220, 232, 243, 246

configure data sources, 247java.sql Library, 244javax.sql Library, 244usage example, 244vs. JPA, 248

Jenkins, 165, 166, 283build jobs, 167installation, 166

JNDI, 284JPA, 218, 220, 227

API overview, 233convention over configuration, 230create entity records, 234defining entity relationships, 230Eclipse, 237EclipseLink, 240entity classes, 229entity managers, 233javax.persistence Library, 228JPQL, 235OData, 241ORM, 227, 228persistence units, 231update entity records, 234vs. JDBC, 248

JPA Query Language (JPQL), 235jQuery, 401JRE, 68JRuby, 53JSON, 195, 468JSP, 49, 84, 97, 116, 195JTA transaction, 234Jython, 53

K

Keystore Service, 476

Index

515

L

LESS, 413Linux, 124, 139Log files, 135log4j, 132Logging, 132Loss of control (LOC), 462

M

Mac OS, 124Managed entity instance, 233Microsoft SharePoint, 384Microsoft SQL Server, 244Model-view-controller (MVC), 82Mozilla Firefox, 90MySQL, 259

N

NEO, 28, 48, 75, 171Northwind, 313

O

OASIS, 283OAuth, 277, 363

actors, 364analogy, 363authorization flow, 366authorization server, 364client, 364client development concepts, 372client registration, 375configure SAP HCP Servlet filter, 370Google example, 364resource owner, 364resource server, 364scopes, 371

OAuth 2.0, 478, 480Object-relational mapping (ORM), 227OData, 52, 192, 193, 197, 203, 214, 241, 465,

468, 470, 472, 479

OData 4.0, 243OData API, 506

Audit Log, 506Data Dictionary, 506

OData services, 242, 313Apache Olingo, 241

OpenCMIS API, 284change content within repository, 286establish CMIS session, 284

OpenCMIS library, 283, 284OpenSocial, 54, 386, 387

architecture, 388OpenSocial widgets, 391

adapting preexisting web apps, 404create, 391create from HTML5 app, 394cross-origin requests, 404develop content, 397for HTML5 apps, 423for SAP HANA XS apps, 423List Builder, 426predelivered types, 426Video Player, 426weather widget example, 396

Oracle, 244

P

Password Storage API, 344Performance Hotspot Analysis, 105Persistence Service, 53, 76, 219, 220, 222,

241, 249, 475database schemas, 221overview, 220SAP HANA XS, 220supported databases, 221

Plain Old Java Object � POJOPlatform-as-a-Service (PaaS), 27, 31, 33, 434POJO, 76, 90, 229, 236POP3/ IMAP, 262POP3/IMAP, 260Portal solutions, 384

Page 25: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

516

Index

R

Regular expressions, 362Remote Function Call (RFC), 218REST, 52, 166, 218, 275, 277, 313, 316, 479RFC, 260, 262, 267

called within Java app, 272Runtime for Java, 48, 56, 76

Compute Unit, 48

S

SAML, 277, 332, 478, 480, 482assertions, 352identity provider, 350JAAS login module, 352service provider, 350trusted identity providers, 352typical message flow, 350

SAP Business ByDesign, 33, 479, 480SAP Cloud, 461SAP Cloud Application Studio, 481SAP Cloud Connector, 38, 477SAP Cloud extensions, 461

API clients, 480architecture, 464backend artifacts, 473configurable UIs, 481custom business objects, 479custom code, 481custom views, 479homepage tiles, 482IdP, 482navigation, 483roles and permissions, 480rules, 481UI artifacts, 469workflows, 480

SAP Cloud Identity, 467SAP Composition Environment (CE), 28, 260SAP Enterprise Portal, 385SAP ERP Human Capital Management

(SAP ERP HCM), 37SAP Fieldglass, 462SAP Fiori, 482SAP Fiori Launchpad, 482

SAP GUI, 52SAP HANA, 38, 51, 250, 256

native development, 51, 52SAP HANA App Services, 34SAP HANA Cloud Connector, 261, 267, 313

expose services, 270installation, 267map internal system, 269

SAP HANA Cloud Integration � SAP HCISAP HANA Cloud Platform � SAP HCPSAP HANA Cloud Portal, 54, 383, 467,

468, 488add content to pages, 422architecture, 388Busy Indicator API, 400content model, 390Context Object API, 399create new page, 420create widget, 422Custom Rich Text Editor API, 400development, 391features, 384GadgetPrefs API, 399, 417Login/Logout API, 399Open Popup API, 399OpenSocial features, 398OpenSocial widgets, 390pages, 390Site Context (Pub-Sub) API, 399site definitions, 390Site Hierarchy API, 399Site Properties API, 400template types, 393test and publish site, 428use cases, 389vs. SAP Enterprise Portal, 385Widget Dynamic Height API, 399Widget Menu API, 399Widget Navigation API, 399, 418within SAP HCP, 386

SAP HANA Cloud Portal, widget plug-in, 393SAP HANA DB Services, 33SAP HANA development

activate project, 204application access file, 200application architecture, 173application data model, 188

Index

517

SAP HANA development (Cont.)application descriptor file, 198assign display role, 206connect to remote instance, 177consume data model, 195create project, 184launch application, 211link project, 186model as OData service, 192security role, 201testing, 207, 212trial instance, 174UI, 196

SAP HANA Enterprise Cloud (SAP HEC), 33SAP HANA Extended Application Services �

SAP HANA XSSAP HANA Infrastructure Services, 33SAP HANA Marketplace, 43SAP HANA Repository, 179, 189, 204, 206

organizing content, 179subpackages, 179

SAP HANA Runtime, 50SAP HANA Studio, 176SAP HANA Tools, 176, 208, 252SAP HANA Web-Based Development

Workbench, 176, 182, 183SAP HANA XS (see also SAP HANA

development), 51, 173, 174, 182, 184, 196, 201, 217persistence, 220

SAP HCI, 54, 262, 313, 433, 434, 504certificates and security artifacts, 439configure communication channels, 448configure Eclipse, 440create integration flow, 442create mapping, 446create parameter file, 446deploy project, 449Design section, 454Discover section, 451editions, 435Integration Advisor, 458integration content, 452Integration Content Catalog, 451integration flows, 442message mapping, 447Monitor section, 458

SAP HCI (Cont.)monitor using Eclipse, 449on-premise, 434operations, 439pattern templates, 443plug-ins, 438populate parameter file, 446professional package, 435repository connection, 440Run section, 457sender and receiver systems, 444sender authorization, 442SOAP-to-SOAP, 442Spaces (see web UI), 433tenant account, 440use cases, 436user-defined templates, 444web UI, 450WSDL files, 445

SAP HCPadd a widget, 405Authoring Space, 405build custom site, 407Content Catalog, 405create site, 407custom site settings, 410custom site theme and layout, 412debugger, 99Designer, 439developing extensions, 461enablement services, 53external user storage, 349features, 27identity providers, 357in the SAP landscape, 38introduction, 27Java development, 75OpenSocial, 387page hierarchy, 418SAP HANA, 172SAP Web IDE, 392security, 325services, 217site masthead, 414supported authorization methods, 331template sites, 408widgets, 387XSS output encoding library, 346

Page 26: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

518

Index

SAP HCP accounts, 41customer, 43developer, 42, 44, 46partner, 43

SAP HCP Cockpit, 46, 132, 137, 175, 211, 221, 279, 291, 317, 487, 494access OAuth URLs, 374application bindings, 224configure assertion-based user attributes, 361create schema, 222define assertion-based group assignments, 361define custom roles, 360define OAuth scopes, 371destinations, 263HTML5 apps, 291, 307, 318manage OAuth access tokens, 377SQL traces, 257trial SAP HANA instance, 175

SAP HCP Development Tools, 55installation, 55

SAP HCP local runtime as an IdP, 352SAP HCP Mobile Services, 55SAP HCP SDK, 63, 77, 78, 114

directory location, 66download, 64Java EE 6 Web profile, 64setup local runtime, 65

SAP HCP Tools, 112, 176SAP ID Service, 211, 331, 352

default IdP for SAP HCP, 336SAP Jam, 389, 479SAP Java Connector (JCo), 267SAP JVM, 68, 103

download, 68install, 68

SAP JVM Profiler, 102Eclipse, 104

SAP MaxDB, 221, 222, 256SAP NetWeaver Cloud, 28, 171SAP PartnerEdge, 43SAP Process Integration (PI), 54, 504SAP R/3, 27SAP River RDE � SAP Web IDESAP S/4HANA, 33SAP Web IDE, 289, 293, 294, 305, 468, 488

access, 294advantages for HTML5, 294

SAP Web IDE (Cont.)create project, 299HTML5 apps, 293local unit tests, 303OpenSocial widgets, 392

SAPUI5, 51, 196, 203, 299, 468SAPUI5 Mock Server, 469Security, 316, 325

built-in authentication methods, 331cloud security model, 326cloud vs. on-premise, 325declarative, 330define Java EE security roles, 333group definitions, 337groups, 328Java EE, 327Java EE authentication method, 331Java EE declarative approach, 328Java EE programmatic approach, 329Java EE security model, 328Java EE security stack, 329Java EE SSL/TLS support, 329read logged-on user, 340roles, 327users, 327

Security Assertion Markup Language � SAMLServer types, 114

JAVA EE 6 Web profile, 114Java web server, 114Java Web Tomcat 7, 114SAP HANA Cloud Platform, 115

Servlet, 116, 244, 276SFAPI, 504

Audit Log, 504Data Dictionary, 504, 505Metering Details, 504

Simple Logging Façade, 132Single sign-on (SSO), 350, 467, 471, 477SLF4J, 133, 135, 158

output methods, 133SMTP, 260, 262, 278SOAP, 505Software development lifecycle, 110Software logistics, 109Software-as-a-Service (SaaS), 31, 33, 462Source code management, 138Spring MVC, 76

Index

519

SQL, 189, 257, 282SQL traces, 257

reviewing, 257SQLScript, 52, 195Struts, 76SuccessConnect, 483SuccessFactors, 433, 461, 467, 479, 480, 483

IdP, 467Metadata Framework (MDF), 479Object Definitions tool, 498OData API, 494

SuccessFactors Employee Central, 461, 483SuccessFactors extensions, 483

administration, 490administration layers, 484APIs, 493Corporate Benefits, 489custom navigation, 502custom OAuth 2.0 API, 495deployment, 489Employee role, 489homepage tiles, 498, 500HR Manager role, 489Management plug-in, 492MDF, 498onboarding, 485, 487SFAPI, 504troubleshooting, 503

SuccessFactors OneAdmin, 484, 485SuccessFactors Provisioning, 484

T

Tracing, 132

U

Unix, 124User groups, 337User Management API, 340

example, 340obtain UserProvider instance, 340read user attributes, 340

W

W3C Social Web Working Group, 388Widgets, 387Windows, 124WYSIWYG, 385

X

XML, 195, 302, 413XS OData file, 192

create, 193example, 194

XSLT, 413XSS output encoding library, 346

Page 27: “Getting Up and Running” Contents Index The Author...In many ways, SAP HCP accounts are not unli ke the accounts you set up with util- ... For the most part, developer accounts

First-hand knowledge.

We hope you have enjoyed this reading sample. You may recommend or pass it on to others, but only in its entirety, including all pages. This reading sample and all its parts are protected by copyright law. All usage and exploitation rights are reserved by the author and the publisher.

James Wood is the founder and principal consultant of Bowdark Consulting, Inc., a consulting firm speciali-zing in technology and custom development in the SAP landscape. Before starting Bowdark in 2006, James was an SAP NetWeaver consultant for SAP America, Inc. and IBM Corporation, where he was involved in many large-scale SAP implementations. James is also an SAP

Mentor and author of several best-selling SAP titles. To learn more about James and this book, please check out his website: www.bowdark.com.

James Wood

Getting Started with SAP HANA Cloud Platform519 Pages, 2015, $69.95/€69.95 ISBN 978-1-4932-1021-3

www.sap-press.com/3638 © 2015 by Rheinwerk Publishing, Inc. This reading sample may be distributed free of charge. In no way must the file be alte-red, or individual pages be removed. The use for any commercial purpose other than promoting the book is strictly prohibited.