jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: Namespaces - questions
Date Thu, 01 Mar 2007 10:41:46 GMT
On 2/28/07, Tobias Bocanegra <tobias.bocanegra@day.com> wrote:
> hi all,
>
> > 1/ It seems though, that the JR impl takes the spec a bit loosely...
> > if you read source like these 2 snippets:
> not at all.
> nodetype administration is left out in the spec at all, so JR can't
> take it loosely :-).
>
> and it also states:
>   "An implementation may prevent the unregistering of any other
> namespace for implementation-specific reasons by throwing a
> NamespaceException."
>
> > 2/ Apart from that: what would then be the preferred place to put a
> > custom CND file?
> > In /workspaces/myworkspace/nodetypes  ?
>
> i think, the big problem when developing with JR is to manage the nodetypes.
> before we had the CND, you had to modify the custom nodetype.xml by
> hand. of course you can use the CND importer now, but it would be very
> handy, if the custom nodetypes would be written/read as CND as well.

clarification:

jackrabbit's internal persistent representation of the registered custom
node type definitions (<rep home>/nodetypes/custom_nodetypes.xml) is
an implementation detail and was never meant to be externally modified!
if you do so you risk corrupting your repository. this has been repeatedly
pointed out on the list.

btw: you wouldn't expect to be able to manually edit e.g. a tablespace file
of an oracle database...

since jackrabbit 1.0 you are able to register your node type definitions in
either xml or cnd format:
http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.html#registerNodeTypes(java.io.InputStream,%20java.lang.String)

cheers
stefan

> thats what the issue JCR-771 is about.
>
> > 3/ In reaction to text below from previous mail: the question was not
> > why we had to write
> > s.getRootNode().getNode("myapp:someNode"); // i.e. with the inclusion
> > of the NS (I do get the concept of NSes :-)
> >
> > ... but why the prior and explicit need for a second
> > "s.setNamespacePrefix("myapp", "http://your.com/ns/1");"
> > as it is already registered at that point. (Is it really necessary
> > within one app - fail to see why)
>
> for clarification: if the namespace is registered globally with the
> desired prefix, you don't need to map it again in the session. only if
> you want to use another prefix.
>
> regards, toby
> --
> -----------------------------------------< 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 >---
>

Mime
View raw message