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