SAP Fiori image的顯示原理
Recently I am working on an issue regarding my responsible application and I found out that previously I have wrong understanding on the image handling in CRM Fiori. I share the correct one in this knowledge so that you would not make similar mistake that I made before.
Background
In CRM Fiori application “My Opportunity”, if the account for current Opportunity has maintained image in CRM backend, it will then be displayed in Fiori UI.
How to maintain account Logo in CRM so that it could be displayed in Fiori UI
We have to launch CRM WebUI, upload a new attachment for given account:
This attachment should meet the following criteria, to make sure it could be used as logo for the current account:
(1) it must be an image file ( type JPEG Graphic or other image format ) (2) in property maintenance window, it must be set as default document among all attachments and document type must be BDS_IMAGE.
In the runtime, when you open Fiori UI, it takes two steps to get the image rendered in UI finally. These two steps could just be observed in the Chrome network tab.
Step1 – Fiori UI asks for the image URL from backend
Previously, I consider Fiori UI asked the binary content of image from backend, this is COMPLETELY WRONG! The complete url for the first step: https://:/sap/opu/odata/sap/ZJERRY_DEMO_SRV/AccountCollection(‘4031140’)?$expand=Logo From url we know there is an expand operation on node Logo. Check response in Chrome, there is no image binary source contained in response.
the url contained in Logo node is used as the requested url for the second step, as could be observed in Chrome:
: The complete url returned by first step: https://:/sap/opu/odata/sap/ZJERRY_DEMO_SRV/AttachmentCollection(documentID=‘FA163EEF573D1EE585804C8B6241ABA3′,documentClass=’BDS_POC1′,businessPartnerID=’4031140’)/$value Although it contains an “Attachment” in url, it HAS NOTHING TO DO WITH the tab in Opportunity detail page! It just indicates that the technical storage of account logo is done via CRM Attachment model.
Step2 – bind the url to image field in application
Check the xml binding path for image field in Opportunity detail view: it is bound to ImgSrc in json model.
In application code, it just fills that json model field with url returned by step 1:
And this operation will lead to a delayed re-render later to set the native html property “src” for image field, which is done by framework:
Callstack:
Conclusion
The http request sent in second step is not issued by My Opportunity application, but by browser itself, once an image element is filled with actual url on its “src” property. To simply prove this conclusion: Create a simple html file as below, just paste the url for second step into src property:
<html><img src="https://<hostname>:<port>/sap/opu/odata/sap/ZJERRY_DEMO_SRV/AttachmentCollection(documentID='FA163EEF573D1EE585804C8B6241ABA3',documentClass='BDS_POC1',businessPartnerID='4031140')/$value"></img><html>
Open it in Chrome, and you can observe exactly the same network behavior as when you open the application with an image in Fiori UI:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2718405/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP Fiori應用裡日期格式的顯示奧祕
- SAP Fiori 應用裡圖示(Icon)的渲染原理和使用技巧
- SAP Fiori Elements controller extension 的載入原理Controller
- 使用 SAP Business Application Studio 建立 Fiori Elements 應用顯示 OData 資料APP
- SAP Fiori Elements 應用裡的 Title 顯示的內容是從哪裡來的
- SAP Fiori Elements裡Drop down list的實現原理
- SAP Hybris裡搜尋顯示結果的實現原理
- SAP Fiori @OData.publish 註解的工作原理解析
- vue el-image 顯示圖片Vue
- Flutter-engine 顯示Image邏輯Flutter
- 探索Flutter Image顯示Webp邏輯FlutterWeb
- SAP Fiori + Vue = ?Vue
- SAP Spartacus B2B 頁面 Disable 按鈕的顯示原理
- SAP Fiori 應用 Adapt UI 動態顯示或者隱藏的技術設計細節解析APTUI
- SAP Fiori 註解 @ObjectModel.readOnly工作原理解析Object
- SAP S/4HANA系統Fiori UI上Adapt UI按鈕顯示與否的控制邏輯UIAPT
- SAP Fiori應用索引大全工具和 SAP Fiori Tools 的使用介紹索引
- SAP Spartacus unit detail 頁面顯示後自動 focus 設定的原理AI
- 深入掌握 SAP Fiori Elements 工作原理的前提條件:理解 Smart Field
- 如何分辨 SAP Fiori Launchpad 裡的真假 Fiori 應用
- el-image圖片預覽顯示bug
- SAP CRM Fiori 應用和 SAP 電商雲 UI 如何通過調整CSS來改變UI顯示風格UICSS
- SAP Fiori 簡介
- SAP Fiori Elements 概述
- SAP S/4HANA Material Fiori應用的搜尋實現原理
- SAP Fiori Elements 框架裡 Smart Table 控制元件的工作原理介紹框架控制元件
- SAP Fiori 的 UI 新主題 HorizonUI
- SAP Spartacus B2B 頁面 Disable Confirmation 對話方塊的顯示原理
- 字幕迴圈顯示原理
- 使用 mock 資料在本地執行 SAP Fiori Elements 應用的工作原理Mock
- SAP CRM產品主資料頁面的縮圖顯示設計原理
- SAP CRM Fiori應用和SAP JAM的整合配置
- SAP Fiori Launchpad tile裡顯示的數字的重新整理間隔是在伺服器端什麼地方配置的伺服器
- 學習筆記(十六):ArkUi-顯示圖片 (Image)筆記UI
- weex踩坑之image圖片在ios/Android不顯示iOSAndroid
- SAP Fiori 的學習路線指南
- SAP Fiori 的附件處理(Attachment handling)
- SAP Fiori Launchpad頁面在伺服器端的配置背後的實現原理伺服器