You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Akil Ali <Ak...@cognizant.com> on 2009/02/26 06:31:34 UTC

What is the use of Registering Node Types

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
-- 
View this message in context: http://www.nabble.com/What-is-the-use-of-Registering-Node-Types-tp22218021p22218021.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: What is the use of Registering Node Types

Posted by Akil Ali <Ak...@cognizant.com>.
Hi Alex,
            i would be thankful to you, if you could reply for my previous
post 

1>Need your suggestion for the jackrabbit implementation.  
2>Help required to create jackrabbit repository from the options available
to me

Akil 



Alexander Klimetschek wrote:
> 
> On Thu, Feb 26, 2009 at 6:31 AM, Akil Ali <Ak...@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
> 
> 

-- 
View this message in context: http://www.nabble.com/What-is-the-use-of-Registering-Node-Types-tp22218021p22226751.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: What is the use of Registering Node Types

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Feb 26, 2009 at 6:31 AM, Akil Ali <Ak...@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

Re: What is the use of Registering Node Types

Posted by Julian Reschke <ju...@gmx.de>.
Akil Ali wrote:
> ...
> 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)
> ...

Unrelated to your question, but still: please do NOT put custom 
properties into the JCR namespace.

BR, Julian