jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pulla Venkat" <pcsri1...@gmail.com>
Subject Re: Jackrabbit version numbers/names
Date Thu, 19 Jun 2008 18:46:06 GMT
I wrote some code to reproduce example graph. My code threw some exceptions.
Probably, this is because I don't
understand the version names/numbers properly.

Here is my code for version names/numbers.

Node n = session.getNodeByUUID("bcb13978-86d1-43d6-a4b4-8ebce471d4ca");

System.*out*.println( n.getBaseVersion().getName() );

n.getBaseVersion().checkout();

n.getBaseVersion().save();

n.getBaseVersion().checkin();

VersionHistory veh = n.getVersionHistory();

*for*(VersionIterator vi = veh.getAllVersions();vi.hasNext();) {

System.*out*.println(vi.nextVersion().getName());

}

Thanks,
Pulla venkat




On Thu, Jun 19, 2008 at 10:05 AM, Pulla Venkat <pcsri1956@gmail.com> wrote:

> Hi Jukka,
>
> I got this documentation from jackrabbit source code but couldn't figure
> what it means.
>
> I am confused about how to go from versionname 1.0 to 2.0.
>
> My code does something below and always goes from 1.1 to 1.2 to 1.3 ...
>
> Node.checkout();
> Node.setProperty("a","a")
> Node.save();
> Session.save();
> Node.checkin();
>
> VersionHistory vh  = Node.getVersionHistory();
> VersionInterator vit = vh.getAllVersions();
>
> while(vit.hasNext())
> System.out.println(vit.next().getName();
>
> I would like to know when it goes from 1.0 to 2.0 and 1.2 to 1.2.1  to
> 1.2.1.1
>
> I can't reproduce example graph.. Can any body add snippet of code to
> reproduce the example below. Thanks
>
> Example Graph:
>     jcr:rootVersion
>      |     |
>     1.0   2.0
>      |
>     1.1
>      |
>     1.2 ---\  ------\
>      |      \        \
>     1.3   1.2.0   1.2.0.0
>      |      |
>     1.4   1.2.1 ----\
>      |      |        \
>     1.5   1.2.2   1.2.1.0
>      |      |        |
>     1.6     |     1.2.1.1
>      |-----/
>     1.7
>
> Thanks,
> Pulla
>
>
>
> On Thu, Jun 19, 2008 at 7:35 AM, Jukka Zitting <jukka.zitting@gmail.com>
> wrote:
>
>> Hi,
>>
>> On Thu, Jun 19, 2008 at 12:55 PM, Alexander Klimetschek
>> <aklimets@day.com> wrote:
>> > I think Pulla refers to the version numbering in the JCR API, not the
>> > Jackrabbit release versioning scheme.
>>
>> Ah, you're right! I've been thinking about release versioning too much
>> lately...
>>
>> > Which I find to be weird, too, since the leading "1." never changes
>> > and is redundant information. It's not a difficult thing for an
>> application
>> > to remove that prefix for displaying simpler version numbers or to
>> > simply count the versions themselves, but I wonder if there was
>> > any reason for this decision. A  future feature maybe? Something
>> > like branching?
>>
>> Here's the relevant documentation from
>> AbstractVersionManager.calculateCheckinVersionName:
>>
>> The name is determined as follows:
>>
>> * first the predecessor version with the shortes name is searched.
>> * if that predecessor version is the root version, the new version
>> gets the name "{number of successors}+1" + ".0"
>> * if that predecessor version has no successor, the last digit of it's
>> version number is incremented.
>> * if that predecessor version has successors but the incremented name
>> does not exist, that name is used.
>> * otherwise a ".0" is added to the name until a non conflicting name is
>> found.
>>
>> Example Graph:
>>
>>     jcr:rootVersion
>>      |     |
>>     1.0   2.0
>>      |
>>     1.1
>>      |
>>     1.2 ---\  ------\
>>      |      \        \
>>     1.3   1.2.0   1.2.0.0
>>      |      |
>>     1.4   1.2.1 ----\
>>      |      |        \
>>     1.5   1.2.2   1.2.1.0
>>      |      |        |
>>     1.6     |     1.2.1.1
>>      |-----/
>>     1.7
>>
>> BR,
>>
>> Jukka Zitting
>>
>
>

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