Posts

items.xml in SAP Commerce [Hybris]

The items.xml file specifies types of an extension for defining the data model . By editing the items.xml file, you can define new types or extend existing types. In addition, you can define, override, and extend attributes of the types. Location of the items.xml file: The items.xml is located in the resources directory of an extension. The items.xml files are prefixed with the name of their respective extension in the form of extension name-items.xml. For example: For the core extension, the file will be core-items.xml . For the catalog extension, the file will be catalog-items.xml . Basic structure of the items.xml file: The items.xml defines the types for an extension in XML format and the basic structure is as follows: <items   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"               xsi:noNamespaceSchemaLocation="items.xsd">           ...

Type System in SAP Commerce [Hybris]

In this article, I have explained in details about what is a Type System in SAP Commerce [Hybris] and how the data can be organized in the Hybris system. Type System in SAP Commerce is a data modeling framework . It defines the structure and organization of data within the platform. In SAP Commerce data can be organized in the form of types , for example product information, customer information, address information, cart information and order information etc. A type is a template for objects and every object stored in a platform is a type instance. Types can be defined in an items.xml file using following aspects: the deployment : It defines the database table where objects stored. attributes : Manage and store data for the object. the java class of the object. In SAP Commerce, Type is a blueprint of an Item and Item is an instance of a Type . Types can inherit from other types, allowing for a hierarchical organization of data. Attributes define the properties of a type. They can ...

Differences between Extension and AddOn in SAP Hybris

In this article, I have explained differences between Extension and AddOn in details in SAP Commerce [Hybris] and also described when to use Extensions and when to use AddOn's. An Extension is a self-contained module that adds or modifies functionality in SAP Commerce.   An Extension generally represents a larger functionality and it contains business logic, type definitions, back-office configurations and other configuration files like xml, properties and etc, whereas AddOns are used to extend the functionality of SAP Commerce Accelerator[storefront] without modifying the core code base. AddOns are plugin kind of extension, you can easily remove your AddOns without refactoring the code of your Accelerator extension. Extension can work independently or extend the another extension whereas AddOn always depends on an existing extension (e.g. acceleratorstorefront). Extensions are used for business logic whereas AddOns are mostly used for Frontend/UI customization.     ...

AddOns in SAP Commerce [Hybris]

In this article, I explain in details about the AddOns in SAP Commerce and demonstrate how to create our own custom AddOn using ant extgen command based on yaddon template.  AddOns are used to extend the functionality of SAP Commerce Accelerator[storefront] without modifying the core code base. AddOn is a type of extension that allow you to add front-end related files such as JSP, HTML, CSS and JavaScript files without modifying the storefront front-end files directly. AddOns will never alter the core business logic rather it just enhances the existing storefront behaviour. AddOns often refers to plug and play kind of extensions and anytime you can install or uninstall from the storefront without effecting core business functionality. Generally, AddOns contains front-end related logic whereas extensions contain business logic. Creating a custom AddOn:           We can use same ant extgen command to create your own custom AddOn and need to provid...

Extensions in SAP Commerce [Hybris]

Image
In this article, I will explain in details about the extensions in SAP Commerce and demonstrate how to create our own custom extension using ant extgen command. SAP Commerce has a modular architecture, where new business logic is developed in a separate, function specific modules called extensions. Extension in SAP Commerce is very similar to project in Java. An extension contains business logic, type definitions, back-office configurations and some configuration files like xml, properties and etc. SAP Commerce ships with a number of template extensions and we can use ant  extgen for generating new extensions based on these template extensions. Every extension in Hybris contains one important file called extensioninfo.xml file which contains information about extension name, extension module and its dependencies.  To make any custom as template extension using below meta tag: <meta key=’extgen-template-extension’ value=’true’/> Create a New Extension: Creating a new e...