jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paco Avila" <pav...@git.es>
Subject Re: Result of VERSION-CONTROL request
Date Tue, 28 Oct 2008 16:24:47 GMT
This is an old discussion in this list :) In my application I had to perform
a checkin after adding a new file. And the same issue in present WebDAV.
Well, Jackrabbit in very generic and you have to adapt it to your needs...
and this seems ti be an example of it.

On Tue, Oct 28, 2008 at 4:22 PM, Dave Fried <dfried@phoenix-int.com> wrote:

>
> The WebDAV standard seems to indicate that the result of a VERSION-CONTROL
> request should be a resource which is in the checked-in state:
>
>      "If the request-URL identified a
>      versionable resource at the time of the request, the request MUST
>      have created a new version history and MUST have created a new
>      version resource in that version history.  The resource MUST have
>      a DAV:checked-in property that identifies the new version."
>
> But Jackrabbit's WebDAV implementation seems to leave the resource in the
> checked-out state.  This probably isn't a problem in most cases, since the
> VERSION-CONTROL request, when applied to an already version-controlled
> resource, is not guaranteed to leave the resource in a checked-in state, so
> applications will have to handle this anyway.  But it seems like an
> arbitrary departure from the standard.
>
> Two questions:
>  * is this ever a problem in practice? (in other words, should I care?)
>  * is there an easy way to add the version-controlled JCR mixin to the
> resource and check it in atomically, all in one fell swoop, as part of the
> version-control handler?
>
> For example, in VersionControlledResourceImpl::addVersionControl(), would
> the following code work?
>
>        if (!isVersionControlled()) {
>            Node item = getNode();
>            try {
>                item.addMixin(JcrConstants.MIX_VERSIONABLE);
>                item.save();
>                item.checkin();  // <<<====== ADDED LINE OF CODE
>            } catch (RepositoryException e) {
>                throw new JcrDavException(e);
>            }
>        }
>
> Should checkin() come before save()?  I am not so familiar with how JCR
> works yet.
>
> Thanks in advance!
>
> --Dave
> --
> View this message in context:
> http://www.nabble.com/Result-of-VERSION-CONTROL-request-tp20209013p20209013.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>


-- 
Paco Avila
GIT Consultors
tel: +34 971 498310
fax: +34 971496189
e-mail: pavila@git.es
http://www.git.es

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message