当前位置:网站首页>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 .
边栏推荐
- Arduino六足机器人
- Curlpost PHP
- MIT doctoral thesis | robust and reliable intelligent system using neural symbol learning
- Problems and solutions of converting date into specified string in date class
- 【线上小工具】开发过程中会用到的线上小工具合集
- [groovy] compile time metaprogramming (compile time method injection | method injection using buildfromspec, buildfromstring, buildfromcode)
- curlpost-php
- Getting started with devkit
- Leetcode 44 Wildcard matching (2022.02.13)
- Classic CTF topic about FTP protocol
猜你喜欢
OpenCV经典100题
MobileNet系列(5):使用pytorch搭建MobileNetV3并基于迁移学习训练
KDD 2022 | EEG AI helps diagnose epilepsy
Extension and application of timestamp
Idea remotely submits spark tasks to the yarn cluster
Intranet Security Learning (V) -- domain horizontal: SPN & RDP & Cobalt strike
数据分析思维分析方法和业务知识——分析方法(三)
Notepad + + regular expression replace String
Ffmpeg captures RTSP images for image analysis
Common API classes and exception systems
随机推荐
FPGA内部硬件结构与代码的关系
Illustrated network: the principle behind TCP three-time handshake, why can't two-time handshake?
golang mqtt/stomp/nats/amqp
Extension and application of timestamp
curlpost-php
FFmpeg抓取RTSP图像进行图像分析
Classic CTF topic about FTP protocol
Pointer pointer array, array pointer
Calculate sha256 value of data or file based on crypto++
cf:H. Maximal AND【位运算练习 + k次操作 + 最大And】
Folding and sinking sand -- weekly record of ETF
Arduino hexapod robot
Go learning --- read INI file
Spark-SQL UDF函数
XML Configuration File
NLP generation model 2017: Why are those in transformer
[groovy] XML serialization (use markupbuilder to generate XML data | create sub tags under tag closures | use markupbuilderhelper to add XML comments)
可恢复保险丝特性测试
新手入门深度学习 | 3-6:优化器optimizers
Study diary: February 13, 2022