The document publication lifecycle handles all steps for publishing a document.
Below is a diagram for the document publication lifecycle. You don’t need to fully understand everything going on right now, but as you learn and build more, it will be a useful reference.
- Start “Prepare Publish” phase where you still can modify the document, validate data and throw errors back to the callee
- Call metadata plugin hook
onPreparePublish
(modify metadata property, validation) - Call server hook
preparePublishHook
(modify document, validation). - Start “Publication” phase
- Save the publication on the database
- Call server event
document.update
- Call server event
document.publish
- Call server hook
postPublishHook
(notify other systems).