Monthly Archives: June, 2016

HY400 – Installing the Accelerator

  1. Build Framework
  2. Extension Concept
  3. Basic Configuration
  4. Hybris Server
  5. hAC, Initialization, and Update
  6. Recipes
  7. Spring in SAP Hybris Commerce
  8. Exercise How-to

1. Build Framework

  • SAP Hybris Commerce Platform has a build framework based on Apache Ant
    • Ant handles compilation and a number of automation tasks.
    • Class executables compiled by the Eclipse IDE are not used by SAP Hybris Commerce.
  • There is a build file in every extension, but we generally just use the one in the platform extension, which builds the entire suite.
  • It builds every extension listed or referenced by localextensions.xml

Building with ant

  • When you call ant, the build framework:
    • generates and compiles Model classes(covered in the next module)
      • according to the definitions in the *-items.xml files
      • In order of extensions dependency(hierarchy)
    • collects localization property files(locales_XY.properties).
    • collects layout configuration files(hmc.xml)
    • updates configuration of the Commerce Server.
    • generates five new folders(only in the first run!)

Screen Shot 2016-06-14 at 6.25.39 pm.png

Build Targets

Screen Shot 2016-06-14 at 6.26.28 pm.png

2. Extension Concept

Where to Begin with SAP Hybris Commerce?

  • Starting any project involves creating one or more extensions
    • Each extension will contribute a part of the greater whole, including modifying or adding to the data model, business logic, backoffice tools configuration, etc..
    • Your(project) code is separated from Hybris (framework) code, making your code easier to reuse and migrate to future versions.
    • SAP Hybris Commerce bundles a proprietary code generator.
  • In general, a project will include
    • A front end extension, will all jsp pages, tag and css files, controllers, etc..
    • A testing extension, containing the test cases and data.
    • One or more infrastructure or utility extension(such as services)

Structure of the Core Extension

Screen Shot 2016-06-14 at 6.31.55 pm.png

Structure of the Storefront Extension

Screen Shot 2016-06-14 at 6.32.23 pm.png

Creating a New, non-Accelerator Extension

  • Non-Accelerator extensions use a template, such as Screen Shot 2016-06-14 at 6.33.50 pm.png
  • To create single extension, invoke [ ant extgen ]
  • Reference any required extensions in extensioninfo.xml
  • Add your extension to config/localextension.xml
  • Invoke ant clean all

Creating an Accelerator-based Extension

  • An accelerator-based projects’ extension set is defined by the Accelerator template you are using as the basis for your site.
    • Your projects extensions are created by ant modulegen
    • For example, if you base your bookstore shop on the B2C Accelerator, ant will generate the following extensions for youScreen Shot 2016-06-14 at 6.37.11 pm.png

Template and Product ExtensionsScreen Shot 2016-06-14 at 6.37.41 pm.png

3. Basic Configuration

Screen Shot 2016-06-14 at 6.40.16 pm.png

Screen Shot 2016-06-14 at 6.40.47 pm.png

Configuration changes

  • Modify the local.properties file and restart the application server
    • No need to call ant in the console
    • Configuration files are read during startup
    • All configuration files are inside the config directory
  • However if you change any Tomcat configuration setting(such as tomcat.http.port), you need to call ant server
  • If in doubt, call ant all
  • It’s possible to change the properties on the runtime in the hAC
    • however, after a server restart, these changes are lost.

 

localextensions.xml

  • List of extensions used by build framework
  • Extensions can be listed by name instead of location path
  • Dependencies are resolved automatically using the path parameter. Build will find dependent extensions which are not explicitly listed.
  • A complete localextensions.xml can be generated using the extensionsxml ant target
  • During install process, overwrite hybris/config/localextensions.xml with content of desired sample file, then run ant all.

 

Load required extensions

Screen Shot 2016-06-14 at 6.51.27 pm.png

Screen Shot 2016-06-14 at 6.52.03 pm.png

4. Hybris Server

Bundled with SAP Hybris Commerce

  • SAP Hybris Commerce comes with a bundled Hybris server and a configuration template for the tcServer

Screen Shot 2016-06-15 at 9.22.35 am.png

What is the Hybris Server?

  • Optimized and pre-configured server based on Apache Tomcat
  • Production-ready quality and best suited to run all applications of the SAP Hybris Commerce Suite
  • Configuration templates available for development and production deployment.
  • Independent of the Operating system
  • Easy Installation
  • Can be run as a system service under Microsoft Windows or Linux
  • Contains a wrapper that automatically restarts the Apache Tomcat Java Virtual Machine if the Apache Tomcat hangs or stops.

5. hAC, Initialization, and Update

hAC – Hybris Administration Console

  • Administration
  • Monitoring
  • Configuraiton
  • localhost:9001/(by default)
  • localhost:9001/hac

Screen Shot 2016-06-15 at 9.27.52 am.png

Initialize or Update the System

Screen Shot 2016-06-15 at 9.30.09 am.png

System Initialization:

  • Entire type system is created from scratch
  • All database tables are dropped
  • Data model is created from scratch as defined in the items.xml files
  • New tables with initial dataset are created
  • Existing data model definitions will be lost

