...
Excerpt |
---|
Within Fedora 4, snapshots of the current state of an object may be saved into the version history either through explicit user requests or during each update to that object. The properties or content of a node saved in these version checkpoints versions may be accessed later to serve as a historical record of the object. Future feature development may allow for easy export of the entire history or other useful actions. |
Enabling Versioning
By default, nodes do not have the mix:versionable
mixin, versioning is disabled for all nodeswhich means that they do not have any versioning triples, or versions listed. When you make a request to create a version, the mix:versionable
mixin is added to that node automatically.
...
Code Block | ||||
---|---|---|---|---|
| ||||
echo "insert data { <> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.jcp.org/jcr/mix/1.0versionable> . }" \ | curl -X PATCH --upload-file - http://localhost:8080/rest/path/to/object |
Enabling versioning by default for all nodes is incompatible with read/write filesystem federation. If you are not using filesystem federation (or only read-only), you can make all nodes versionable by default.
Creating versions
...
When you wish to save a snapshot of the current version of a node to the version history you can use the REST API. When saving these versions you can optionally must provide a label that both serves to easily differentiate a version from another and allows easy retrieval of that version.
...
From the HTML view (or by issuing HTTP GET methods in an HTTP client program) you can get the version history of a node by appending "/fcr:versions" to it's base URL. The root Each version will always be listed and represents the object at inception. Following the root version will be any other versions created. When labels have been specified, those labels will be displayed, otherwise the version will be identified by the modification date, either using the version label as the title, or for versions without labels, the modification date will be used instead.
Previewing historic properties
...
If you wish to restore an object to a previous version you may do so using the REST API, or even the HTML view. In the HTML view of a historic version, a button exists on the right hand side saying "Revert to this Version" that when clicked restores the object (and possibly the subgraph) to the version viewed.
Info |
---|
When restoring an old version, two operations occur:
|