You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by aleamb <aa...@albaelectronica.com> on 2013/01/10 13:05:15 UTC

get user who created the version

Hi.

¿Can be get the user who created a specific version of a node?

I have tried to add mix:lastModified mixin for to read the last user who
modified a node through of jcr:lastModifiedBy attribute, but it does not
work; ie, adding mixin to node is ok, but jcr:lastModifiedBy value is always
the user who created the node.

any idea? 

Thanks.





--
View this message in context: http://jackrabbit.510166.n4.nabble.com/get-user-who-created-the-version-tp4657322.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: get user who created the version

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 10.01.2013, at 16:27, aleamb <aa...@albaelectronica.com> wrote:

> I don't understand why JSR-282 orjackrabbit do not consider an attribute for
> storing user id for a nt:version node. It is very useful for version
> management.

You can quite easily set any desired properties before you do a checkin(), something like

node.setProperty("lastCheckedInBy", session.getUserID());

I guess in general, the spec decided to minimize the number of properties that get autocreated to avoid polluting content if you don't need it.

Cheers,
Alex


Re: get user who created the version

Posted by aleamb <aa...@albaelectronica.com>.
Thanks Alex. 

Then I have no choice that manage those attributes with my code. It is
tedious.

I don't understand why JSR-282 orjackrabbit do not consider an attribute for
storing user id for a nt:version node. It is very useful for version
management.



Alexander Klimetschek-2 wrote
> On 10.01.2013, at 13:05, aleamb &lt;

> aambroa@

> &gt; wrote:
> 
>> ¿Can be get the user who created a specific version of a node?
>> 
>> I have tried to add mix:lastModified mixin for to read the last user who
>> modified a node through of jcr:lastModifiedBy attribute, but it does not
>> work; ie, adding mixin to node is ok, but jcr:lastModifiedBy value is
>> always
>> the user who created the node.
> 
> jcr:lastModified/By are not set automatically. You need to make sure to
> set them on modification.
> 
> Cheers,
> Alex





--
View this message in context: http://jackrabbit.510166.n4.nabble.com/get-user-who-created-the-version-tp4657322p4657325.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: get user who created the version

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 10.01.2013, at 13:05, aleamb <aa...@albaelectronica.com> wrote:

> ¿Can be get the user who created a specific version of a node?
> 
> I have tried to add mix:lastModified mixin for to read the last user who
> modified a node through of jcr:lastModifiedBy attribute, but it does not
> work; ie, adding mixin to node is ok, but jcr:lastModifiedBy value is always
> the user who created the node.

jcr:lastModified/By are not set automatically. You need to make sure to set them on modification.

Cheers,
Alex