【问题标题】:Custom commercewebservices with the new extension in Hybris-Spartacus project在 Hybris-Spartacus 项目中具有新扩展的自定义 commercewebservices
【发布时间】:2020-12-01 13:35:54
【问题描述】:

我们希望将 Spartacus 框架与 2005 版 Sap Commerce Cloud (Hybris) 一起使用。 有一个已在使用的自定义 commercewebservices(从 ycommercewebservices 创建)扩展。 我们不想碰它。

根据以下文档,以下是 2005 版的步骤。

https://help.sap.com/viewer/9d346683b0084da2938be8a285c0c27a/2005/en-US/d46d19516961438f8939718e87ed787b.html

1) 从 yocc 创建一个新的自定义扩展。我们称之为 xxxocc。

xxxocc 需要带有 webcontext /occ 的 commercewebservices

2) xxxocc 应该要求开箱即用 (OOTB) cmsocc 以获取 Spartacus 的 cms 页面和组件信息。

cmsocc 需要带有 webcontext /occ 的 commercewebservices。

当前的自定义 commercewebservices 有自己的 commercewebservices 设置,带有 webcontext /rest。

从 yocc(xxxocc) 创建新的扩展后,自定义 commercewebservices 与新的有很多冲突。 (commerceStockFacade、安全设置、contextInformationLoader 等)

我们可以努力解决这些问题,但是在 xxxocc 扩展中需要 cmsocc 后,同样的错误将再次发生,因为 cmsocc 也有自己的 commercewebservices,并且如果不制作 cmsocc 扩展就无法解决问题像 xxxcmsocc 这样的自定义扩展。

在项目中使用当前 commercewebservices 和新扩展的最佳方法应该是什么?

【问题讨论】:

    标签: java hybris spartacus-storefront


    【解决方案1】:

    您只需在自定义 ws 扩展中安装 occaddon, 首先我向您推荐,使用 ant modulegen 工具

    ycommercewebservices 模板创建您的 customwebservices 扩展

    第二次将 occaddon 安装到您的 customwebservices 扩展中

    ant addoninstall -Daddonnames="cmsoccaddon" -DaddonStorefront.ycommercewebservices="customwebservices"
    

    记得在你的 localextensions

    中列出 cmsoccaddon

    最后,执行ant clean all并启动你的服务器,你应该可以看到没有冲突的cms端点,

    问候。

    【讨论】:

    • 在自定义 WS 上安装 cmsoccaddon 后 /page 出现以下错误。 /component 正在寻找。在尝试以下映射时: sourceType = de.hybris.platform.cmsfacades.data.PageContentSlotData sourceProperty = slotShared(boolean) destinationType = java.util.ArrayList destinationProperty = 8(ContentSlotWsDTO) 发生错误:ma.glasnost.orika.MappingException:遇到基元到对象的映射(或反之亦然); sourceType=boolean,destinationType=ContentSlotWsDTO
    猜你喜欢
    • 1970-01-01
    • 2019-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多