Extensions in Hybris

Hybris suite is a package of number of business functionalities, like a storefront to checkout products, a platform to provide spring features, a service layer to provide persistence and lot others.

Each of these functionality is available as an isolated java project, which has it’s own data model (if required), its own spring configurations ans properties etc. This grouping of similar functionality into one java project is termed as extension. Below is a snapshot for commerceservices extension from hybris.

ext1

An extension may or may not have a web interface. It may depend on other extensions to fulfill it’s purpose. This information is defined in extensioninfo.xml

The data model of extension is defined in <extension-name>-items.xml file.

The spring configuration for an extension is defined in <extension-name>-springs.xml. It has all bean definitions, dependency injections etc.

Each active extension of your hybris project must find a place in localextension.xml

Understanding Accelerators

So once you installed hybris, you think of having your own code base. At the same time, we see a lot of vanilla extensions, through which we can actually even see a working site, normally can be browsed at,

http://localhost:9001/yaccleratorStorefront/?site=hybris

So Cool na!!! We just installed and we have a working site.

But wait. That’s a sample. The literal meaning of accelerator, is to speed up. So hybris has given you a sample, so that can be used as a reference for your own custom store front. So any thing, that start with, yacclerator is a sample extension for reference only. We should not make changes to this, instead we should use our own code base generated via modulegen to achieve customization.

And then we will see our store front at

http://localhost:9001/actualStorefront/?site=actual

Set up a MVC application in hybris

Background

There are times, when OOB cockpits, applications are not sufficient for client requirements.  Customizing cockpit is often a tedious task as it involves struggle with adamant ZK framework.

Alternative

Hybris never discouraged us to create more flexible MVC applications and still use the powerful platform features. This acts just like other full fledged application and run inside same hybris server.
1. Create a new extension. Let’s call it Backoffice.
1