Hi Xavi,

On Tue, Jun 14, 2011 at 10:34 AM, Xavi Beumala <[email protected]> wrote:
> ...What I'm trying to achieve is submitting 2 curl :import operations. The 
> first one creates a new object, the second one should create a new version by 
> modifying a property:
>
> curl -u admin:admin -F":operation=import" -F":contentType=json" 
> -F":content={'person1':{'jcr:primaryType':'nt:unstructured','jcr:mixinTypes':['mix:versionable'],
>  'surname':'aaa'}}" -F":replaceProperties=true" -F":checkin=true" 
> -F":autoCheckout=true" http://localhost:4502/content/people
>
>
> curl -u admin:admin -F":operation=import" -F":contentType=json" 
> -F":content={'person1':{'jcr:primaryType':'nt:unstructured','jcr:mixinTypes':['mix:versionable'],
>  'surname':'bbb'}}" -F":replaceProperties=true" -F":checkin=true" 
> -F":autoCheckout=true" http://localhost:4502/content/people
>
> ...The problem resides in the second request where I receive the error " 
> javax.jcr.version.VersionException: Unable to perform operation. Node is 
> checked-in."
>
> It looks like the :autoCheckout option is not being taken into consideration. 
> I've also set to true the "Auto checkout nodes" option in the Apache Sling 
> Post Servlet configuration.

That's indeed a bug, autoCheckout is not taken into account. I've
created SLING-2108 to track it.

For now, you can use this in between those requests:

curl -u admin:admin -F":operation=checkout"
http://localhost:4502/content/people/person1

-Bertrand

Reply via email to