How To Create Custom Addon In Hybris
Lets Understand about Extgen and Modulegen with example
Extgen
How to create an extension in Hybris?
Ant extgen command can be used to create an extension.
We have to use ant extgen command as below
Navigate to hybris\bin\platform path in command prompt
And use ant extgen command
Provide the required values
Specify the extension template,name of the extension and package name while running this command
Extension template should be any of the existing extension templates which are populated when we run the ant extgen command
This command uses the specified extension template to create the structure of the new extension.
Name of the extension we provide will be added as the name inside the extensioninfo.xml file.
Now observe that new extension has been created inside hybris\bin\custom folder.
Update localextensions.xml
Once we create the new extension we must add it inside localextensions.xml so that hybris will consider this extension during the build.
So add an extension inside localextensions.xml as below
-
extension name="payment"
Payment – is the name of the extension.
Make custom extension as Extension Template
We can make our custom extension also as extension template so that it appears in the list of extension templates during ant extgen command
To achieve this , we need to define the below tag in extensioninfo.xml
-
meta key= "extgen-template-extension" value= "true"
meta key="extgen-template-extension" value="true"
Adding this enables our extension to appear in the ant extgen command templates list.
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.
We have to use ant modulegen command as below
Navigate to hybris\bin\platform path in command prompt
And use ant modulegen command
Specify the module template,name of the module and package name while running this command
Module template should be any of the existing module templates which are populated when we run the ant modulegen command
This command uses the specified module template to create the set of the extensions to the new module.
After the build success, observe the new set of extensions has been created inside hybris\bin\custom\training folder.
After the creation of extensions using modulegen, make sure to update the localextensions.xml file as below
-
<extension name= 'trainingcockpits' />
-
<extension name= 'traininginitialdata' />
-
<extension name= 'trainingstorefront' />
-
<extension name= 'trainingfacades' />
-
<extension name= 'trainingfulfilmentprocess' />
-
<extension name= 'trainingtest' />
-
<extension name= 'trainingcore' />
<extension name='trainingcockpits' /> <extension name='traininginitialdata' /> <extension name='trainingstorefront' /> <extension name='trainingfacades' /> <extension name='trainingfulfilmentprocess' /> <extension name='trainingtest' /> <extension name='trainingcore' />
About the Author
How To Create Custom Addon In Hybris
Source: http://javainsimpleway.com/extgen-and-modulegen/
Posted by: parentdights.blogspot.com
0 Response to "How To Create Custom Addon In Hybris"
Post a Comment