当前位置:网站首页>SAP Spartacus home 页面读取 product 数据的请求的 population 逻辑
SAP Spartacus home 页面读取 product 数据的请求的 population 逻辑
2022-07-06 00:35:00 【汪子熙】
Spartacus是一个开源的JavaScript web应用程序,允许您快速创建自己的基于JavaScript的SAP商务云店面。Spartacus是用Angular编写的,并以库的形式发布。使用Spartacus的推荐方法是构建自己的JavaScript web应用程序并导入库。无需修改,店面就能开箱工作,但 Spartacus 被设计为可升级、可定制和可扩展的,以满足您所有的品牌和功能需求。
入口:occ-product.adapter.ts~loadMany 方法:
拼装 url 输入参数就是:productCode 这个键值对,参数名称为 productCode,值为实际的产品 code,比如 358639:
同时,product 数据请求的 url,根据 productCode 值(动态),插入一个字符串模板构成的,这个字符串模板实际就是 product API 的 endpoint, 定义在 this.config.backend.occ.endpoints 里。下图是 product
相关的 OCC API endpoint:
上图配置的数据源,实际上硬编码在这个文件 projects\core\src\occ\adapters\product\default-occ-product-config.ts
里:
从调试器里能看出,Spartacus home 页面发起的 product 数据请求,scope 为 list,
故 url pattern 从 list
这个记录里取出,${productCode}
在运行时会被其实际值 358639
替换。
最后就成了下图:
为了保持我们对可升级性的承诺,Spartacus的设计模式是将非核心特性构建为添加或更改所提供功能的特性库(feature libraries)。
在使用Spartacus时,需要构建一个应用程序,它将引入Spartacus库,其中包含使用SAP Commerce Cloud所需的核心资源。然后构建包含任何自定义功能和页面的新特性。
Spartacus页面的内容是从SAP Commerce Cloud CMS(内容管理系统)获取的,比如徽标、链接、横幅和静态页面。SAP 建议新的内容驱动特性遵循相同的模式,使Content manager能够通过CMS工具修改页面内容。
边栏推荐
- Go learning --- structure to map[string]interface{}
- Uniapp development, packaged as H5 and deployed to the server
- Basic introduction and source code analysis of webrtc threads
- Pointer pointer array, array pointer
- [groovy] JSON string deserialization (use jsonslurper to deserialize JSON strings | construct related classes according to the map set)
- Leetcode 450 deleting nodes in a binary search tree
- 免费的聊天机器人API
- Arduino hexapod robot
- Free chat robot API
- FFmpeg抓取RTSP图像进行图像分析
猜你喜欢
剖面测量之提取剖面数据
MDK debug时设置数据实时更新
Multithreading and high concurrency (8) -- summarize AQS shared lock from countdownlatch (punch in for the third anniversary)
如何解决ecology9.0执行导入流程流程产生的问题
[designmode] composite mode
Data analysis thinking analysis methods and business knowledge -- analysis methods (II)
Idea remotely submits spark tasks to the yarn cluster
时间戳的拓展及应用实例
Comment faire votre propre robot
Spark SQL null value, Nan judgment and processing
随机推荐
LeetCode 1598. Folder operation log collector
curlpost-php
图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
Global and Chinese market of digital serial inverter 2022-2028: Research Report on technology, participants, trends, market size and share
Key structure of ffmpeg - avframe
建立时间和保持时间的模型分析
XML配置文件
notepad++正则表达式替换字符串
Solve the problem of reading Chinese garbled code in sqlserver connection database
如何制作自己的機器人
Extension and application of timestamp
Spark AQE
An understanding of & array names
MySql——CRUD
Room cannot create an SQLite connection to verify the queries
Start from the bottom structure and learn the introduction of fpga---fifo IP core and its key parameters
Notepad++ regular expression replacement string
LeetCode 斐波那契序列
[groovy] JSON serialization (convert class objects to JSON strings | convert using jsonbuilder | convert using jsonoutput | format JSON strings for output)
KDD 2022 | 脑电AI助力癫痫疾病诊断