呈現和傳遞 rendering-and-delivery

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

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

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

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

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

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

chlimage_1-15

請求JSON requesting-json

使用​ <RESOURCE.caas[。<EXPORT-CONFIG][。<EXPORT-CONFIG].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
字串[]
不排除任何專案
子名稱
從JSON匯出僅包含指定的子項,排除其他
renameProperties
字串[]
不重新命名任何專案
<actual_property_name>,<replacement_property_name>
使用取代重新命名屬性

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

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

名稱
resourceTypeOverrides
jcr:primaryType
nt:unstructured

下表顯示特性:

名稱
類型
預設(如果,未設定)
說明
<選擇器_TO_INC>
String[]
-
sling:resourceType
對於下列sling資源型別,請勿傳回預設的CaaS json匯出。
將資源轉譯為;
<RESOURCE>以傳回客戶json匯出。<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