关于 SAP Spartacus 和 SmartEdit 集成的问题

简介: 关于 SAP Spartacus 和 SmartEdit 集成的问题

Spartacus 里打不开 smartEdit:


We have added context path in manifest.xml for Smartedit, however we cannot open smartedit with any of the url for Spartacus:


https://jsapps.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com/smartedit

https://smartedit.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com/

Is there any specific configuration we need to do in CCV2 or elsewhere?


image.pngI would like to inform that after checking provided manifest file, I can see that you have deployed your Smartedit under accstorefront aspect so Smartedit should be accessed under https://accstorefront.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com


Regarding putting only Smartedit webapp under backoffice aspect, this is incorrect approach as you should put all Smartedit under aspect to make it work.


Regarding Smartedit working with Spartacus, you cannot run Smartedit under JS Storefront url. In order to setup Smartedit with Spartacus, please refer to following documentation:


https://help.sap.com/viewer/e1391e5265574bfbb56ca4c0573ba1dc/v2005/en-US/a7d68ea9820c4e16962797298cd8499b.html


https://sap.github.io/spartacus-docs/smartEdit-setup-instructions-for-spartacus/#page-title


客户新一轮的问题:


====


We have managed to configure SmartEdit in ccv2 and it is currently working with our Spartacus Storefront. You can see this in https://api.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com/smartedit


新的问题:


The problem we are facing is that SmartEdit is not allowing us to Create, Edit or Update. 只能使用 preview 模式浏览。


新一轮的 check:


====


After checking your storefront i have found the issue in browser console ither in Smartedit and when accessing your Spartacus storefront directly:


"Allowed whitelist characters are a-z, A-Z, 0-9, -, period, or *


The wildcard * can be used to represent a prefixed domain, Good example: *.domain.com:80


but not a suffix or port, Bad examples: subdomain..com subdomain.domain.com:.


Every whitelisting must contain a specific port."


After checking your storefront I can see that you have set property data-smartedit-allow-origin=“https://jsapps.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com


However, according to documentation you should specify domain on which smartedit is deployed without prefix https:// and with port number at the end.


Please set it to: api.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com:443


For more info please refer to following documentation pages Smartedit setup for Spartacus


Cross origin setup for Smartedit


image.pngimage.pngimage.pngimage.pngimage.png进一步检查

使用 smart edit 访问 Storefront 时有一些 warning:


spartacus-storefront.js:14147 No component implementation found for the CMS component type ‘NavigationBarCollectionComponent’. Make sure you implement a component and register it in the mapper.


spartacus-storefront.js:14147 No component implementation found for the CMS component type ‘FooterComponent’. Make sure you implement a component and register it in the mapper.


No component implementation found for the CMS component type ‘AssistedServiceComponent’. Make sure you implement a component and register it in the mapper.


Missing SmartEdit attributes on body element of the storefront - SmartEdit will resume once the attributes are added


image.pngThe last one usually occurs when smartedit is not installed correctly, after checking your storefront there are no Smartedit classes in it. Please make sure that you setup Smartedit with spartacussampledata for Spartacus according to this documentation


特征

For some reason there are no Smartedit classes injected into body tag.


说明如果 smart edit setup 成功,我们应该可以在 body 元素里看到对应的 class.


Please refer to following documentation page describing in details how Smartedit Contract is implemented and make sure you do the same for your Storefront.


再次研究

Dear Customer,


I tried to go to smartedit with provided URL again 但是只看到下列画面:


image.pngin webapplicationInjector tag, instead of:


..model-t.cc.commerce.ondemand.com:443


try to put the whole url of api


like:


api.c013j-comercial1-d1-public.model-t.cc.commerce.ondemand.com:443


Also I tried to access jsstorefront from


https://jsapps.xxx-comercial1-d1-public.model-t.cc.commerce.ondemand.com/


but it only give me blank page instead of the storefront.


新的发现

主要原因:somehow body classes are not added in preview as we saw on call.


https://sap.github.io/spartacus-docs/smartEdit-setup-instructions-for-spartacus/


specifically step 3 as ading webApplicationInjector.js in angular.json file


Also when you built your spartacus storefront, follow all the steps described below:


https://sap.github.io/spartacus-docs/building-the-spartacus-storefront-from-libraries/


本地实验

I have installed OOTB spartacus storefront in my ccv2 environment and smartedit is working fine with it.


Attaching New.zip for your reference.


manifest.json is at \New\hybris\core-customize and localExtensions.xml is at \New\hybris\core-customize\hybris\config


Please try to install OOTB in ccv2 and check the differences.


Dear Customer,


As discussed on call, can you please try to add spartacussampledata extension and check if the OOTB electronic storefront is working with smartedit


小技巧:首先检查标准的 electronic Storefront 和 smartEdit 是否工作正常。


回复:


image.png根据部署的 aspect 不同, smartEdit 访问的 url 也不同。


Dear Customer,Did you tried locally with spartacusSampleData extension?


and also did you try the same in ccv2 to include OOTB electonics spartacus storefront?


To enable smartedit in this spartacus project, please follow 这个帮助文档 according to your spartacus storefront version.


另一个错误截图:


image.png

相关文章
|
3月前
|
机器学习/深度学习 人工智能 监控
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
70 0
|
4月前
|
JSON 开发者 数据格式
关于 SAP Spartacus LandingPage2Template 区域的 layout 设计实现
关于 SAP Spartacus LandingPage2Template 区域的 layout 设计实现
26 0
|
4月前
|
搜索推荐 开发者 UED
关于 SAP Spartacus 层的 UI 设计
关于 SAP Spartacus 层的 UI 设计
42 0
|
4月前
|
开发者 UED
SAP Spartacus BREAKPOINT 枚举类型在 Spartacus layout 实现中的作用
SAP Spartacus BREAKPOINT 枚举类型在 Spartacus layout 实现中的作用
25 0
|
6月前
|
数据管理 API
什么是 SAP Commerce Cloud 集成扩展包
什么是 SAP Commerce Cloud 集成扩展包
25 1
|
7月前
|
JavaScript 安全 前端开发
Spartacus 如何动态将 SmartEdit attribute 添加到 DOM 里,单步调试
Spartacus 如何动态将 SmartEdit attribute 添加到 DOM 里,单步调试
24 0
|
7月前
|
前端开发 搜索推荐 JavaScript
什么是 SAP Spartacus 的 CMS Page Connector
什么是 SAP Spartacus 的 CMS Page Connector
47 0
|
7月前
|
JavaScript 容器
关于 SAP Spartacus generic-link component 的模板代码
关于 SAP Spartacus generic-link component 的模板代码
42 2
|
14天前
|
前端开发 Java 应用服务中间件
从零手写实现 tomcat-08-tomcat 如何与 springboot 集成?
该文是一系列关于从零开始手写实现 Apache Tomcat 的教程概述。作者希望通过亲自动手实践理解 Tomcat 的核心机制。文章讨论了 Spring Boot 如何实现直接通过 `main` 方法启动,Spring 与 Tomcat 容器的集成方式,以及两者生命周期的同步原理。文中还提出了实现 Tomcat 的启发,强调在设计启动流程时确保资源的正确加载和初始化。最后提到了一个名为 mini-cat(嗅虎)的简易 Tomcat 实现项目,开源于 [GitHub](https://github.com/houbb/minicat)。
|
1月前
|
消息中间件 Java Kafka
Springboot集成高低版本kafka
Springboot集成高低版本kafka