Universal Editor 呼叫
- 主題:
- 開發
建立對象:
- 管理員
- 開發人員
瞭解通用編輯器對您的應用程式進行的不同型別呼叫,以協助您進行偵錯。
概觀
Universal Editor透過一系列已定義的呼叫,與您的檢測應用程式通訊。 這對是透明的,對一般使用者體驗沒有影響。
不過,對於開發人員而言,瞭解這些呼叫及其功用,對於使用通用編輯器對應用程式進行偵錯很有用。 如果您已檢測您的應用程式,而且其運作不如預期,則開啟瀏覽器中開發人員工具的 網路 索引標籤,並在編輯應用程式內容時檢查呼叫會很有幫助。
- 呼叫的 承載 包含編輯器正在更新的專案的詳細資料,包括識別要更新的專案以及如何進行更新。
- 回應 包含編輯器服務確切更新的詳細資料。 這是為了方便在編輯器中重新整理內容。 在某些情況下,例如
move
呼叫,必須重新整理整個頁面。
呼叫成功完成時,會觸發包含請求和回應裝載的事件,這些裝載可針對您自己的應用程式自訂。 如需詳細資訊,請參閱檔案通用編輯器事件。
以下為Universal Editor對您的應用程式發出的呼叫型別清單,以及裝載和回應範例。
更新
當您使用通用編輯器編輯應用程式中的內容時,會發生update
呼叫。 update
會保留變更。
其裝載包含要回寫至JCR的內容的詳細資訊。
resource
:要更新的JCR路徑prop
:正在更新的JCR屬性type
:要更新之屬性的JCR值型別value
:更新的資料
{
"connections": [
{
"name": "aem",
"protocol": "aem",
"uri": "https://localhost:8443"
}
],
"target": {
"resource": "urn:aem:/content/wknd/language-masters/en/jcr:content/root/container/carousel/item_1571954853062",
"type": "text",
"prop": "jcr:title"
},
"value": "Tiny Toon Adventures"
}
{
"updates": [
{
"resource": "urn:aem:/content/wknd/language-masters/en/jcr:content/root/container/carousel/item_1571954853062",
"prop": "jcr:title",
"type": "text"
}
]
}
詳細資料
在通用編輯器中載入您的應用程式以擷取應用程式內容時,會發生details
呼叫。
其裝載包含要呈現的資料以及資料代表的詳細資訊(結構),以便在Universal Editor中呈現。
- 對於元件,通用編輯器只會擷取
data
物件,因為資料的結構描述是在應用程式中定義的。 - 針對內容片段,通用編輯器也會擷取
schema
物件,因為內容片段模型是在JCR中定義。
{
"connections": [
{
"name": "aem",
"protocol": "aem",
"uri": "https://localhost:8443"
}
],
"target": {
"resource": "urn:aem:/content/wknd/language-masters/en/jcr:content/root/container/carousel/item_1571954853062",
"type": "component",
"prop": ""
}
}
{
"data": {
"jcr:primaryType": "nt:unstructured",
"jcr:title": "Tiny Toon Adventures",
"fileReference": "/content/dam/wknd-shared/en/adventures/riverside-camping-australia/adobestock-216674449.jpeg",
"cq:panelTitle": "WKND Adventures",
"actionsEnabled": "true",
"jcr:lastModifiedBy": "admin",
"titleFromPage": "false",
"jcr:description": "<p>With WKND Adventures, you don't just see the world you experinece it.</p>\r\n",
"jcr:lastModified": "Fri Jan 19 2024 11:05:59 GMT+0100",
"descriptionFromPage": "true",
"sling:resourceType": "wknd/components/teaser",
"textIsRich": "true",
"cq:styleIds": [
"1555543212672"
],
"actions": {
"jcr:primaryType": "nt:unstructured",
"item0": {
"jcr:primaryType": "nt:unstructured",
"link": "/content/wknd/language-masters/en/adventures",
"text": "View Trips"
}
}
}
}
新增
當您使用通用編輯器在應用程式中放置新元件時,會發生add
呼叫。
其承載包含包含應新增內容位置的path
物件。
此外掛程式也包含content
物件,其中包含每個外掛程式🔗要儲存之內容的特定於端點的詳細資料的其他物件。 例如,如果您的應用程式是以AEM和Magento的內容為基礎,裝載會包含每個系統的資料物件。
{
"connections": [
{
"name": "aemconnection",
"protocol": "aem",
"uri": "https://author-pXXXX-eYYYYY.adobeaemcloud.com"
}
],
"target": {
"container": {
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"type": "container",
"prop": ""
}
},
"content": {
"name": "text",
"aem": {
"page": {
"resourceType": "wknd/components/text",
"template": {
"text": "Default Text"
}
}
}
}
}
{
"updates": [
{
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"type": "container"
}
],
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/text_1138559521"
}
移動
當您使用通用編輯器在應用程式中移動元件時,會發生move
呼叫。
其裝載包含定義元件位置的from
物件,以及定義其移動位置的to
物件。
{
"connections": [
{
"name": "aemconnection",
"protocol": "aem",
"uri": "https://author-pXXXX-eYYYYY.adobeaemcloud.com"
}
],
"from": {
"container": {
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"type": "container",
"prop": ""
},
"component": {
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/image_275525847",
"type": "media",
"prop": "fileReference"
}
},
"to": {
"container": {
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"type": "container",
"prop": ""
}
}
}
{
"updates": [
{
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"type": "container"
}
]
}
移除
當您使用通用編輯器刪除應用程式中的元件時,會發生remove
呼叫。
其裝載包含已移除物件的路徑。
{
"connections": [
{
"name": "aemconnection",
"protocol": "aem",
"uri": "https://author-pXXXX-eYYYYY.adobeaemcloud.com"
}
],
"target": {
"component": {
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/text_593170193",
"type": "text",
"prop": "text"
},
"container": {
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"type": "container",
"prop": ""
}
}
}
{
"updates": [
{
"resource": "urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"prop": "",
"type": "container"
}
]
}
發佈
當您按一下通用編輯器中的 Publish 按鈕以發佈您已編輯的內容時,就會發生publish
呼叫。
Universal Editor會對內容進行反複運算,並產生也必須發佈的參考清單。
{
"connections": [
{
"name": "aemconnection",
"protocol": "aem",
"uri": "https://author-pXXXX-eYYYYY.adobeaemcloud.com"
}
],
"references": [
"urn:aemconnection:/content/dam/wknd-shared/en/magazine/arctic-surfing/aloha-spirits-in-northern-norway/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/bali-surf-camp/bali-surf-camp/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/climbing-new-zealand/climbing-new-zealand/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/cycling-southern-utah/cycling-southern-utah/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/cycling-tuscany/cycling-tuscany/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/downhill-skiing-wyoming/downhill-skiing-wyoming/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/napa-wine-tasting/napa-wine-tasting/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/riverside-camping-australia/riverside-camping-australia/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/ski-touring-mont-blanc/ski-touring-mont-blanc/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/surf-camp-in-costa-rica/surf-camp-costa-rica/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/tahoe-skiing/tahoe-skiing/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/west-coast-cycling/west-coast-cycling/jcr:content/data/master",
"urn:aemconnection:/content/dam/wknd-shared/en/adventures/yosemite-backpacking/yosemite-backpacking/jcr:content/data/master",
"urn:aemconnection:/content/wknd/us/en/newsletter/jcr:content/root/container/title",
"urn:aemconnection:/content/wknd/us/en/newsletter/jcr:content/root/container/text",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/title",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/image",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/text",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/image_229050934",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/image_2123678383",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/text_1668104604",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/text_1138559521",
"urn:aemconnection:/content/wknd/language-masters/en/universal-editor-container/jcr:content/root/container/image_275525847"
]
}
{
"publishes": [
"/content/dam/wknd-shared/en/magazine/arctic-surfing/aloha-spirits-in-northern-norway",
"/content/dam/wknd-shared/en/adventures/bali-surf-camp/bali-surf-camp",
"/content/dam/wknd-shared/en/adventures/climbing-new-zealand/climbing-new-zealand",
"/content/dam/wknd-shared/en/adventures/cycling-southern-utah/cycling-southern-utah",
"/content/dam/wknd-shared/en/adventures/cycling-tuscany/cycling-tuscany",
"/content/dam/wknd-shared/en/adventures/downhill-skiing-wyoming/downhill-skiing-wyoming",
"/content/dam/wknd-shared/en/adventures/napa-wine-tasting/napa-wine-tasting",
"/content/dam/wknd-shared/en/adventures/riverside-camping-australia/riverside-camping-australia",
"/content/dam/wknd-shared/en/adventures/ski-touring-mont-blanc/ski-touring-mont-blanc",
"/content/dam/wknd-shared/en/adventures/surf-camp-in-costa-rica/surf-camp-costa-rica",
"/content/dam/wknd-shared/en/adventures/tahoe-skiing/tahoe-skiing",
"/content/dam/wknd-shared/en/adventures/west-coast-cycling/west-coast-cycling",
"/content/dam/wknd-shared/en/adventures/yosemite-backpacking/yosemite-backpacking",
"/content/wknd/us/en/newsletter",
"/content/wknd/language-masters/en/universal-editor-container"
]
}