copied method from a recent version of drawio to include a fix - in the old version of the method, when you import a diagram file on an empty diagram, they would unload the old XWikiFile and use LocalFile, and this breaks a lot of functionalities; this should be removed once we upgrade to a recent version of drawio
update setData too, since pages are already initialized at that point