Skip to Content

SAP HANA XS Advanced - Clone and run SHINE applications

Previous

SAP HANA XS Advanced - Clone and run SHINE applications

By Lucia Subatin

This tutorial will walk you through the prerequisites and initial setup to enable the SHINE objects in XS Advanced

Details

You will learn

How to clone the SAP HANA INteractive Education source code from Git Hub, generate the dependencies and deploy the applications using Web IDE for SAP HANA.


Step 1: Clone SHINE from GitHub

Open SAP Web IDE for SAP HANA and log in with a developer user.

Note: By default, the URL for Web IDE in SAP HANA, express edition is https://hxehost:53075. You can use command xs apps in space SAP in the Command Line Interface to find out the right

Right-click on the Workspace and click on Git-> Clone Repository:

Clone repo

Copy the URL https://github.com/SAP/hana-shine-xsa into the Clone Git Repository prompt and click on Clone

Clone Git

Wait until the repository is cloned. You will see a success message on the top right corner of Web IDE and the folder in your workspace:

Clone Git
Please log in to access this content.
Step 2: Set the project space

Right-click on the imported project and go to Project Settings:

edit settings

Set the space development to the project:

edit settings

Close the settings dialog.

Please log in to access this content.
Step 3: Edit deployment configurations

You will need to complete some configurations in the deployment descriptor with the proper endpoints.

Open the mta.yaml file and click on the Resources tab in editor mode. Select the uaa resource

edit YAML

Replace the hostname and instance number with the right value for your system.

Note: The default hostname for SAP HANA, express edition instances is hxehost and the default instance number is 90.

For example:

edit YAML

Click on the controller resource and replace the hostname and instance number again:

edit YAML

Finally, you will change the name of the service for the shine-container so you can access it from your own multi-target application later. Click on the shine-container resource and add a parameter called service-name and the value shine-container

edit YAML
Please log in to access this content.
Step 4: Create additional services

If you look at the list of resources in the mta.yaml file, you will find instances of the User Account and Authentication, the audit log and the job scheduler services. In order to meet the dependencies, these services need to be created. You can use the Command Line Interface for this, available in the server by default in SAP HANA, express edition instances. You can also install it locally using the download manager after you register in the SAP HANA, express edition site

First, locate the file xs-security.json that was cloned with the SHINE Git repository from an SSH console. Alternatively, you can export it from Web IDE and upload it to the directory from which you will be issuing the commands.

sudo find / -name xs-security.json

Copy the result as you will need it later when creating the UAA service:

Find security file

Log in to the XS CLI using command xs login or xs-admin-login.

Log in to XS CLI

Make sure the job scheduler service is running using command xs a | grep scheduler in space SAP. If it is not running, start the necessary services using the following commands:

xs st jobscheduler-service
xs st jobscheduler-broker

For example:

Check scheduler app

You can now create the services. Make sure you create them in the same space in which you will deploy the SHINE application. In this case, the space is development.

xs t -s development
xs create-service xsuaa default shine-uaa -c <<path to xs-security.json>>
xs cs jobscheduler default shine-scheduler
xs cs auditlog free shine-auditlog

For example:

Check scheduler app

You will now make sure the proper services have been created. Run the following commands using CLI and copy the results in the validation below.

xs t -s development
xs s | grep shine
×
Step 5: Build the SHINE database modules

You will build the database modules first.

Start with the module user-db. Right click on its folder and then on Build:

build user-db

And make sure the build is successful.

build user-db

Repeat the steps with the core-db module.

build core-db

The rest of the modules will be built automatically before they are run in the next step.

Please log in to access this content.
Step 6: Run the SHINE applications

You will now run the modules in an order that satisfies dependencies between them. They will be built automatically before running. If you encounter an error stating No compatible version found, use the latest version quoted in the error to update the package.json file in the module that is failing.

For example, right-click con the user-js module and then click on Run->Run as->Node.js Application

Run modules

If you get a build error, click on the link to the Logs

Run modules

And take note of the versions suggested by npm

Run modules

Open the package.json file for this module and update the dependency:

Run modules

You can also get a hint of the dependencies you will need to adjust by right-clicking on each module and selecting Show dependency updates:

Run modules

Save the package.json file with the updated dependencies and run the module.

Once the user-js module is running, run the core-js module:

Run modules

Then run the user-java module:

Run modules

Note: If you get an error about a dependency not being resolved, use Show dependency updates and update the file pom.xml

Update javaUpdate java

Check all the modules are running. You can quickly verify because you will see a green tick next to each one of them:

Run modules

Finally, run the web module. Right-click on the web->resources->launchpad->index.html and click on Run as Web Application:

Run web modules

A new tab will open in the browser. You can click on the generated URL if the pop-up blocker did not allow the application to start.

Note: If you get an error related to the version of SAP UI5, update the version of the resource sapui5-provider in the mta.yaml file. Switch to the SAP space first with command xs s -t SAP and take note of the version informed by command xs mtas in the CLI for the UI5 library.

Please log in to access this content.
Step 7: Check prerequisites

You may need to log in again. Use XSA_DEV and the password you set up.

Log in to SHINE

The first execution of the SHINE launchpad will help you make sure the technical prerequisites are fulfilled. Click on the Check Prerequisites button:

Run web modules

Any missing dependencies will be marked for you. Click on each of the buttons for them to be automatically corrected:

Run web modules
Please log in to access this content.
Step 8: Generate data

You are finally presented with different options in the launchpad. Click on Generate Data:

Generate data

You can increase the number of transactions in your database or reload master data:

Generate data
What does the URL look like for the DATA GENERATOR site?
×

Updated 05/03/2018

Time to Complete

15 Min

Beginner

Tags

Next
Back to top