SAP published a brand-new and interesting section this month without a special announcement. It looks useful for newcomers.
There are two tours published: hybris Discovery Tours, which has only one page, and the hybris Explore Tour, which has 35 pages.
In the Explore Hybris tour, you use the core features of SAP Hybris Commerce to create a website that sells concert tickets for a fictitious company called the Little Concert Company.
The following subsections help you get things right when you start a new project. You will find automation scripts in the sections below that may be very helpful in your everyday work. The tour shows how to create a simple app using hybris and SAP best practices.
All links point to help.hybris.com, which requires authentication.
-
How to set up a Git repository.
Version control systems are an essential part of any non-trivial software development project. The primary purpose of a version control system is to centrally track and store changes made to software as it is developed.
-
How to install, build, and run hybris.
Hybris Commerce ships with a set of pre-configured installation scripts, called installer recipes. Installer recipes simplify the installation and setup of Hybris for development or demonstration purposes.
-
How to create a new extension.
SAP Hybris Commerce has a modular architecture, where new business logic is developed in separate, function-specific modules called extensions.
-
How to add a new extension to the system.
The
localextensions.xmlfile contains the list of extensions your specific SAP Hybris Commerce configuration includes at compile- and run-time. -
How to create a data model for the project: a concert ticket e-shop.
The data model underlying SAP Hybris Commerce is defined in XML files. New data types for extensions, called item types, are defined in
<extension-name>-items.xmlfiles. -
How hybris works with databases.
SAP Hybris Commerce supports a range of third-party databases. This gives you great flexibility, allowing you to choose a database best suited to your solution.
-
How ImpEx works.
SAP Hybris Commerce ships with a powerful text-based import and export functionality called ImpEx.
-
How to import essential data to your data model.
ImpEx files containing essential and project data can be prepared following the Convention over Configuration principle (CoC).
-
How to initialize the system.
You can hook into the system initialization and update process to load project data during platform initialization.
-
How to use ImpEx naming conventions.
SAP Hybris Commerce looks for and loads data from ImpEx files that follow a specific naming convention. This behavior supports the convention over configuration software design paradigm.
-
How to extend the service layer.
When implementing new business logic, you separate the business code into Java classes called services. Each service implements a specific, well-defined requirement.
-
How to create an integration test for your service.
Integration tests are essential for demonstrating that your new functionality works as expected. They notify you when you break existing behavior, and can therefore help reduce bugs.
-
How to test your new service with a unit test.
You can simulate dependencies to execute unit tests that run independently of the Hybris platform.
-
How to extend the facade layer.
A facade is an abstraction layer that provides a simplified interface to the underlying implementation.
-
How to build a simple front-end store.
Once you have a model and business logic in place, you can develop a suitable front-end web application. When building your front end, use the Spring MVC framework to separate the model, the view, and the controller parts.
-
How to work with dynamic attributes.
Dynamic attributes enable you to add attributes to your model and to create custom logic for them without touching the model class itself. They provide a way to generate new data and access it without calling a separate service to do so. Dynamic attributes are transient data that is not persisted to the database.
Dynamic Attributes Integration
How to test dynamic attributes integration.
It is good practice to always run an integration test when introducing new features, to test your new classes in context.
-
How to display the dynamic attributes on the storefront [banal].
Update the relevant parts of your extension to use the new dynamic attribute.
-
How to work with hybris events.
The Event System is a framework provided by the ServiceLayer that allows you to send and receive events within SAP Hybris Commerce.
Custom Events and Interceptors
How to work with interceptors and custom events.
Event interceptors check whether constraints set for the behavior of life cycles of models are fulfilled.
-
How to set up asynchronous messaging.
SAP Hybris Commerce supports cluster-aware events. Cluster-aware events enable the processing of events in separate threads, or on particular nodes of a cluster.
-
How to set up regular tasks.
Hybris Commerce provides a means to set up regular tasks. With these tasks, or cron jobs, you can repeatedly perform complex business logic at particular times and intervals.
-
How to set up the cron job to get triggered at regular intervals.
With your business logic successfully factored into a job class, you can trigger its execution with the use of a cron job.
-
How to create a cron job script using Groovy.
You can use any dynamic scripting language to write jobs for execution. In the following example, you write a job in the Groovy scripting language.
Backoffice Administration Cockpit
How to configure and extend Backoffice Administration Cockpit.
Backoffice Administration Cockpit is a user-friendly, browser-based user interface for viewing, creating, and manipulating data within Hybris Commerce.
-
How to localize attribute values using ImpEx.
Localization is intended to adapt SAP Hybris Commerce to multiple languages.
Localization in Backoffice Administration Cockpit
How to localize attribute values using Backoffice.
You can define localized values for item type attributes directly in the Backoffice Administration Cockpit.
-
How to define a validation constraint in the
items.xmlfile.The SAP Hybris Commerce data validation framework ensures clean, correct, and useful data. The validation framework is based on the Java validation specification, JSR 303. It offers an easy and extensible way to validate data before it is passed on to the persistence layer.
Validation Constraints in Backoffice
How to define a validation constraint in Backoffice.
You can create and define validation constraints in the SAP Hybris Commerce Backoffice Administration Cockpit.
Validation Constraints in ImpEx
How to define a validation constraint in ImpEx.
You can define validation constraints in ImpEx files, making it easy to reload constraints after initializing the database.
-
How to define a custom validation constraint.
Although the validation framework provides all constraints from the JSR 303 specification, sometimes you need other constraint types that are specific to your project.
Integration Test for the Custom Constraint
How to write an integration test for the custom constraint.
Become familiar with how to use the Hybris validation service in code.
Platform Web Services Extension
How to work with the Platform Web Services Extension.
The SAP Hybris Commerce Web Services API allows external applications to communicate with Hybris Commerce via RESTful web service calls.
-
How to add media files to the project.
SAP Hybris Commerce supports media files. A media file can be anything that can be saved on a file system.
-
How to define default configuration property values.
SAP Hybris Commerce relies on two essential configuration files:
project.propertiesandlocal.properties. Project properties are the Hybris defaults, while local properties is where you may define your own configuration for your extension.
© Rauf Aliev, October 2017