呈現和傳遞 rendering-and-delivery

NOTE
Adobe建議針對需要以單頁應用程式框架為基礎的使用者端轉譯(例如React)的專案,使用SPA編輯器。 深入了解

Adobe Experience Manager (AEM)內容可透過以下方式輕鬆轉譯: Sling預設Servlet 要轉譯 JSON 和其他格式。

這些現成可用的轉譯通常會在存放庫中移動並按原樣傳回內容。

AEM也透過Sling支援開發和部署自訂Sling轉譯器,以完全控制轉譯的結構與內容。

Content Services Default Renderer可填補現成Sling預設和自訂開發之間的空白,讓您無需開發即可自訂和控制呈現內容的許多方面。

下圖顯示內容服務的轉譯。

chlimage_1-15

請求JSON requesting-json

使用 <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下找到的匯出設定

如果省略,則會套用預設匯出設定

深度 — 整數
可選

呈現子項的深度遞回,如Sling呈現中所用

建立匯出設定 creating-export-configs

可建立匯出設定來自訂JSON演算。

您可以在下方建立設定節點 /apps/mobileapps/caas/exportConfigs.

節點名稱
設定的名稱(用於呈現選擇器)
jcr:primaryType
nt:unstructured

下表顯示「匯出設定」的特性:

名稱
類型
預設(如果,未設定)
說明
includeComponents
String[]
包含所有內容
sling:resourceType
從JSON匯出排除具有指定sling:resourceType的節點的詳細資料
excludeComponents
String[]
不排除任何專案
sling:resourceType
僅包含具有來自JSON匯出之指定sling:resourceType的節點的詳細資料
excludePropertyPrefix
String[]
不排除任何專案
屬性首碼
從JSON匯出排除以指定首碼開頭的屬性
excludeproperties
String[]
不排除任何專案
屬性名稱
從JSON匯出排除指定的屬性
includeProperties
String[]
包含所有內容
屬性名稱

如果設定了excludePropertyPrefixes
這包括指定的屬性,儘管前置詞已被排除,

否則(忽略排除屬性)僅包含這些屬性

includeChildren
String[]
包含所有內容
子名稱
從JSON匯出排除指定的子系
excludeChildren
String[]
不排除任何專案
子名稱
從JSON匯出僅包含指定的子項,排除其他
renameProperties
String[]
不重新命名任何專案
<actual_property_name>,<replacement_property_name>
使用取代重新命名屬性

資源型別匯出覆寫 resource-type-export-overrides

在下建立設定節點 /apps/mobileapps/caas/exportConfigs.

名稱
resourceTypeOverrides
jcr:primaryType
nt:unstructured

下表顯示特性:

名稱
類型
預設(如果,未設定)
說明
<SELECTOR_TO_INC>
String[]
-
sling:resourceType
對於下列sling資源型別,請勿傳回預設的CaaS json匯出。
將資源轉譯為,以傳回客戶json匯出;
<resource>.<selector_to_inc>.json

現有的Content Services匯出設定 existing-content-services-export-configs

Content Services包含兩個匯出設定:

  • 預設(未指定設定)
  • 頁面(轉譯網站頁面)

預設匯出設定 default-export-configuration

如果在要求的URI中指定了設定,則會套用Content Services預設匯出設定。

<resource>.caas[.<depth-int>].json

名稱
excludeproperties
excludePropertyPrefix
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

頁面匯出設定 page-export-configuration

此組態會延伸預設值,以包含子節點下的群組子項。

<site_page>.caas.page[.<depth-int>].json

其他資源 additional-resources

請參閱下列資源,瞭解內容服務中的其他主題:

recommendation-more-help
2eeeb575-8007-40cc-a72d-206fbc4ddd4b