You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by J Kuijpers <ja...@hotmail.com> on 2006/09/06 17:38:17 UTC

getting the latest version of a checkedout node

Hello, when the property jcr:isCheckedOut of a node is true, I want to
retrieve this node without the changes which are possibly made during the
checkout state. So I want to retrieve the node as it was, when it was last
checked in. Only when the checkedout node is checkedin the changes are final
so then I want to retrieve the node with ithe changes.

Is this possible? If so, how would I achieve this? I am looking at the
frozennode property, am I on the right track?
-- 
View this message in context: http://www.nabble.com/getting-the-latest-version-of-a-checkedout-node-tf2227841.html#a6173979
Sent from the Jackrabbit - Dev forum at Nabble.com.


Re: getting the latest version of a checkedout node

Posted by David Nuescheler <da...@gmail.com>.
Hi J,

> I had already tried your approach with multiple workspaces. The problem with
> that is, I don't want a workspace for every user, since there might be a lot
> of users.
Do you have a lot of users that do reading and a few that actually modify
something? Or do generally all users read and write?

If there are only few users (or even "Activities" for multiple users working
together on a bigger "change set") that actually make modifications, then
you may allow the users to start their "change project" as they begin
making changes which would then result in the creation of a new
fully populated workspace, which is used during the course of the
modification until the changes are checked back in, which could
also result in the disposal of the workspace.

I guess architecturally it sounds like the cleanest solution would be
to have something that we at some point of the specification called
a "Dynamic Workspace" meaning that a dynamic workspace would
be based on another workspace and from an implementation perspective
would not incur the cost of actually duplicating the content.
Since we found that this really is an implementation detail, we took it
out of the JCR spec. So I guess, it would be up to the Jackrabbit
implementation to be able to provide something like that, which I
personally think would be fantastic. This almost sounds like
a very clever "copy on write" implementation, with quite an impact
on things like the search index, referential integrity and for the
first time forcing "cross-workspace" dependencies.

...and that actually would be a good topic for the dev-list ;)

regards,
david

Re: getting the latest version of a checkedout node

Posted by J Kuijpers <ja...@hotmail.com>.
I am sorry. I didn't realize I was reading the dev list when I was posting
this. Will keep it in mind next time.

I had already tried your approach with multiple workspaces. The problem with
that is, I don't want a workspace for every user, since there might be a lot
of users. So I tried to create a workspace just for the checkedout nodes.
Kind of temporary store. But I use a lot of reference properties in my
nodes, so I couldn't just clone the nodes to the temp. workspace since then
the references are missing. Cross-workspace references aren't possible
right?

So this option isn't working out for me either.

thnx

David Nuescheler wrote:
> 
> Hi J,
> 
> I think that your explanations point into the direction of multiple
> workspaces. If user A has a workspace A that user can make
> modifications in his workspace without user B in workspace B
> can see the changes. As soon as user A checks something
> into the version store user B can check it out and look at it
> using merge() or update().
> 
> Does that suit your use case?
> 
> regards,
> david
> 
> 

-- 
View this message in context: http://www.nabble.com/getting-the-latest-version-of-a-checkedout-node-tf2227841.html#a6203970
Sent from the Jackrabbit - Dev forum at Nabble.com.


Re: getting the latest version of a checkedout node

Posted by David Nuescheler <da...@gmail.com>.
.... and ;) as marcel put it:

"as a quick guideline: if you don't know how to achieve something ask on the
user list, if you think something is wrong and doesn't work as
expected use the dev list. Thank you."

Re: getting the latest version of a checkedout node

Posted by David Nuescheler <da...@gmail.com>.
Hi J,

I think that your explanations point into the direction of multiple
workspaces. If user A has a workspace A that user can make
modifications in his workspace without user B in workspace B
can see the changes. As soon as user A checks something
into the version store user B can check it out and look at it
using merge() or update().

Does that suit your use case?

regards,
david

Re: getting the latest version of a checkedout node

Posted by J Kuijpers <ja...@hotmail.com>.
I don't think so. This is actually restoring the node, so the current node is
overwritten with the older version. I just want to read the latest version
of a node before it was checked out.
In my application users are reading nodes, the checkedout state of a node
shouldn't be visable for the users. When a user has checked out a node and
is changing it, all other users should get the latest version before it was
checked out, when they request the node. Only when the node is checked in
again they get the one with changes. 


Tobias Bocanegra wrote:
> 
> you're probably looking for:
> 
> Node.restore(node.getBaseVersion());
> 
> regards, toby
> 
> On 9/6/06, J Kuijpers <ja...@hotmail.com> wrote:
>>
>> Hello, when the property jcr:isCheckedOut of a node is true, I want to
>> retrieve this node without the changes which are possibly made during the
>> checkout state. So I want to retrieve the node as it was, when it was
>> last
>> checked in. Only when the checkedout node is checkedin the changes are
>> final
>> so then I want to retrieve the node with ithe changes.
>>
>> Is this possible? If so, how would I achieve this? I am looking at the
>> frozennode property, am I on the right track?
>> --
>> View this message in context:
>> http://www.nabble.com/getting-the-latest-version-of-a-checkedout-node-tf2227841.html#a6173979
>> Sent from the Jackrabbit - Dev forum at Nabble.com.
>>
>>
> 
> 
> -- 
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
> 
> 

-- 
View this message in context: http://www.nabble.com/getting-the-latest-version-of-a-checkedout-node-tf2227841.html#a6187272
Sent from the Jackrabbit - Dev forum at Nabble.com.


Re: getting the latest version of a checkedout node

Posted by Tobias Bocanegra <to...@day.com>.
you're probably looking for:

Node.restore(node.getBaseVersion());

regards, toby

On 9/6/06, J Kuijpers <ja...@hotmail.com> wrote:
>
> Hello, when the property jcr:isCheckedOut of a node is true, I want to
> retrieve this node without the changes which are possibly made during the
> checkout state. So I want to retrieve the node as it was, when it was last
> checked in. Only when the checkedout node is checkedin the changes are final
> so then I want to retrieve the node with ithe changes.
>
> Is this possible? If so, how would I achieve this? I am looking at the
> frozennode property, am I on the right track?
> --
> View this message in context: http://www.nabble.com/getting-the-latest-version-of-a-checkedout-node-tf2227841.html#a6173979
> Sent from the Jackrabbit - Dev forum at Nabble.com.
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---