当前位置:网站首页>The population logic of the request to read product data on the sap Spartacus home page
The population logic of the request to read product data on the sap Spartacus home page
2022-07-06 00:45:00 【Wang Zixi】
Spartacus It's an open source JavaScript web Applications , Allows you to quickly create your own based on JavaScript Of SAP Business cloud store .Spartacus Yes, it is Angular Compiling , And publish in the form of Library . Use Spartacus The recommended method is to build your own JavaScript web Import and store the application . There is no need to modify , The storefront can open the box and work , but Spartacus Designed to be upgradeable 、 Customizable and extensible , To meet all your brand and functional needs .
entrance :occ-product.adapter.ts~loadMany Method :
assemble url The input parameter is :productCode This key is right , The parameter name is productCode, The value is the actual product code, such as 358639:
meanwhile ,product Data requested url, according to productCode value ( dynamic ), Insert a string template , This string template is actually product API Of endpoint, It's defined in this.config.backend.occ.endpoints in . The picture below is product
dependent OCC API endpoint:
The data source configured in the figure above , Actually hard coded in this file projects\core\src\occ\adapters\product\default-occ-product-config.ts
in :
You can see from the debugger ,Spartacus home Page initiated product Data request ,scope by list,
so url pattern from list
From this record ,${productCode}
At run time, the actual value will be 358639
Replace .
Finally, it becomes the following figure :
In order to maintain our commitment to scalability ,Spartacus The design pattern of is to build non core features into feature libraries that add or change the functions provided (feature libraries).
In the use of Spartacus when , You need to build an application , It will introduce Spartacus library , It includes the use of SAP Commerce Cloud Core resources needed . Then build new features that include any custom functions and pages .
Spartacus The content of the page is from SAP Commerce Cloud CMS( Content management system ) Acquired , Like logos 、 link 、 Banners and static pages .SAP It is suggested that the new content driven features follow the same pattern , send Content manager Can pass CMS Tools modify page content .
边栏推荐
- [groovy] JSON serialization (convert class objects to JSON strings | convert using jsonbuilder | convert using jsonoutput | format JSON strings for output)
- MYSQL GROUP_ The concat function realizes the content merging of the same ID
- MySQL storage engine
- Kotlin core programming - algebraic data types and pattern matching (3)
- Idea remotely submits spark tasks to the yarn cluster
- 新手入门深度学习 | 3-6:优化器optimizers
- 《强化学习周刊》第52期:Depth-CUPRL、DistSPECTRL & Double Deep Q-Network
- STM32 configuration after chip replacement and possible errors
- 电机的简介
- Leetcode 44 Wildcard matching (2022.02.13)
猜你喜欢
Common API classes and exception systems
图解网络:TCP三次握手背后的原理,为啥两次握手不可以?
Arduino六足机器人
如何利用Flutter框架开发运行小程序
Intensive learning weekly, issue 52: depth cuprl, distspectrl & double deep q-network
MCU realizes OTA online upgrade process through UART
Problems and solutions of converting date into specified string in date class
MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练
For a deadline, the IT fellow graduated from Tsinghua suddenly died on the toilet
Calculate sha256 value of data or file based on crypto++
随机推荐
Novice entry depth learning | 3-6: optimizer optimizers
Pointer pointer array, array pointer
Room cannot create an SQLite connection to verify the queries
Getting started with devkit
如何制作自己的机器人
MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning
Spark DF增加一列
Power Query数据格式的转换、拆分合并提取、删除重复项、删除错误、转置与反转、透视和逆透视
[groovy] JSON serialization (jsonbuilder builder | generates JSON string with root node name | generates JSON string without root node name)
Search (DFS and BFS)
Reading notes of the beauty of programming
详细页返回列表保留原来滚动条所在位置
Browser reflow and redraw
Spark AQE
curlpost-php
新手入门深度学习 | 3-6:优化器optimizers
Spark DF adds a column
Extension and application of timestamp
免费的聊天机器人API
The detailed page returns to the list and retains the original position of the scroll bar