Adobe建議對需要以單頁應用程式框架為基礎的使用者端轉譯(例如React)的專案使用SPA編輯器。 深入了解.
Adobe Experience Manager (AEM)內容可透過以下方式輕鬆呈現: Sling預設Servlet 要轉譯 JSON 和其他格式。
這些現成可用的轉譯器通常會導覽存放庫並依原樣傳回內容。
AEM也透過Sling支援開發和部署自訂Sling轉譯器,以完全控制轉譯的結構描述和內容。
Content Services Default Renderer可填補現成可用的Sling Defaults和自訂開發之間的空白,以便在不開發的情況下自訂和控制呈現內容的許多方面。
下圖顯示內容服務的呈現方式。
使用 <resource.caas span="" id="1" translate="no" />.[<export-config span="" id="0" translate="no" />.][<export-config span="" id="0" translate="no" />.json 以請求JSON。]
資源 | /content/entities下的實體資源 或 /content下的內容資源 |
EXPORT-CONFIG | 可選 在/apps/mobileapps/caas/exportConfigs/EXPORT-CONFIG下找到的匯出設定 |
DEPTH-INT | 可選 呈現子項的深度遞回,如Sling呈現中所用 |
可建立匯出設定來自訂JSON轉譯。
您可以在下方建立設定節點 /apps/mobileapps/caas/exportConfigs。
節點名稱 | 設定的名稱(用於呈現選擇器) |
---|---|
jcr:primaryType | nt:unstructured |
下表顯示「匯出設定」的特性:
名稱 | 類型 | 預設(如果,未設定) | 值 | 說明 |
includeComponents | 字串[] | 包含所有內容 | sling:resourceType | 從JSON匯出排除具有指定sling:resourceType的節點的詳細資料 |
excludecomponents | 字串[] | 不排除任何專案 | sling:resourceType | 僅包含具有來自JSON匯出的指定sling:resourceType的節點的詳細資料 |
excludePropertyPrefixes | 字串[] | 不排除任何專案 | 屬性首碼 | 從JSON匯出排除以指定首碼開頭的屬性 |
excludeproperties | 字串[] | 不排除任何專案 | 屬性名稱 | 從JSON匯出排除指定的屬性 |
includeproperties | 字串[] | 包含所有內容 | 屬性名稱 | 如果設定了excludePropertyPrefixes 否則(排除忽略的屬性)只會包含這些屬性 |
includeChildren | 字串[] | 包含所有內容 | 子名稱 | 從JSON匯出排除指定的子系 |
excludeChildren | String[] |
不排除任何專案 | 子名稱 | 從JSON匯出僅包含指定的子項,排除其他 |
renameProperties | String[] |
不重新命名任何內容 | <actual_property_name>,<replacement_property_name> | 使用取代物重新命名屬性 |
在下建立設定節點 /apps/mobileapps/caas/exportConfigs。
名稱 | resourceTypeOverrides |
---|---|
jcr:primaryType | nt:unstructured |
下表顯示特性:
名稱 | 類型 | 預設(如果,未設定) | 值 | 說明 |
<SELECTOR_TO_INC> | 字串[] | - | sling:resourceType | 對於以下sling資源型別,請勿傳回預設的CaaS json匯出。 將資源呈現為,以傳回客戶json匯出; <resource>.<selector_to_inc>.json |
Content Services包含兩個匯出設定:
如果在請求的URI中指定了配置,則會套用Content Services預設匯出配置。
<resource>.caas[.<depth-int>].json
名稱 | 值 |
excludeproperties | |
excludePropertyPrefixes | jcr:,sling:,cq:,oak:,pge- |
includeproperties | jcr:text,text jcr:title,title jcr:description,description jcr:lastModified,lastModified cq:tags,tags cq:lastModified,lastModified |
includeComponents | |
excludecomponents | |
includeChildren | |
excludeChildren | |
Sling JSON覆寫 | foundation/components/image wcm/foundation/components/image mobileapps/caas/components/data/contentReference mobileapps/caas/components/data/assetlist |
此設定會擴充預設值,以包含子節點下的群組子項。
<site_page>.caas.page[.<depth-int>].json
請參閱下列資源,瞭解內容服務中的其他主題: