What is an extension?
An extension is an encapsulated piece of the Hybris Commerce Suite that can contain business logic, type definitions, a web application, or Hybris Management Console (hmc) configuration.
There are two types of extensions :
1. Predefined
2. User defined Extension
Or
Basically
extension is a
unit of functionality in hybris. in other work you can say each
extension is used for a specific functionality in hybris. If you look the
architecture of Hybris then you can found that if you need too
customize any functionality of Hybris then you do by
creating your own extension So every
extension in hybris contains
1. Bussiness logic
2. type defintion(items.xml)
3. web application
4. hmc configuration
1. Bussiness logic
2. type defintion(items.xml)
3. web application
4. hmc configuration
Go To command prompt YourPath\hybris\bin\platform And Type Following Commands
Step 1: Set ant Environment
and Return Your Path \bin\platform>
Step 2: Type extension generate command
2.b.1) After Pressing Enter key Hybris Ask
If simply press enter, by Default your extension name is " training" Other wise Type Your Extension name here.
2.b.2) Again Hybris ask Please choose the package name of your extension.
type Your package name, If press Enter by default package name accept other wise type Here. In My Case package name is " org.hybris.platform.state " and press enter
Now Your extension will create and Next STEP Hybris told you
When you perform ant target extgen then an extension will be created in custom folder.
Step 3: Update new extension in You path/hybris/config/localextensions.xml
Step 6: Go to browser and type http://localhost:9001 and PRESS enter key. Open Hybris administrative console.
6.a> Open Hybris administrative console. and
Enter user name =admin
Enter user name =admin
Step 7: Go to platform->Extensions
if the extension comes with a core extension module, an hmc extension module, webroot extension module
like : state/ extensioninfo.xml and comment
<!-- <webmodule jspcompile="false" webroot="state" /> -->
and start server
after few minutes Server started
Go to browser http://localhost:9001
and type username|password: admin|nimda
Go to platform->Extensions
and check no accessible webroot for state
Before
And two output directories
1)
classes, to which ant builds generate classes
个人学习