Extensions in Hybris

Extension in Hybris is very similar to Project in Java. We know that Project basically contains the business logic and some configuration files(XML,properties files). Similarly Extension in Hybris contains the same and some additional files but it’s called Extension instead of Project in Hybris. Every extension will have one important file called extensioninfo.xml file. An extension is an encapsulated piece of the hybris e-Commerce Suite that can contain business logic, type definitions, a web application, or a hybris Management Console (hMC) configuration. That way, you link up in one place all of the functionality that covers a certain field of use.

Extgen

ant extgen

Ant extgen command can be used to create an extension. This command uses the specified extension template to create the structure of the new extension. We should not modify any of the existing extension in Hybris. We should always create new extension to define the custom logic in Hybris. By the above command we can create single custom extension.

Modulegen

ant modulegen

Ant modulegen command can be used to create the module. It creates the set of extensions based on the module template we select. Generally for B2B and B2C module , it creates 7 extensions which are logically related and grouped.

 <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbackcore"/>
      <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbackbackoffice"/>
      <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbackfacades"/>
      <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbackfulfilmentprocess"/>
      <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbackinitialdata"/>
      <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbackstorefront"/>
      <extension dir="/Users/fallback/hybris2205/hybris/bin/custom/fallback/fallbacktest"/>

By the above command (ant modulegen) we can create multiple custom extension at one time.

Leave a comment