Hi Outta,
Outta Sight schrieb:
I'm looking for an example of how to perform versioned POSTs (POST.esp) and
also how to access a list of these versions (versions.esp) for any node. It
seems that this sort of capability must be scripted using Sling scripts. Does
anybody have examples using Javascript? Because Sling is built on top of a
content repository where one of the primary features is versioning - I'd like
to know how to do this.
Currently the SlingPostServlet does not do versioning. This would be an
extension to be built in.
Regarding versioning there are probably two use cases:
* checkpointing - create a new version of the modified node
before modifying it
* versioning - create a new version of the modified node
after modifying it
In addition, I think, the SlingPostServlet should automatically check
out a versionable node before modification if the nodes happens to be
checked in.
It also needs to be discussed, whether the node remains checked out
after the operation or is checked in. Probably, it should be in the
state it was before the operation: If the node was checked in, it must
be checked in after the operation. If it was checked out, it must be
checked out after the operation.
Regarding access to the versions: There are two cases again:
* Access to a certain (known) version
* Listing all versions of a node
The first case might be implemented by the resource resolver as noted in
another thread by supporting parametrized URLs of the form
http://host/path;v=1.
The second case could be handled by the JSON default get servlet, which
could be enhanced to return a list of the versions for a given node...
Regards
Felix