Easy Extension Framework v0.5 Help

Easy Extension

An Easy Extension is an encapsulated piece of software code that extends SAP Commerce Cloud functionality by either modifying existing features or introducing new features. With an Easy Extension, you link up in one place all the functionality that covers a certain field of use.

How is an Easy Extension different from the Regular SAP Commerce Cloud Extensions?

The difference between the SAP Commerce Cloud Extension and an Easy Extension can be understood from the following table:

Table | Difference between SAP Commerce Cloud Extension and an Easy Extension

Characteristics

SAP Commerce Cloud Extension

Easy Extension

Development Frameworks

Java, Spring, Ant

Groovy, Gradle

Extensibility Type

In-App (Compile Time)

In-App (Runtime)

Configuration

Inside localextensions.xml

In an Easy Repository

Installation

Traditional Build>Package>Deploy

At Runtime

Reload

Restart the Server

At Runtime

Uninstallation

Traditional Build>Package>Deploy

At Runtime

Recommended for

Complex large developments

Simple Pluggable features, Integrations, Connectors, etc.

Inclusion of External Libraries Supported

Yes

No

Contents of an Easy Extension

An Easy Extension is a folder/directory structure (similar to an eclipse project / IntelliJ IDEA module) that can contain:

  • A manifest definition defining meta-information for the Easy Extension (easy.json) — Mandatory

  • Groovy based generated source code classes (inside gensrc/main/groovy) — Optional

  • Groovy based main source code classes (inside src/main/groovy) — Optional

    • Groovy based bean definition and declaration script (EasyBeans.groovy) — Optional

    • Groovy-based script to execute after installation of the easy extension (Init.groovy) — Optional

  • Groovy based main resources (inside src/main/resources) — Mandatory

    • An Installation Wizard (easy-installer-wizard.json) — Optional

    • A properties file to set some properties in SAP Commerce Cloud (easy.properties) — Optional

    • A properties file to set some properties in SAP Commerce Cloud (easy.properties) — Optional

    • A type definitions descriptor to define the SAP Commerce Cloud types (easytypes.json) — Optional

    • ImpEx scripts to execute during installation / uninstallation of the Easy Extension (inside impex) — Optional

    • Backoffice configurations & localization (inside backoffice) — Optional

  • Groovy based test source code classes (inside src/test/groovy) — Optional

  • Groovy based test resources (inside src/test/groovy) — Optional

Structure of an Easy Extension

The structure of an Easy Extension looks as:

Easy Extension Structure

Figure | Easy Extension Structure

Easy Extension Manifest

easy.json is the manifest file for an Easy extension, it contains the information below.

Table | Easy Extension manifest fields

Property

Mandatory

Default

Comments

groupId

Yes

com.sap.cx.boosters.easy

The group id for the Easy extension. It should have the naming similar to a java package.

id

Yes

No value

The id of the Easy extension. It should not contain any special character

name

Yes

No value

The name of the Easy extension

version

Yes

No value

The version of the Easy extension

easyVersion

Yes

No value

The easy version the Easy extension built on

thumbnail

Yes

No value

The url of the thumbnail of the Easy extension

description

No

No value

The description of the Easy extension

authors

No

No value

List of Easy extension authors

vendor

No

No value

Vendor of Easy extension

requires

No

No value

Dependencies (easy extensions, commerce extensions) of Easy extension

Below is an example of an Easy Extension Manifest (easy.json):

{ "groupId": "com.sap.cx.boosters.easy", "id": "demo", "name": "Demo", "version": "0.0.2", "easyVersion": "0.2", "description": "The demo easy extension", "documentation": "https://github.com/apanwar/easy-extensions/blob/main/README.md", "authors": [ "Amit Panwar", "Yannick Robin" ], "vendor": "SAP", "tags": [ "easy", "demo" ] }

Easy installation wizard

In easy-installer-wizard.json, you indicate the configuration of the schema for the wizard. Please refer to Easy Installation Wizard documentation.

Easy properties

In easy.properties, you indicate the SAP Commerce Cloud properties you want to configure. Once these properties are defined, they are available in the platform as any other properties called by ConfigurationService.

Groovy Sources

The Groovy directories (src/main/groovy and src/test/groovy) are where the Groovy code of the extension is located.

Resources and Configurations

The resources directories (src/main/resources and src/test/resources) are where the configuration resources of the extension are located.

Easy beans

In EasyBeans.groovy, you indicate the Easy beans you want to configure. Once these Easy beans are defined, they are available in SAP Commerce Cloud platform as any other Spring beans.

In the example below, we create greeterService and override priceService.

import com.sap.cx.boosters.extension.demo.service.GreeterService import com.sap.cx.boosters.extension.demo.service.EasyPriceService logger.debug "${extension.id} - Registering spring beans..." easyCoreBeans { logger.debug "${extension.id} - Registering spring core beans..." greeterService(GreeterService) priceService(EasyPriceService){ it.parent = ref('defaultPriceService') } logger.debug "${extension.id} - Registered spring core beans." } logger.debug "${extension.id} - Registered spring beans."

Easy ImpEx

An Easy Extension Framework importing of ImpEx scripts while installing or uninstalling an easy Extension. Following directories designate for the installation and uninstallation purposes

  • src/main/resources/impex/install directory contains the ImpEx files that are imported with installation of an Easy extension.

  • src/main/resources/impex/uninstall directory contains the ImpEx files that are imported with uninstallation of an Easy extension.

Easy Init script

The Easy Init script is executed at the deployment of the extension. By default, the name of the script is Init.groovy and it is expected at the root of Groovy main folder. The name can be changed in the Easy extension definition file. This file is optional and not mandatory to include in an easy extension.

Easy Type Definitions

Please refer to Easy Type documentation. The Easy Type definitions are located at: src/main/resources/easytypes.json

Easy Backoffice Configurations

Please refer to Easy Backoffice documentation. The backoffice configurations are located at: src/main/resources/backoffice

Last modified: 18 August 2025