hybris安装B2B

Creating a Customized B2B Accelerator with Modulegen

Learn how to use the modulegen tool to create a customized SAP Hybris Commerce B2B Accelerator.

The modulegen tool is delivered with SAP Hybris Commerce and can be used to generate sets of dependent extensions to quickly start new projects or create new applications. The modules shipped with SAP Hybris Commerce help you to meet client requirements from the very beginning by allowing you to generate fully functional applications that can then be customized. The modulegen tool replaces the schema, package name, extension class prefixes, and some other properties across a set of extensions, all while maintaining the relationships between them. The tool is run as an ant task, so it requires the ant libraries to be present on the system.

SAP Hybris Commerce ships with an extension generator tool called extgen, which is short for extension generator. Using the extgen tool, you can create new extensions based on extension templates. With the extgen tool, you can create one new extension using one template extension. The modulegen tool is a wrapper around the extgen tool that allows you to create a set of extensions from a set of template extensions. From a technical perspective, any extension can be used as a template extension. The extgen tool is fairly basic in that it simply replaces the tokens configured in a properties file.

Tip Some extensions only work as a set, such as the majority of the Accelerator extensions. These extensions should be created using the modulegen tool so that you can generate them together as a set. On the other hand, some extensions make sense as stand-alone extensions, and that is when you would use the extgen tool.
For more information about the extgen tool, see Creating a New Extension. Note
This document uses the terms:
  • <HYBRIS_HOME> to refer to the directory where you unzipped the SAP Hybris Commerce package.
  • <COMMON_FOLDER> to refer to the directory where the <HYBRIS_HOME> folder is extracted.
  • <HYBRIS_BIN_DIR> to refer to the directory that contains all the SAP Hybris Commerce extensions, as well as the platform directory.

Prerequisites

Before running the modulegen tool, you need to download the latest version of SAP Hybris Commerce. See DownloadInformation published on SAP site for more details.

Once you have downloaded SAP Hybris Commerce, extract the Hybris Commerce ZIP file in <{COMMON_FOLDER}>.

Tip If you are in a training class, the Hybris Commerce ZIP file will be provided by your trainer.

Creating a Customized B2B Accelerator

The following procedure describes how to create a customized B2B Accelerator using the B2C Accelerator installation recipe.

Note Alternatively, you can use the b2b_acc recipe to install B2B Accelerator, but it offers limited customization. The following procedure has more customization flexibility and uses the b2c_acc recipe as a base, and then adds the required B2B components.
  1. Navigate to the <HYBRIS_HOME>/installer directory.

  2. Invoke the Installer with the b2c_acc recipe by entering the following command:

    • On Windows:install.bat -r b2c_acc
    • On Linux or Mac:./install.sh -r b2c_acc
  3. Navigate to the <HYBRIS_BIN_DIR>/platform directory.

  4. Set yourantenvironment by entering the following command:

    • On Windows:setantenv.bat
    • On Linux or Mac:. ./setantenv.sh
  5. Run theant modulegencommand and modify theinput.nameandinput.packageparameters as required, for example:

    ant modulegen -Dinput.module=accelerator -Dinput.name=training -Dinput.package=de.hybris.training -Dinput.template=develop

    Where:

    • input.moduleparameter: Configures the modulegen task to use the accelerator module.
    • input.namevalue: Indicates the prefix that is added to the new extensions generated by modulegen.
    • input.packagevalue: Defines the default Java package prefix.
    • input.templateparameter: Defines how to use the default Hybris configuration.
    Note Thetrainingvariable can be substituted for any string value.
  6. After running theant modulegencommand, open the localextensions.xml file located in <HYBRIS_HOME>/hybris/config folder.
  7. Add the new extensions generated by modulegen to the localextensions.xml file. The exact XML snippet to add is displayed in your console output. The following is an example:
    trainingcore
    trainingfacades
    trainingstorefront
    traininginitialdata
    trainingtest
    trainingcockpits
    trainingfulfilmentprocess
  8. As instructed in the console output, remove any of the following extensions that might appear in your localextensions.xml file:

    yacceleratorcore
    yacceleratorfacades
    yacceleratorstorefront
    yacceleratorinitialdata
    yacceleratortest
    yacceleratorcockpits
    yacceleratorfulfilmentproces
  9. Add the following B2B Accelerator extensions to the localextensions.xml file:

    <extension name='powertoolsstore' /> <extension name='b2bcommercebackoffice' /> <extension name='b2badmincockpit' /> <extension name='b2bacceleratoraddon' /> <extension name='commerceorgaddon' />
  10. Install the B2B Accelerator AddOns on the training storefront by running the followingantcommands from the <HYBRIS_BIN_DIR>/platform folder:
    ant addoninstall -Daddonnames="b2bacceleratoraddon" -DaddonStorefront.yacceleratorstorefront="trainingstorefront" ant addoninstall -Daddonnames="commerceorgaddon" -DaddonStorefront.yacceleratorstorefront="trainingstorefront"
    Note
    More AddOns can be added to your custom storefront. For each additional AddOn, you must add an entry to the localextentions.xml file and run the correspondingant addoninstallcommand. The extensions most commonly used in advanced B2B Accelerator set-ups include the following:
  11. Add the following properties to <HYBRIS_HOME>/hybris/config/local.properties file:
    website.powertools.http=http://powertools.local:9001/trainingstorefront website.powertools.https=https://powertools.local:9002/trainingstorefront
  12. Build and initialize Hybris Commerce by running the followingantcommand from the <HYBRIS_BIN_DIR>/platform folder:
    ant initialize
  13. Start the Hybris server by running the following command from the <HYBRIS_BIN_DIR>/platform folder:

    • On Windows:hybrisserver.bat
    • On Linux or Mac:./hybrisserver.sh
    Note

    For more options on starting and stopping the Hybris server, see Running SAP Hybris Commerce.

  14. Once the server is started, ensure the B2B Accelerator powertools storefront is working by loading the following URL: https://powertools.local:9002/trainingstorefront/powertools/en/USD.

    For the above URL to work, you must have the following entry in your computer's hosts file:
    127.0.0.1   powertools.local

Configuring the local.properties File for a Different Database

If you do not want to use the default HSQL database that is shipped with the SAP Hybris Commerce, you can set up a different database.

For example, to set up a MySQL database, add the following properties to the local.properties file:

db.url=jdbc:mysql://localhost/training?useConfigs=maxPerformance&characterEncoding=utf8 db.driver=com.mysql.jdbc.Driver db.username=your_username db.password=your_password db.tableprefix= mysql.optional.tabledefs=CHARSET=utf8 COLLATE=utf8_bin mysql.tabletype=InnoDB

Note that the MySQL JDBC driver is not included with Hybris Commerce. The driver can be downloaded from this MySQL page: http://dev.mysql.com/downloads/connector/j/Information published on non-SAP site.

Once you have downloaded the driver, unpack and copy the mysql-connector-java-X.X.XX-bin.jar file to the <{HYBRIS_HOME}>/hybris/bin/platform/lib/dbdriver folder.

转载于:https://www.cnblogs.com/wahaha603/p/7878399.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值