Universal Editor Calls calls
Learn about the different types of calls made to your app by the Universal Editor to help you when debugging.
Overview overview
The Universal Editor communicates with your instrumented app through a series of defined calls. This is transparent to and has no effect on the end user experience.
For the developer, however, understanding these calls and what they do can be valuable when debugging your application when using the Universal Editor. If you have instrumented your app and it is not behaving as anticipated, it can be helpful to open the Network tab of the developer tools in your browser and inspect the calls as you edit content in your app.
- The Payload of the call contains details of what is being updated by the editor including identifying what to update and how to update it.
- The Response includes details of what exactly was updated by the editor service. This is to facilitate refreshing the content in the editor. In certain cases, like a
move
call, the entire page must be refreshed.
Once a call is completed successfully, events are triggered that include the request’s and response’s payload, which can be customized for your own app. Please see the document Universal Editor Events for more details.
The following is a list of the types of calls that the Universal Editor makes to your app along with sample payloads and responses.
Update update
An update
call occurs when you edit content in your app using the Universal Editor. The update
persists the changes.
Its payload includes details of what to write back to the JCR.
resource
: The JCR path to be updatedprop
: The JCR property that is being updatedtype
: The JCR value type of the property being updatedvalue
: The updated data
code language-json |
---|
|
code language-json |
---|
|
Details details
A details
call occurs when loading your app in the Universal Editor to retrieve the app’s content.
Its payload includes the data to be rendered as well as details of what the data represent (the schema) so they can be rendered in the Universal Editor.
- For a component, the Universal Editor only retrieves a
data
object, since the schema of the data is defined in the app. - For Content Fragments, the Universal Editor also retrieves a
schema
object since the Content Fragment Model is defined in the JCR.
code language-json |
---|
|
code language-json |
---|
|
Add add
An add
call occurs when you place a new component in your app using the Universal Editor.
Its payload includes a path
object containing where the content should be added.
It also includes a content
object with additional objects for endpoint-specific details of the content to be stored for each plugin. For example if your app is based on content from AEM and Magento, the payload would contain a data object for each system.
code language-json |
---|
|
code language-json |
---|
|
Move move
A move
call occurs when you move a component within your app using the Universal Editor.
Its payload includes a from
object defining where the component was and a to
object defining where it was moved.
code language-json |
---|
|
code language-json |
---|
|
Remove remove
A remove
call occurs when you delete a component within your app using the Universal Editor.
Its payload includes the path of the object that is removed.
code language-json |
---|
|
code language-json |
---|
|
Publish publish
A publish
call occurs when you click the Publish button in the Universal Editor to publish the content that you have edited.
The Universal Editor iterates over the content and generates a list of references that must also be published.
code language-json |
---|
|
code language-json |
---|
|