How To create extension in Hybris(创建Hybris的扩展)

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


Go To command prompt YourPath\hybris\bin\platform  And Type Following Commands

Step 1: Set ant Environment

               Your Path\hybris\bin\platform>setantenv.bat and PRESS Enter key

    

and Return Your Path \bin\platform>

Step 2: Type extension generate command

    2.a) Your Path \bin\platform> ant extgen   and PRESS Enter Key

  
2.b.) By default extension template select (yempty) Press Enter  key
     
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. 
For Example : type "State" and PRESS enter key


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 

2.b.3)



  

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



Double click on localextension.xml


Step 4 : Run ant all  and Return Command prompt



Step 5 Run Server  type command hybrisserver.bat and PRESS enter key

          


Afte Few minutes Your Server started and given a message.



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
                                         password = nimda 





Step 7: Go to platform->Extensions
                           



     search your extension "state"  and you will get your extension.




 if the extension comes with a core extension module, an hmc extension module, webroot extension module

Step 8: Go to your extension/extensioninfo.xml. and comment




                like : state/ extensioninfo.xml  and comment

                 <!--              <webmodule jspcompile="false" webroot="state" />   --> 


Double click on extensioninfo.xml


Step 9: Stop server (ctrl+c)  and press y 


 Run ant all



 and start server
                your path\hybris\bin\platform>hybrisserver.bat




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
2)  eclipsebin to which Eclipse generates the build output

个人学习
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值