You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Stefan Frank <s....@vierundsechzig.de> on 2005/06/10 15:08:40 UTC
NodeTypes for Starters?!
Hi,
I'm new to jackrabbit, played a little with magnolia and now want to get my
hands dirty with jackrabbit. I intend to use jackrabbit as a repository for
digital assets (images, movies in different formats, pdf ...) - it looks
like jcr is a perfect fit for this kind of application. After reading all
the documents I could find (there is not so much on jackrabbit...), I had my
"Hello World!"-experience (node.setProperty("hello", new
StringValue("World!"));) - now I want to go all the way. Is there some more
documentation somewhere, apart from the jcr-Specification? Up to now, I only
found what's on the incubation-website and a brief article on artima.com.
Being new to jackrabbit, of course I have lots of questions, eg.
- how to define custom-node-types (some explanations on the
custom_nodetypes.xml would be nice...)
- what about lazy-loading (what do I get with a node.getNodes(), when each
nodes has child nodes - is that configurable?
- what about concurrency? I haven't seen any assumptions about transactional
behavior in the jcr - if i got it right, it is up to the repository to
ensure that no nodes are deleted by B to which A adds nodes?!
...
Any hints on even the most unfinished documentation would be highly
appreciated! (I'll try to write down what you throw at me and maybe will try
to compile some how-tos from it...)
Cheers
Stefan
Re: NodeTypes for Starters?!
Posted by Stefan Guggisberg <st...@gmail.com>.
On 6/30/05, Digby <li...@digby.net> wrote:
> Oops.
>
> I'm interested in why you shouldn't modify custom_nodetypes.xml
> yourself. I've just been playing with this to save myself the effort of
> coding all the node types. I'm just at playing stage so haven't got any
> data to lose.
sure, you can do it, but do it on your own risk. you can easily corrupt
the entire repository by messing with custom_nodetypes.xml. you won't
get any help if you break things.
>
> Digby
>
> Stefan Guggisberg wrote:
> > On 6/10/05, Stefan Frank <s....@vierundsechzig.de> wrote:
> >
> >>Hi,
> >>
> >>I'm new to jackrabbit, played a little with magnolia and now want to get my
> >>hands dirty with jackrabbit. I intend to use jackrabbit as a repository for
> >>digital assets (images, movies in different formats, pdf ...) - it looks
> >>like jcr is a perfect fit for this kind of application. After reading all
> >>the documents I could find (there is not so much on jackrabbit...), I had my
> >>"Hello World!"-experience (node.setProperty("hello", new
> >>StringValue("World!"));) - now I want to go all the way. Is there some more
> >>documentation somewhere, apart from the jcr-Specification? Up to now, I only
> >>found what's on the incubation-website and a brief article on artima.com.
> >>
> >>Being new to jackrabbit, of course I have lots of questions, eg.
> >>
> >>- how to define custom-node-types (some explanations on the
> >>custom_nodetypes.xml would be nice...)
> >
> >
> > you can register node types by calling
> >
> > NodeTypeRegistry.registerNodeType(NodeTypeDef).
> >
> > here's how you get the NodeTypeRegistry object:
> >
> > Workspace wsp = session.getWorkspace();
> > NodeTypeManager ntMgr = wsp.getNodeTypeManager();
> > NodeTypeRegistry ntReg =
> > ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
> >
> > node type registration is not covered by the jsr-170 spec
> > but it's nonetheless available in jackrabbit since day 0.
> >
> > btw: custom_nodetypes.xml should never be manipulated directly;
> > otherwise you risk loosing your data.
> >
> >
> >>- what about lazy-loading (what do I get with a node.getNodes(), when each
> >>nodes has child nodes - is that configurable?
> >
> >
> > that's nothing you have to worry about. it's up to the repository to
> > implement this efficiently.
> >
> >
> >>- what about concurrency? I haven't seen any assumptions about transactional
> >>behavior in the jcr - if i got it right, it is up to the repository to
> >>ensure that no nodes are deleted by B to which A adds nodes?!
> >
> >
> > check out the jsr 170 specification. transaction support is described in detail.
> > another feature to avoid the above descibed scenario is locking.
> >
> > cheers
> > stefan
> >
> >
> >>...
> >>
> >>Any hints on even the most unfinished documentation would be highly
> >>appreciated! (I'll try to write down what you throw at me and maybe will try
> >>to compile some how-tos from it...)
> >>
> >>Cheers
> >>Stefan
> >>
> >>
> >
> >
>
>
Re: NodeTypes for Starters?!
Posted by Digby <li...@digby.net>.
Oops.
I'm interested in why you shouldn't modify custom_nodetypes.xml
yourself. I've just been playing with this to save myself the effort of
coding all the node types. I'm just at playing stage so haven't got any
data to lose.
Digby
Stefan Guggisberg wrote:
> On 6/10/05, Stefan Frank <s....@vierundsechzig.de> wrote:
>
>>Hi,
>>
>>I'm new to jackrabbit, played a little with magnolia and now want to get my
>>hands dirty with jackrabbit. I intend to use jackrabbit as a repository for
>>digital assets (images, movies in different formats, pdf ...) - it looks
>>like jcr is a perfect fit for this kind of application. After reading all
>>the documents I could find (there is not so much on jackrabbit...), I had my
>>"Hello World!"-experience (node.setProperty("hello", new
>>StringValue("World!"));) - now I want to go all the way. Is there some more
>>documentation somewhere, apart from the jcr-Specification? Up to now, I only
>>found what's on the incubation-website and a brief article on artima.com.
>>
>>Being new to jackrabbit, of course I have lots of questions, eg.
>>
>>- how to define custom-node-types (some explanations on the
>>custom_nodetypes.xml would be nice...)
>
>
> you can register node types by calling
>
> NodeTypeRegistry.registerNodeType(NodeTypeDef).
>
> here's how you get the NodeTypeRegistry object:
>
> Workspace wsp = session.getWorkspace();
> NodeTypeManager ntMgr = wsp.getNodeTypeManager();
> NodeTypeRegistry ntReg =
> ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
>
> node type registration is not covered by the jsr-170 spec
> but it's nonetheless available in jackrabbit since day 0.
>
> btw: custom_nodetypes.xml should never be manipulated directly;
> otherwise you risk loosing your data.
>
>
>>- what about lazy-loading (what do I get with a node.getNodes(), when each
>>nodes has child nodes - is that configurable?
>
>
> that's nothing you have to worry about. it's up to the repository to
> implement this efficiently.
>
>
>>- what about concurrency? I haven't seen any assumptions about transactional
>>behavior in the jcr - if i got it right, it is up to the repository to
>>ensure that no nodes are deleted by B to which A adds nodes?!
>
>
> check out the jsr 170 specification. transaction support is described in detail.
> another feature to avoid the above descibed scenario is locking.
>
> cheers
> stefan
>
>
>>...
>>
>>Any hints on even the most unfinished documentation would be highly
>>appreciated! (I'll try to write down what you throw at me and maybe will try
>>to compile some how-tos from it...)
>>
>>Cheers
>>Stefan
>>
>>
>
>
Re: NodeTypes for Starters?!
Posted by Brian Moseley <bc...@osafoundation.org>.
Stefan Guggisberg wrote:
> On 6/10/05, Stefan Frank <s....@vierundsechzig.de> wrote:
>
>>- how to define custom-node-types (some explanations on the
>>custom_nodetypes.xml would be nice...)
>
>
> you can register node types by calling
>
> NodeTypeRegistry.registerNodeType(NodeTypeDef).
>
> here's how you get the NodeTypeRegistry object:
>
> Workspace wsp = session.getWorkspace();
> NodeTypeManager ntMgr = wsp.getNodeTypeManager();
> NodeTypeRegistry ntReg =
> ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
>
> node type registration is not covered by the jsr-170 spec
> but it's nonetheless available in jackrabbit since day 0.
i think there's probably a need for a tool that installs custom types
into jackrabbit as part of the process of initializing a repository.
one way to do it would a maven plugin or ant task that reads node type
definitions from an xml file. another could be an internal jackrabbit
component configured in repository.xml that reads the xml file at
repository init time and/or startup time.
thoughts?
Re: NodeTypes for Starters?!
Posted by Digby <li...@digby.net>.
I'm interested in wy
Stefan Guggisberg wrote:
> On 6/10/05, Stefan Frank <s....@vierundsechzig.de> wrote:
>
>>Hi,
>>
>>I'm new to jackrabbit, played a little with magnolia and now want to get my
>>hands dirty with jackrabbit. I intend to use jackrabbit as a repository for
>>digital assets (images, movies in different formats, pdf ...) - it looks
>>like jcr is a perfect fit for this kind of application. After reading all
>>the documents I could find (there is not so much on jackrabbit...), I had my
>>"Hello World!"-experience (node.setProperty("hello", new
>>StringValue("World!"));) - now I want to go all the way. Is there some more
>>documentation somewhere, apart from the jcr-Specification? Up to now, I only
>>found what's on the incubation-website and a brief article on artima.com.
>>
>>Being new to jackrabbit, of course I have lots of questions, eg.
>>
>>- how to define custom-node-types (some explanations on the
>>custom_nodetypes.xml would be nice...)
>
>
> you can register node types by calling
>
> NodeTypeRegistry.registerNodeType(NodeTypeDef).
>
> here's how you get the NodeTypeRegistry object:
>
> Workspace wsp = session.getWorkspace();
> NodeTypeManager ntMgr = wsp.getNodeTypeManager();
> NodeTypeRegistry ntReg =
> ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
>
> node type registration is not covered by the jsr-170 spec
> but it's nonetheless available in jackrabbit since day 0.
>
> btw: custom_nodetypes.xml should never be manipulated directly;
> otherwise you risk loosing your data.
>
>
>>- what about lazy-loading (what do I get with a node.getNodes(), when each
>>nodes has child nodes - is that configurable?
>
>
> that's nothing you have to worry about. it's up to the repository to
> implement this efficiently.
>
>
>>- what about concurrency? I haven't seen any assumptions about transactional
>>behavior in the jcr - if i got it right, it is up to the repository to
>>ensure that no nodes are deleted by B to which A adds nodes?!
>
>
> check out the jsr 170 specification. transaction support is described in detail.
> another feature to avoid the above descibed scenario is locking.
>
> cheers
> stefan
>
>
>>...
>>
>>Any hints on even the most unfinished documentation would be highly
>>appreciated! (I'll try to write down what you throw at me and maybe will try
>>to compile some how-tos from it...)
>>
>>Cheers
>>Stefan
>>
>>
>
>
Re: NodeTypes for Starters?!
Posted by Stefan Guggisberg <st...@gmail.com>.
On 6/10/05, Stefan Frank <s....@vierundsechzig.de> wrote:
> Hi,
>
> I'm new to jackrabbit, played a little with magnolia and now want to get my
> hands dirty with jackrabbit. I intend to use jackrabbit as a repository for
> digital assets (images, movies in different formats, pdf ...) - it looks
> like jcr is a perfect fit for this kind of application. After reading all
> the documents I could find (there is not so much on jackrabbit...), I had my
> "Hello World!"-experience (node.setProperty("hello", new
> StringValue("World!"));) - now I want to go all the way. Is there some more
> documentation somewhere, apart from the jcr-Specification? Up to now, I only
> found what's on the incubation-website and a brief article on artima.com.
>
> Being new to jackrabbit, of course I have lots of questions, eg.
>
> - how to define custom-node-types (some explanations on the
> custom_nodetypes.xml would be nice...)
you can register node types by calling
NodeTypeRegistry.registerNodeType(NodeTypeDef).
here's how you get the NodeTypeRegistry object:
Workspace wsp = session.getWorkspace();
NodeTypeManager ntMgr = wsp.getNodeTypeManager();
NodeTypeRegistry ntReg =
((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();
node type registration is not covered by the jsr-170 spec
but it's nonetheless available in jackrabbit since day 0.
btw: custom_nodetypes.xml should never be manipulated directly;
otherwise you risk loosing your data.
> - what about lazy-loading (what do I get with a node.getNodes(), when each
> nodes has child nodes - is that configurable?
that's nothing you have to worry about. it's up to the repository to
implement this efficiently.
> - what about concurrency? I haven't seen any assumptions about transactional
> behavior in the jcr - if i got it right, it is up to the repository to
> ensure that no nodes are deleted by B to which A adds nodes?!
check out the jsr 170 specification. transaction support is described in detail.
another feature to avoid the above descibed scenario is locking.
cheers
stefan
> ...
>
> Any hints on even the most unfinished documentation would be highly
> appreciated! (I'll try to write down what you throw at me and maybe will try
> to compile some how-tos from it...)
>
> Cheers
> Stefan
>
>