XWIKI-9527: Sheets are not applied on preview action if the document is new
* Split EditAction#render() in multiple methods to be able to reuse them and also to make the code more clear.
* Rafactor the PreviewAction to extend the EditAction: both actions should do the same thing, expect the preview should render in view mode, but the preparation of the edited/previewed document is the same.
(cherry picked from commit 0ec9c8ad52a6fc625f3e9b5396b25af7e6b7ff71)