System Update:

  • Existing tables are updated to match changes in the domain model.
  • No loss of data!
  • Two major aspects
    • Adding newly defined types to the type system definition in the database
    • Modifying type system definition in the database to match the definition in the domain model.

Initialization and Update

  1. hac->Platform->Initialize | Update

Screen Shot 2016-06-15 at 9.35.52 am.png

2.  Ant view in eclipse + tenant

Screen Shot 2016-06-15 at 9.36.55 am.png

3. Command line

Screen Shot 2016-06-15 at 9.37.24 am.png

Screen Shot 2016-06-15 at 9.43.44 am.png

Configurable update from console

  • Optionally, hac is able to provide the configuration for update system from console:
    • hac->platform->update Screen Shot 2016-06-15 at 9.47.53 am.png
    • Choose your update settings
    • Click on Dump configuration
    • Copy configuration settings from the screen
    • Put it in a .json file
    • To execute the update run the command: ant updatesystem -Dtenant=<my tenant>   -DconfigFile=<path>/<filename>.json

Initializing and Updating SAP Hybris Commerce:

https://help.hybris.com/6.0.0/hcd/8bf4f76d86691014a29cf03f0616bdb7.html

6. Recipes

Hybris Installer

  • Gradle-based project written in Groovy
  • Simplifies installing the SAP Hybris Commerce Suite
  • Automated script that takes care of
    • Directory creation
    • Moving files
    • Updating configuration and properties files
    • System initialization

Recipes

  • Recipes are used for installing a flavor of the SAP Hybris Commerce Suite, that is the SAP Hybris Commerce Suite with the desired application(eg. B2C Accelerator, Telco Accelerator, or Datahub)
  • A recipe contains the information required to install the flavor, such as
    • Three mandatory tasks(setup, initialize, start)
    • Calls to required plugins(eg. installer-platform-plugin.jar)
    • Local properties
    • Extensions
    • Database configuration
    • Web archives
    • Server information(eg. Apache Tomcat)

Recipes creation

  • In order to create a recipe, you need to:
    • Create a folder for the recipe under /hybris/installer/recipes/
    • The name of your recipe must be the name of your folder
    • Using Groovy, create the build.gradle file containing your installer recipe
    • Create a README.txt describing what your recipe does and proving the commands required to setup, initialize and start your system.

 

 

 

 

 

 

HY400 – Overview

The SAP Hybris Commerce Platform

  • Composed of standard set of extensions providing base functionality
    • Build your site atop standard extensions, maintaining a clear code and configuration separation.
  • An extension
    • Is the packaging mechanism for a SAP Hybris Commerce feature
    • Contain business logic, type definitions, a web application, etc..
  • Database and application server abstraction layer
    • ORM framework
    • Build framework
    • Cockpit framework
    • Data modelling, validation, and imports
    • Web services
    • Configuration files
  • SAP Hybris Commerce Service

Building a Commerce Site on SAP Hybris

SAP Hybris Commerce is an omni-channel platform

  • It interacts with customers over the web, mobile devices, email, kiosks, or via support reps
  • It is connected to prodcut and website content catalogs, inventory and fulfillment systems, ERPs, etc..

Screen Shot 2016-06-14 at 5.29.24 pm.png

Building a Commerce Site with Commerce Accelerator

  • Some SAP Hybris customers build their commerce sites from the ground up
    • where the ground is the standard SAP Hybris platformScreen Shot 2016-06-14 at 5.34.06 pm.png
  • However, most leverage one of the SAP Hybris Commerce Accelerators
    • Functional sites that serve as starting points for your development.
    • Allow you to jump-start implementation, shortening your development time and simplifying maintenance
  • Each accelerator consists of extension templates
    • The templates are copied and renamed using the moduLegen ant target.
    • You will directly modify the java and configuration files in these extensions to build your site.

Accelerators

Screen Shot 2016-06-14 at 5.35.12 pm.png

Screen Shot 2016-06-14 at 5.35.39 pm.png

Screen Shot 2016-06-14 at 5.36.10 pm.png

 

Rude Magic –

 

With Capo on First Fret other wise
F#  = F
G#  = G
A#m = Am
C#  = C

Start of the Pre - Chorus
F#            G#                              A#m                  G#                     
Saturday morning jumped out of bed and put on my best suit
F#           A#m                       G#           F#
Got in my car and raced like a jet, all the way to you
F#           G#                                      C#
Knocked on your door with heart in my hand
                       G#         F#
To ask you a question 
                               G#                            A#m
Cause I know that you're an old fashioned man yeah yeah 


F#                                G#                  A#m                       
Can I have your daughter for the rest of my life? say yes, say yes 
           G#
Cause I need to know 

F#                                              G#                           
You say I'll never get your blessings till the day I die 
          A#m                G#            F#
Tough luck my friend but the answer is no!


F#                          C#
   Why you gotta be so rude? 
F#                         G#      F#
Don't you know I'm human too 
F#                          C#
why you gotta be so rude
                       A#m
I'm gonna marry her anyway
F#
marry that girl 
C#
marry her anyway
F#
marry that girl
A#m
yeah no matter what you say
F#
marry that girl
C#
and we'll be a family
F#                   C#
Why you gotta be so rude