Configuration files for Apache Tomcat, such as wrapper.conf or wrapper-debug.conf
A license file
两种配置文件:project.properties and local.properties.
Project properties are the SAP Commerce defaults, while local properties is where you may define your own configuration for your extension.
The project.properties file is located in the /platform directory, and provides factory default settings. It is not recommended to edit this file.
The local.properties file is a working copy of the project.properties file, located in the directory. It allows you to override default settings from the project.properties file.
文件目录,层级结构
bin/platform: The core SAP Commerce platform extensions that are loaded on startup. This directory also has the build framework, and extension templates.
data: Data files such as media files and LucerneSearch indexes. The directory also contains HSQLDB data files, if you are using the default database in a test or development environment.
log: Log files, including Tomcat and JDBC logs.
NEVER change anything within the bin directory. Do not keep any custom data configuration in this directory or any of the subdirectories. The upgrade process may replace the bin directory and subdirectories with a newer version of SAP Commerce and remove your changes.
回到目录
系统最低需求
默认的数据库:HSQLDB
第三方软件需求
如何安装
SAP Commerce 1905 requires JDK 11 or later. It is fully compatible with SAP Machine 11.
如何下载安装包
Navigate to the <${HYBRIS_BIN_DIR}> /platform directory, call ant clean all to build the entire SAP Commerce solution.
the web folder contains both the src and the webroot subdirectories. After putting all the components you want to add into the proper folders, you need to run the following command on your system: ant build.
from jalo to service layer - migration and transition
after save event hook
startup tuning
disable JUnit tenant
suspend and resume
test with junit
mockito
China Accelerator
也是由一系列Extension组成。
用Eclipse搭环境
一定在build之后再导入import,否则报class找不到。
SAP Commerce(SAP Hybris)学习资料汇总
和persistence layer是松耦合的。
所有功能都通过service暴露:
Business Services implement business use cases, such as cart handling or back order.
Infrastructure Services provide the underlying technical foundation, such as internationalization, import, export, and so on.
System services provide functionality required by the ServiceLayer, such as model handling and session handling.
其实就是interface,通过models和其他service交互。
Strategy
A service may delegate parts of its tasks to smaller micro-services, called strategies. The service then serves as a kind of façade to the strategies.
Clients still use the service and its stable API. But under the hood the functionality is split into multiple parts. Because these parts are smaller and very focused to their task, it is easier to adapt or replace them. Strategies therefore help to further encapsulate behavior and make it more adaptable.
其实就是策略模式。
Models are a new way to represent SAP Commerce items. Each model contains all item attributes from all extensions thus unifying access to an item’s data. Models are generated from the type system of SAP Commerce.
Models are used by DAOs, services, strategies, converters, and facades.
@SystemSetup(extension = MyExtension.EXTENSIONNAME)
public class SomeClass ... {
@SystemSetup(extension = MyExtension.EXTENSIONNAME, process = Process.INIT, type = Type.ESSENTIAL)
public void createImportantModelDuringInitProcess(){
//create the model here
}
...
接收和发送commerce的事件。
event-service基于Spring event系统。
DefaultEventService allows you to register event listeners and publish events.
There is a DefaultEventService that implements the EventService interface (de.hybris.platform.servicelayer.event package). To use this service, add a Spring resource to your class.
@Resource
private EventService eventService;
SAP Commerce(SAP Hybris)学习资料汇总
类型系统是对象的模板。platform里每个对象都是类型的实例。
Types定义了持久化对象:
Attribute存储对象的数据。
Deployment定义数据库表
java class
A Type is the type definition in items.xml and its Java implementation.
SAP Commerce(SAP Hybris)学习资料汇总
SAP Commerce(SAP Hybris)学习资料汇总
SAP Commerce(SAP Hybris)学习资料汇总
SAP Commerce(SAP Hybris)学习资料汇总
provides a range of features related to the main functionality of a SAP Commerce installation, that is, containerization, data management, synchronization, security, or localization.
data validation - before save: a JSR 303-compliant validation engine
digital asset management
filter for web application 一些常用filter列表:SessionFilter, ProfileFilter, Log4jFilter, RedirectWhenSystemIsNotInitializedFilter.
value change log
log
media - 文件系统上的文件。
SAP Commerce(SAP Hybris)学习资料汇总
[Product classification](The classification functionality enables you to define product attributes in a way different to the typing method. Classification-based attributes are called category features; they can also sometimes referred to classification attributes. Through classification, you can flexibly allocate category features that may change frequently. You can easily define and modify them because you manage them independently of the product type.)
classification - 另一套分类系统?
scripting engine
security
permission
cors support
SSO
User UML
strict mode严格模式
Suspend and resume
Workflow
SAP Commerce(SAP Hybris)学习资料汇总
extension列表:
catalog
commons: provides core helper methods for templates. These methods are used for media neutral handling of content to be exported.
formatter: converting item content to PDF, for example for converting an order to PDF.
Translator framework mainly used for converting of HTML documents to another format, for example to Adobe InDesign.
core extension: handles basic functionality such as persistence handling, the ordering process and contains the service layer functionality.
deliveryzone: ext下面。
hac. 可以只启动hac.
SAP Commerce(SAP Hybris)学习资料汇总
payment standard
platform services: forms a part of the SAP Commerce ServiceLayer and comprises the functional and business services.
processing: The CronJob Service, The Task Service, and the Process Engine.
tomcatembeddedserver : provides an API to run an embedded servlet container. The tomcatembeddedserver extension provides a Tomcat-based implementation of this API.
validation
ydocumentcart : template extension, allows you to store selected types in an alternative storage. It uses the polyglot persistence query language.
yempty: a predefined extension to be duplicated. The copy serves as starting point for creating a new extension, typically used for customer specific implementations. 还有yvoid.
Abstract Jalo Layer classes (carrying a prefix, such as Generated). These files are generated anew if you have modified the items.xml for the extension
Non-abstract Jalo Layer classes. These are only generated when the file does not yet exist. If a file with the same name exists, the file is not generated anew.
The europe1 extension handles all price, tax, and discount calculations in SAP Commerce.
Extensible Cart Calculation
Payment Transaction and Delivery Mode Handling
SAP Commerce(SAP Hybris)学习资料汇总
通过velocity script,一个template生成source code.
There are two default global templates to render beans and enums. These templates are used if there is no custom template defined for a specific bean or enum in the beans.xml file, or if a given template does not exist. The default templates are:
global-beantemplate.vm - for each bean
global-enumtemplate.vm - for each enum
SAP Commerce(SAP Hybris)学习资料汇总
service layer和jalo layer都和items.xml有关。
items.xml在Eclipse里修改之后立即生效的问题:
SAP Commerce comes with preconfigured builders for the Eclipse IDEInformation published on non-SAP site that support working with the items.xml file. Using Eclipse, whenever you edit an items.xml file, SAP Commerce automatically:
Jalo Layer: Generates Generated*.java source files (item classes) for all item types of your extension to the gensrc directory of your extension.
Jalo Layer: Refreshes the gensrc directory of your extension.
ServiceLayer: Generates *Model.java source files (model classes) for all item types of configured extensions to the bootstrap/gensrc directory
ServiceLayer: Refreshes the bootstrap/gensrc directory