SAP Commerce(SAP Hybris)学习资料汇总
版本号:v1.02
@TOC
SAP官方帮助文档
Installer-Recipe
- 不能用于生产用途。文件夹位置:installer/recipes. 这个链接包含了所有recipe的说明。
Extension和Addon的概念
- 若干extensions组合在一起,以module的形式发布。
An extension can contain business logic, type definitions, a web application, or a Hybris Management Console configuration. That way, you link up in one place all of the functionality that covers a certain field of use, for example a webshop.
Addon是一种特殊的extension,扩展了Commerce Accelerator的功能。这种extension添加了UI页面,但又没有直接修改Storefront的实现。
AddOns extend the functionality of the SAP Commerce Accelerator. They are a type of extension that allow you to add front-end files such JSP, HTML, CSS, and JavaScript files, and images without modifying the storefront front-end files directly.
这个链接包含了一个表格,可以查询Extension和Addon的ID和description.
An extension is an encapsulated piece of software that extends SAP Commerce functionality by either modifying existing features, or introduction new features.
Extension modules are structural elements of an extension.
Extension module是extension的一部分。
You can implement JUnit tests for the extension's core extension module. The files for these JUnit tests must be located in the testsrc directory of the extension.
每个extension都有一个名叫core的 extension module,包含了该extension的type system definition,items.xml, 位于resources文件夹内。命名规范:
The name of this file is always defined accordingly: <$extension> -items.xml where <$extension> is the name of an extension.
与类型相关的Java source code文件也位于core extension module内。
items.xml的链接.
- web extension module: 是extension的一部分,可以通过浏览器访问:
To launch a web extension module via your web browser, go to the URL path to Platform on the server/name of extension/starting page. For example, if you are running myExtension locally on default settings, the URL would be http://localhost:9001/myExtension.
Internationalization-and-localization
- 什么是extension的core module:
A core module consists of an items.xml file (and therefore allows to add new types to the system), a manager class, classes for the JaLo Layer and the ServiceLayer and JUnit test classes. The following directories are required: /src, /resources, /testsrc.
While the Commerce Platform can run without any package, no package can run without the Commerce Platform.
Commerce platform也是由extension组成的,称为core extension. 在这些core extension之上才是build framework,和tomcat server.
Hybris-initialization和update过程
什么是Hybris的initialization:
Initialization drops existing type definitions from the database prior to rebuilding, so the entire type system is created from scratch. So during an initialization, type system definitions are created to match the type system definition in the items.xml files.
Update: items.xml里定义的新类型,会施加到类型系统里。
Model
基于items.xml的定义生成types.
SAP-Commerce里的Spring框架
是Service Layer的foundation.
Dependent Injection: 组件的依赖不是其自身维护,而是配置在外部。
Dependency injection is a software architecture pattern in which a component's dependencies are not managed by the component itself but are configured externally.
A so-called container (application context) reads the configuration file, resolves the dependencies, and puts together the objects. When the objects are ready, all the dependencies are already injected.
<bean class="de.hybris.platform.order.OrderService"> <property name="stockService"> <bean class="de.hybris.platform.stock.StockService"/> </property> </bean>
xml文件的位置:${HYBRIS_BIN_DIR}/platform/ext/core/resources
命名规范:
There you find files with the name pattern |component|-spring.xml, where is something like product, order, i18n, security, and so on. For the beans themselves, a name pattern such as xyzService is recommended, such as: productService, catalogService, and so on.
Service Layer的API通过interface暴露出来。interface的实现就是Spring beans,id name可以从SAP commerce API doc里找到。
Accelerator
SAP Commerce Accelerator is a ready-to-use web implementation template that enables you to jumpstart your implementation and easily build and maintain a feature-rich and flexible commerce solution.
Service-Layer
是三层的统称:ServiceLayer Framework (including the actual ServiceLayer, the Infrastructure Services, and the Business Services)
relies on so-called models, which are POJOs. Attributes on models have automatically generated getter and setter methods. Models are generated based on types.
ProductModel是service layer的概念,基于type自动生成,getter和setter.
Type layer也就是items.xml.
Hybris-Type-System
类型系统是对象的模板。platform里每个对象都是类型的实例。
Types定义了持久化对象:
- Attribute存储对象的数据。
- Deployment定义数据库表
- java class
A Type is the type definition in items.xml and its Java implementation.
An object instance of a type is called an item:
类型分两种:System-related types and business-related types.
System-related types又由下列类型组成:
Infrastructure types: ComposedTypes (also referred to as ItemTypes) set up type definitions and may carry attributes to hold information. In the end, every persistent object in the SAP Commerce is an instance of ComposedType or of one of its subtypes.
Business-related types: (like Order, Discount, Shoe) allow you to manage product and / or customer information so that you can run your business.
every object stored in SAP Commerce is an instance of a type. Even type definitions are instances of the type Type. This means that there are two aspects of a type definition: it is an item and, at the same time, it defines other items.
To differentiate between normal object instances and type definitions, non-type objects in Platform are referred to as items. The lower case spelling item refers to an object in Platform; the upper case spelling Item refers to the type definition.
小写的items代表platform里non-type对象, 大写的代表类型定义。
The following code snippet defines an item called SpecialProduct that is a subtype of Product but its type is not defined as a ComposedType, but as a SpecialComposedType (via the metatype attribute). Instances of SpecialProduct are thus subtypes of Product, but the type definition is stored as a SpecialComposedType.
<item code="SpecialProduct" metatype="SpecialComposedType" extends="Product">
类型定义attribute,如同Java 类定义fields, attribute可以是复合类型或者简单Java类型。
Platform-Services-and-Utilities
backoffice
其他网友的资料
SAP成都研究院Commerce开发人员Zhang Jonathan的三篇概述文章:
- 从产品展示页面谈谈Hybris的特有概念和设计结构
- 从产品展示页面谈谈Hybris系列之二: DTO, Converter和Populator
- 从产品展示页面谈谈Hybris系列之三:Hybris Service层介绍
Jerry Wang的文章:
其它文章:
本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Java 中的递归
Java 中的递归 递归递归一种通过调用某个方法来描述需要重复进行的操作。该方法的特点就是可以自己调用自己。 案例一排队的问题在生活中,我们经常需要排队。在排队中,我们怎么才能知道自己所排在第几位呢? 我们也许会想到数自己前面有几个人,这就是典型的迭代思想。就像是一个while循环,只要前面还有没数过的人,就不会停止。这种方式相对来说是比较直观的,但是同样也有局限性。比如在排队时,遇到了转弯,我们看不到前面的人怎么办呢? 有一个方法,我们可以通过询问前面一个人他所处的位置。假设有A、B、C、D四个人,D询问C所在的位置,C询问B所在位置,B询问A所在的位置。A知道自己排在第一位(他不需要再问别人了,这一个询问的过程结束),然后告诉B,那B就知道自己在第二位;然后B告诉C,C也就知道了自己在第三位;最后C告诉D他在第三位时,D也就知道自己所在的位置了。这就是使用递归思想来分析问题——每个人都来回答一个问题,从而使这个问题多次重现(recur)。 这一点也是递归思想的精髓所在,递归方法涉及多个进行合作的单元,每个单元负责解决问题的一小部分。例如刚刚那个例子,每个人都像前询问一个问题,最后每...
- 下一篇
.net core 集成 sentry 进行异常报警
.net core 集成 sentry 进行异常报警 Intro#Sentry 是一个实时事件日志记录和汇集的平台。其专注于错误监控以及提取一切事后处理所需信息而不依赖于麻烦的用户反馈。它分为客户端和服务端,客户端(目前客户端有 C#, Python, PHP, JavaScript, Ruby等多种语言)就嵌入在你的应用程序中间,程序出现异常就向服务端发送消息,服务端将消息记录到数据库中并提供一个web页方便查看。 Sentry 是 Python 写的一个开源的项目https://github.com/getsentry/sentry而且可以满足私有部署的需求 官方介绍: Sentry is cross-platform application monitoring, with a focus on error reporting. Sentry fundamentally is a service that helps you monitor and fix crashes in realtime. The server is in Python, but it contains ...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- CentOS8编译安装MySQL8.0.19
- MySQL8.0.19开启GTID主从同步CentOS8
- SpringBoot2全家桶,快速入门学习开发网站教程
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- CentOS7,CentOS8安装Elasticsearch6.8.6
- Red5直播服务器,属于Java语言的直播服务器
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- CentOS6,CentOS7官方镜像安装Oracle11G