jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: node alias
Date Fri, 06 Mar 2009 14:53:37 GMT
On Fri, Mar 6, 2009 at 2:47 PM, vlad vesa <numaplictisesc@yahoo.com> wrote:
> i have a jackrabbit repository with the nodes:  nt:file   nt:folder each
> having the properties with respect:
>         nt:file
>             rep:owner_file
>             rep:shared_file
>         nt:folder
>             rep:owner_folder
>             rep:shared_folder
>
>    The properties are multivalues and... how i set them... well... i hacked
> the custom_nodetypes.xml located in the core of jackrabbit < ---  very bad,
> i think... but i did it. The application works fine and now there are nodes
> that have these properties set.

Please don't do this. a) modifying node types defined by the jcr spec
completely breaks the idea of using a standard and b) there is a way
to register node types through code properly.

>
>    Meanwhile i am obliged to hack this file at each upgrade of
> jackrabbit...and because i understand better how can i register new
> nodetypes without hacking... i must pass from the old structure, to the new
> one with:
>
>             nt:custom_folder_node
>                  with properties       rep:owner
>                                             rep:shared
>            nt:custom_file_node
>                  with properties       rep:owner
>                                             rep:shared
>
> Is there a way to do this?  I was thinking at some " node aliasing" but it
> is not very clear what i want to do.

You can either have your own nodetypes that extend from
nt:folder/nt:file and add the owner/shared properties or use mixins.
You would only need one mixin for that, since the properties seem to
be the same for both file/folders.

Also: Don't use the namespaces behind "nt" or "rep" (and thus their
prefixes) in your custom nodetypes, mixins, node or property names. If
you go with a mixin as the solution for the above, it could look
something like this:

[my:FileOwner]
  mixin
  - owner (string)
  - shared (string)

(Using prefixes in property names only produces clutter, but this is
just my personal opinion).

Was there anything you missed in the documentation on
http://jackrabbit.apache.org/node-types.html ? (I am asking so that we
could improve it).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message