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

个人学习

How To create extension in Hybris(创建Hybris的扩展)的更多相关文章

  1. [官网]CREATE EXTENSION PostGreSQL 创建函数的方法

    CREATE EXTENSION https://www.postgresql.org/docs/current/sql-createextension.html CREATE EXTENSION — ...

  2. git之create local reposition(创建本地仓库)

    1.创建名为git-reposition的仓库 mkdir home/sunjf/git-reposition 注:home/sunjf可以指定为你想要的路径下面 2.初始化仓库 cd ~/git-r ...

  3. 创建一个EMS 扩展包

    EMS Package 向导: File > New > Other > Delphi projects > EMS > EMS Package Empty packag ...

  4. C#创建自己的扩展方法

    C#可以创建自己的扩展方法Extension Method: 参考这篇<判断是否为空然后赋值>http://www.cnblogs.com/insus/p/8004097.html 里,前 ...

  5. 创建VS Code 扩展插件

    VS Code提供了强大的扩展功能,我们可以通过开发插件实现自己的业务模型编辑器.这里我们快速介绍一下插件的创建.开发和发布过程. 创建插件开发模板 首先需要确认系统中安装了node.js,并且可以使 ...

  6. java和javax都是Java的API包,java是核心包,javax的x是extension的意思,也就是扩展包。

    java和javax都是Java的API包,java是核心包,javax的x是extension的意思,也就是扩展包.

  7. 如何在backoffice里创建Hybris image container以及分配给product

    登录backoffice,在media container视图点击新建按钮: Catalog选择Product Catalog: 在Properties界面,可以选择media实例放入该contain ...

  8. git之remote repository create(远程仓库创建)

    参考:Git教程 - 廖雪峰的官方网站 1.在Git bash窗口执行如下指令创建SSH KEY: ssh-keygen -t rsa -C "sunjf@biomarker.com.cn& ...

  9. 新建体(2):create or replace object创建存储包、存储过程、函数

    http://heisetoufa.iteye.com/blog/366957/ 创建一个package(包) 声明: create or replace package mpay_route is ...

随机推荐

  1. Spring的@Scheduled任务调度

    一. 定时任务实现方式 定时任务实现方式: Java自带的java.util.Timer类,这个类允许你调度一个java.util.TimerTask任务.使用这种方式可以让你的程序按照某一个频度执行 ...

  2. 反应器(Reactor)模式

    Java NIO非堵塞技术实际是采取反应器模式,或者说是观察者(observer)模式为我们监察I/O端口,如果有内容进来,会自动通知我们,这样,我们就不必开启多个线程死等,从外界看,实现了流畅的I/ ...

  3. C# WebBrowser设置代理

    WebBrowser控件是基于IE浏览器的,所以它的内核功能是依赖于IE. code: class IEProxy { //设置代理选项 private const int INTERNET_OPTI ...

  4. 重置Root用户密码

    在忘记root用户密码是用于重置root用户密码: 1.开机按e. 2.在linux16开头的一行的末尾添加rd.break,按ctrl+x. 3.依次执行命令: mount -o remount,r ...

  5. sql中把时间转换成xx年xx月xx日

    DECLARE @dt datetime SET @dt=GETDATE()--1.短日期格式:yyyy-m-d SELECT STUFF(STUFF(CONVERT(char(8),@dt,112) ...

  6. HDFS要点剖析

    谈到大数据,不得不提的一个名词是"HDFS".它是一种分布式文件存储系统,其系统架构图如下图所示: 从图中可以了解到的几个关键概念 元数据(MetaData) 机架(Rock) 块 ...

  7. js实现unicode码字符串与utf8字节数据互转

    js的string变量存储字符串使用的是unicode编码,要保存时必须选择其他编码后进行传输,比如转成utf-8,utf-32等.存储到数据库中为utf-8编码,读取出来如何转换成正确的字符串就成了 ...

  8. EF 多种查询方式

    比较常用的查询方式linq to entity,这里先看一种写法: var query = (from d in testContext.Set<DepartPerson>() //查询和 ...

  9. C#设计模式--模板方法模式(学习Learning hard 设计模式笔记)

    class Program { static void Main(string[] args) { //创建一个菠菜实例并调用模板方法 Spinach spinach = new Spinach(); ...

  10. 宝塔面板nginx配置安装Discuz

    Discuz!在Nginx下的Rewrite 需要说明的是,下网上以前一直流传的Rewrite都是有误的. 下面的Rewrite中百分号前面多了个转移字符"",这在Apache中是 ...