Extgen

Extgen

SAP Hybris commerce ships with an extension generator tool called extgen, which is short for extension generator. Using extgen tool, you can create new extension based on extension templates. With the extgen tool, you can create one new extension using one template extension. From a technical perspective, any extension can be used as a template extension. The extgen tool is fairly basic in that it simply replaces the tokens configured in properties file.

SAP Hybris Commerce installation

Before running the extgen tool, you need to download the latest version of SAP Hybris Commerce.

Once you have downloaded SAP Hybris Commerce, extract the Hybris Commerce ZIP file.

1.Open a command prompt.

cmd

2.Navigate to the %HYBRIS_HOME_DIR%/installer directory.

navigate

3. Invoke the installer with the b2c_acc recipe by entering the following command.

installer

Steps to create an extension using extgen

1.Navigate to the %HYBRIS_HOME_DIR%/hybris/bin/platform directory

platform

2. Now run setantenv.bat file. Do not close the command prompt.

setantenv

3.Now run

extgen

Extgen prompts you to specify values for the technical aspects of an extension. Extgen comes with default values for all these technical aspects.

These default values are defined in the project.properties file in the extgen directory. The default value is displayed in brackets ([ and ])

Choose a template for generation

Press enter to use the default value. Here default value is [yempty] and we press enter.

template

Choose the name of extension

Here we specify the name of the extension is hybrisdiary.

extensionname

Choose the package name

We can choose default package name for our extension but we specify the name of the package is org.bitbyte .

 package

Now observe that new extension(hybrisdiary) has been created inside hybris/bin/custom folder.

 custom

Configure localextension.xml file

Add your extension to your X:\%HYBRIS_HOME_DIR%\hybris\config/localextensions.xml. After the creation of extensions using extgen, make sure to update the localextensions.xml file as below

localextension

localextension.xml file

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s