As a side question: is the corresponding page objects content loaded when viewing a previous version?
I ask because I’m almost sure (not 100% because I made lots of edits while attempting to integrate a Javascript library to a page) I got and saved a fully functional version of the page before going further with other modifications.
There is. Just load the page specific version of the page.
There are two ways to do this
1/ enable the revision panel for the page, then click on the specific version you want to view and take it from there. See the following:
If I want to see page version 1.1, then I just click on the 1.1 in the version column.
2/ add a “?rev=x.y” where x.y is the major.minor version numbers of the page you want to look at. This is only useful if you know your version numbers.
It’s easier to enable the revision panel and click on the version you want to see.
Yup, I already have these. I’m talking, though, specifically to the objects content, not the wiki syntax page content - for which viewing a previous version works.
Unless you meant the same as what NorSch suggested, to physically copy a previous version to a new page.
In addition to the objects values of a given version being loaded when you access that version with ?rev=x.y (as vmassol mentioned) , you can also see the raw content of those objetcs if you’re ready to read a little XML.
By further adding &xpage=xml at the end of the URL of your page (after the rev parameter), you will see the XML serialization of the XWiki document . In there, all the objects are present with the raw values of their properties, as they’re saved in the database. The only thing missing is the content of the attachments (but the metadata of the attachments is displayed).
OK, I understand your problem, and it’s “normal” because for a stylesheet extension (and Javascript extension) things are a bit more complex than they seem:
when you load a page with an ssx or jsx object - at any version - the “contents” of that page load in multiple requests to the server:
your current request
in the html result of this request, the ssx and jsx of that page are not included directly, they’re referenced as external resources (with link and javascript tags in the head element of that page) - this is something that xwiki does automatically, it’s part of the stylesheet extension mechanism
then, the browser makes one request to the server for each one of these resources to load them
Now, when you request a page at a given version, with rev=, the page in the first request is properly loaded at the version you asked for, including its objects, for the scope of that request only. However, the mechanism that includes links to external resources is not aware of versions - for good reasons that I won’t detail here - and it will include links to the latest ssx and latest jsx of that page. Thus, those separate requests that will fetch the resources (Javascript and style) will actually request the latest versions of those resources, hence your wrongly colored square.
Hmmm, ok, I can take that as it has been designed like that; I guess that answers with a no to my previous question, then:
That’s fine, I asked because I was experimenting at integrating some javascript libraries in successive edits to the same page and at a point I wanted to go back to a previous attempt, but wasn’t able to recognize the correct page version since it didn’t load the previous Javascript content too.
But by comparing the versions I managed to find it.