You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Michael Shoener <ms...@softwareapps.net> on 2009/09/08 23:12:15 UTC

Explain custom node type setup

I have read all types of documentation and websites and still cannot figure
out custom nodes.

I have been working with jackrabbit 1.6.0 and have the following questions
regarding custom nodes:

	1. Where exactly do I define the custom node types and what should
the file be named?
	2. In what format should the file be in? (XML, CND notation)
	3. Will the "RepositoryStartup" load the file for me or do I have to
manually load it, and if so how to load it.
	3. I would like to be able to allow any number of property names for
my custom node type (run-time definable).
	
Any help would be appreciated.


Best Regards,

Michael Shoener
Support Staff
Software Application Services, Inc.



RE: Explain custom node type setup

Posted by Michael Shoener <ms...@softwareapps.net>.
Thank you for the links, that helps.

Now I guess what I am not understanding is that we would like to use
Jackrabbit as part of our application but do we just use the default
Jackrabbit webapp or do we create our own servlet to do everything?

If we have to create our own servlet then where is a good place to start?


Best Regards,

Michael Shoener
Support Staff
Software Application Services, Inc.


-----Original Message-----
From: Alexander Klimetschek [mailto:aklimets@day.com] 
Sent: Tuesday, September 08, 2009 6:36 PM
To: users@jackrabbit.apache.org
Subject: Re: Explain custom node type setup

On Tue, Sep 8, 2009 at 23:12, Michael Shoener<ms...@softwareapps.net>
wrote:
> I have been working with jackrabbit 1.6.0 and have the following 
> questions regarding custom nodes:
>
>        1. Where exactly do I define the custom node types and what 
> should the file be named?

Normally, you'd use the jackrabbit api to load your node types. See
http://jackrabbit.apache.org/node-types.html (code at the bottom).

>        2. In what format should the file be in? (XML, CND notation)

The Jackrabbit API allows for both formats, but I'd use CND, as JCR 2.0 will
only use CND and it's much easier to edit and read.

>        3. Will the "RepositoryStartup" load the file for me or do I 
> have to manually load it, and if so how to load it.

See above. You would manually load it in your startup code (and eg.
ignore any node type already exists exception).

>        3. I would like to be able to allow any number of property 
> names for my custom node type (run-time definable).

Sure, just define so-called residual properties, using a wildcard (*).
But it's good practice to extend from nt:unstructured, which has the same
result. You can still define specific properties, that won't be enforced
anymore, but can act as a template / guide for all kinds of jcr tools.

See also http://jackrabbit.apache.org/node-type-notation.html

Regards,
Alex

--
Alexander Klimetschek
alexander.klimetschek@day.com


Re: Explain custom node type setup

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Sep 8, 2009 at 23:12, Michael Shoener<ms...@softwareapps.net> wrote:
> I have been working with jackrabbit 1.6.0 and have the following questions
> regarding custom nodes:
>
>        1. Where exactly do I define the custom node types and what should
> the file be named?

Normally, you'd use the jackrabbit api to load your node types. See
http://jackrabbit.apache.org/node-types.html (code at the bottom).

>        2. In what format should the file be in? (XML, CND notation)

The Jackrabbit API allows for both formats, but I'd use CND, as JCR
2.0 will only use CND and it's much easier to edit and read.

>        3. Will the "RepositoryStartup" load the file for me or do I have to
> manually load it, and if so how to load it.

See above. You would manually load it in your startup code (and eg.
ignore any node type already exists exception).

>        3. I would like to be able to allow any number of property names for
> my custom node type (run-time definable).

Sure, just define so-called residual properties, using a wildcard (*).
But it's good practice to extend from nt:unstructured, which has the
same result. You can still define specific properties, that won't be
enforced anymore, but can act as a template / guide for all kinds of
jcr tools.

See also http://jackrabbit.apache.org/node-type-notation.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com