zl程序教程

您现在的位置是:首页 >  其他

当前栏目

我的SAP Hybris学习笔记

2023-09-14 09:03:00 时间

问题

Hybris 产品的开发性平台怎么样,是否可以快速响应用户需求?

回答

Hybris 后台基于 Java Spring,因此开发性和扩展性极佳。采用 Spring 的依赖注入和控制反转思想,可以在不修改 Hybris 源代码的基础上,对其进行增强,以快速响应用户需求。

拥有 Java 和 Spring 开发基础的 developer,经过短时间培训即可上手 Hybris 的开发工作。

我之前总结的一些和 SAP Commerce Cloud 开发的链接:

Installation guide

The install guide: https://help.hybris.com/6.5.0/hcd/8c46c266866910149666a0fe4caeee4e.html
具体就几个命令:<recipe_name> 可以先用B2C_ACC

  • install.bat -r b2c_acc

  • install.bat -r b2c_acc initialize

  • install.bat -r b2c_acc start
    use -r -s -d for issue trace.

  • https://localhost:9002 admin console - devops

  • https://localhost:9002/backoffice - admin

  • https://localhost:9002/yacceleratorstorefront?site=electronics

Document

  • Help doc - trails: https://help.hybris.com/6.5.0/hcd/a1ef894ac89545e79c470c726b487d13.html

Tips

The general rule is that if a ${HYBRIS_CONFIG_DIR} /localextensions.xml exists, it overrides the ${HYBRIS_BIN_DIR} /extensions.xml file. If you make any changes in the localextensions.xml, you need to rebuild Hybris Commerce:

  • Navigate to the ${HYBRIS_BIN_DIR} /platform directory.
  • Call ant clean all to build Hybris Commerce.

最近发现了另一个属性,会一定程度提升启动速度,因为这样只有master tenant会启动,junit tenant不会启动。
“installed.tenants=”

wiki还提了几个方法,但是尝试后都不是很明显
in case license is invalid:

  • ant clean all
  • ant initialize

Chengdu development

  • bitbucket里的module(”chinaacceleratoraddons“) 和打包没有直接关系,打包是每个module里的pom.xml控制的
    具体打到哪个文件要针对每个extension定义一个pom的property:

module可以理解为只和package有关系,是用来打包放进现在的hybris commerce suite的,没有业务上的意义。当然现在acc-2主要是一些可能会进其他global team的recipe的extension, chinaacceleratoraddons主要是一些china的定制extension。

  • ext-accelerator 是core accelerator就是平台的acc team用的,里面确实有一些china开头的extension,我们叫老cnacc,是我们接手以前上海team做的一个老版的中国acc,现在已经deprecate掉了。所以ext-accelerator我们team没有在用了

  • hmc已经deprecate掉了

  • jalo实际上现在还在使用,包括addon/extension扔使用例如“…\hybris\bin\platform\ext\core\resources\core-items.xml"去generate,在extension里会生成jalo文件夹,包含一些相关的manager之类的框架需要的类。但是一般不会release在product里,因为编译以后这些jalo类会重新生成

  • recipe对于customer是没有很大意义的。因为里面包含很多比如aplipay mock之类的仅用于demo和showcase用途的extension. customer安装肯定会根据他们具体需要选择extension和addon

Hybris的data model分为两个部分:

  • 对内各种ItemModel
  • 对外各种DTO

Accelerator

SAP Commerce Accelerator is delivered completely as source code. You can edit the source code directly, but your project would probably prefer some kind of project-specific package naming. With the modulegen functionality, you can quickly generate a complete set of Accelerator extensions. Use modulegen to generate copies of the Accelerator extensions, using your project’s naming conventions.

Accelerator完全通过源代码的方式deliver给客户,可以使用modulegen快速生成一套Accelerator extensions,然后在这些copied extensions上进行二次开发。

官网地址