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. 远程通信机制RPC与RMI的关系

     1.RPC RPC(Remote Procedure Call Protocol)远程过程调用协议,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议.RPC不依赖于具体的网 ...

  2. linux的文件基本属性

    Linux系统是一种典型的多用户系统,不同的用户处于不同的地位,拥有不同的权限.为了保护系统的安全性,Linux系统对不同的用户访问同一文件(包括目录文件)的权限做了不同的规定 1.在Linux中我们 ...

  3. .net core 2.2 部署CentOS7(5)部署.net core mvc

    目录: .net core 2.2 部署CentOS7(1)安装虚拟机 .net core 2.2 部署CentOS7(2)给虚拟机安装CentOS7 .net core 2.2 部署CentOS7( ...

  4. EF6 CodeFirst代码迁移笔记

        由于EF7只支持codefirst only.朕无奈被微软逼上了梁山学一下codefirst,就算是为明年做准备吧.写的这些网上大致都有,基本没啥 新内容, 迁移 使用自动迁移 Enable- ...

  5. 撰写html标签的快捷方式1

    一: <ul> <li><a href=""></a></li></ul> 如果要写上面的标签,直接写 ul ...

  6. 撩课-Web大前端每天5道面试题-Day26

    1.vuejs与angularjs以及react的区别? .与AngularJS的区别 相同点: 都支持指令:内置指令和自定义指令. 都支持过滤器:内置过滤器和自定义过滤器. 都支持双向数据绑定. 都 ...

  7. jquery之Ajax(一)

    1. load( url, [data], [callback] ) :载入远程 HTML 文件代码并插入至 DOM 中. url (String) : 请求的HTML页的URL地址. data (M ...

  8. ASP.NET MVC 简单事务添加

    ASP.NET MVC 简单事务 //实例化查询上下文 using ( BookStoreEntities db = new BookStoreEntities()) { //找到需要价格和名称的数据 ...

  9. Vue.js 的一些小技巧

    给 props 属性设置多个类型 这个技巧在开发组件的时候用的较多,为了更大的容错性考虑,同时代码也更加人性化: export default { props: { width: { type: [S ...

  10. DNS必知必会

    什么是DNS? DNS服务器(Domain Name Server,域名服务器)是进行域名和与之相对应的IP地址进行转换的服务器. 基本概念 DNS服务器中保存了一张域名和与之相对应的IP地址 的表, ...