jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: What is the use of Registering Node Types
Date Thu, 26 Feb 2009 15:33:05 GMT
On Thu, Feb 26, 2009 at 6:31 AM, Akil Ali <Akil.Ajani@cognizant.com> wrote:
>
> In my application i am not using any custom node type. all the node that are
> created are nt:unstructured but as per the following information
>
> Each Jackrabbit instance has a NodeTypeRegistry which is created on start-up
> and populated with the set of built-in node types (these include both those
> required by the JCR specification and others required by the Jackrabbit
> implementation).
> of http://jackrabbit.apache.org/node-types.html.
>
> do i need to create the CND file
>
> i have a CND file it looks like
> /* orig.namespaces */
> <mix = 'http://www.jcp.org/jcr/mix/1.0'>
> <nt = 'http://www.jcp.org/jcr/nt/1.0'>
> <jcr = 'http://www.jcp.org/jcr/1.0'>
>
> [nt:document] >  nt:file
> - jcr:description (string)
> - jcr:versionComment (string)
> - jcr:creationDate (date)
> - jcr:lastModified (date)
> - jcr:attachedFileName (string)
> - jcr:attachedFileSize (string)
> - jcr:creator (string)
> - jcr:modifier (string)
> - jcr:checkedOutBy (string)
> - jcr:title (string)
> - jcr:discussionComment (string)
> - jcr:commentBy (string)
>
> can you please help me to interpret this file. what my understanding is,we
> are trying to create a custom node called document that has the following
> properties
>
> - jcr:description (string)
> - jcr:versionComment (string)
> - jcr:creationDate (date)
> - jcr:lastModified (date)
> - jcr:attachedFileName (string)
> - jcr:attachedFileSize (string)
> - jcr:creator (string)
> - jcr:modifier (string)
> - jcr:checkedOutBy (string)
> - jcr:title (string)
> - jcr:discussionComment (string)
> - jcr:commentBy (string)
>
> Please correct me if i am wrong

Yes, you would register that cnd file through the node type registry.
But as Julian already noted, don't use the "jcr" or the "nt"
namespaces for custom nodes and properties. Use something like
"my:document" instead of "nt:document" and "my:discussionComment"
instead of "jcr:discussionComment", for example. For property names
it's mostly better to skip the namespace prefix alltogether, eg. have
"discussionComment".

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message