what does NodeTypeRegistry.reregisterNodeType() do?

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -

I've been able to add custom node types within the jackrabbit server app.

However, is it possible to add new properties to a node type that is already registered?

I first call isRegistered() to see if a nodeTypeName is registered, and if it is, I call
reregisterNodeType() in the hopes that it would re-register the node type with the new properties I have
added.

However, new properties do not seem to get registered.

What does reregisterNodeType() actually do?

Betty


Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Stefan Guggisberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi betty

On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...> wrote:

> Hi -
>
> I've been able to add custom node types within the jackrabbit server app.
>
> However, is it possible to add new properties to a node type that is already registered?
>
> I first call isRegistered() to see if a nodeTypeName is registered, and if it is, I call
> reregisterNodeType() in the hopes that it would re-register the node type with the new properties I have
> added.
>
> However, new properties do not seem to get registered.

you can only register 'trivial' node type changes, i.e. changes that
do not affect existing content.

a trivial change would e.g. be adding a non-mandatory property.

a non-trivial (and thus non-supported change) would e.g. be adding a
mandatory property
or adding a value constraint to an existing property definition.

what exactly are you trying to change?

>
> What does reregisterNodeType() actually do?

reregisterNodeType() allows to modify the definition of
an existing, already registered node type. only trivial
changes are currently supported.

for more details see:
http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
http://issues.apache.org/jira/browse/JCR-322.

cheers
stefan

>
> Betty
>
>

Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi --

I was trying to just add another string property, and I did not specify
"mandatory" in my .cnd file, so does that mean it is
non-mandatory?

I did a dump after the re-register, but the new property does not show up
under  /jcr:system/jcr:nodeTypes anywhere, and
I cannot seem to set it when I add my node.

Thanks

Betty

----- Original Message -----
From: "Stefan Guggisberg" <stefan.guggisberg@...>
To: <users@...>
Sent: Thursday, July 24, 2008 2:21 AM
Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?


> hi betty
>
> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...> wrote:
>> Hi -
>>
>> I've been able to add custom node types within the jackrabbit server app.
>>
>> However, is it possible to add new properties to a node type that is
>> already registered?
>>
>> I first call isRegistered() to see if a nodeTypeName is registered, and
>> if it is, I call
>> reregisterNodeType() in the hopes that it would re-register the node type
>> with the new properties I have
>> added.
>>
>> However, new properties do not seem to get registered.
>
> you can only register 'trivial' node type changes, i.e. changes that
> do not affect existing content.
>
> a trivial change would e.g. be adding a non-mandatory property.
>
> a non-trivial (and thus non-supported change) would e.g. be adding a
> mandatory property
> or adding a value constraint to an existing property definition.
>
> what exactly are you trying to change?
>
>>
>> What does reregisterNodeType() actually do?
>
> reregisterNodeType() allows to modify the definition of
> an existing, already registered node type. only trivial
> changes are currently supported.
>
> for more details see:
> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
> http://issues.apache.org/jira/browse/JCR-322.
>
> cheers
> stefan
>
>>
>> Betty
>>
>>
>


Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Stefan Guggisberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 24, 2008 at 8:19 PM, Betty Chang <bchang@...> wrote:
> Hi --
>
> I was trying to just add another string property, and I did not specify
> "mandatory" in my .cnd file, so does that mean it is
> non-mandatory?

yes

>
> I did a dump after the re-register, but the new property does not show up
> under  /jcr:system/jcr:nodeTypes anywhere, and
> I cannot seem to set it when I add my node.

could you please provide some sample code?

cheers
stefan

>
> Thanks
>
> Betty
>
> ----- Original Message ----- From: "Stefan Guggisberg"
> <stefan.guggisberg@...>
> To: <users@...>
> Sent: Thursday, July 24, 2008 2:21 AM
> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>
>
>> hi betty
>>
>> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...> wrote:
>>>
>>> Hi -
>>>
>>> I've been able to add custom node types within the jackrabbit server app.
>>>
>>> However, is it possible to add new properties to a node type that is
>>> already registered?
>>>
>>> I first call isRegistered() to see if a nodeTypeName is registered, and
>>> if it is, I call
>>> reregisterNodeType() in the hopes that it would re-register the node type
>>> with the new properties I have
>>> added.
>>>
>>> However, new properties do not seem to get registered.
>>
>> you can only register 'trivial' node type changes, i.e. changes that
>> do not affect existing content.
>>
>> a trivial change would e.g. be adding a non-mandatory property.
>>
>> a non-trivial (and thus non-supported change) would e.g. be adding a
>> mandatory property
>> or adding a value constraint to an existing property definition.
>>
>> what exactly are you trying to change?
>>
>>>
>>> What does reregisterNodeType() actually do?
>>
>> reregisterNodeType() allows to modify the definition of
>> an existing, already registered node type. only trivial
>> changes are currently supported.
>>
>> for more details see:
>>
>> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
>> http://issues.apache.org/jira/browse/JCR-322.
>>
>> cheers
>> stefan
>>
>>>
>>> Betty
>>>
>>>
>>
>
>

Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


----- Original Message -----
From: "Stefan Guggisberg" <stefan.guggisberg@...>
To: <users@...>
Sent: Friday, July 25, 2008 1:43 AM
Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?


> On Thu, Jul 24, 2008 at 8:19 PM, Betty Chang <bchang@...> wrote:
>> Hi --
>>
>> I was trying to just add another string property, and I did not specify
>> "mandatory" in my .cnd file, so does that mean it is
>> non-mandatory?
>
> yes
>
>>
>> I did a dump after the re-register, but the new property does not show up
>> under  /jcr:system/jcr:nodeTypes anywhere, and
>> I cannot seem to set it when I add my node.
>
> could you please provide some sample code?
>
> cheers
> stefan
>
>>
>> Thanks
>>
>> Betty
>>
>> ----- Original Message ----- From: "Stefan Guggisberg"
>> <stefan.guggisberg@...>
>> To: <users@...>
>> Sent: Thursday, July 24, 2008 2:21 AM
>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>
>>
>>> hi betty
>>>
>>> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...>
>>> wrote:
>>>>
>>>> Hi -
>>>>
>>>> I've been able to add custom node types within the jackrabbit server
>>>> app.
>>>>
>>>> However, is it possible to add new properties to a node type that is
>>>> already registered?
>>>>
>>>> I first call isRegistered() to see if a nodeTypeName is registered, and
>>>> if it is, I call
>>>> reregisterNodeType() in the hopes that it would re-register the node
>>>> type
>>>> with the new properties I have
>>>> added.
>>>>
>>>> However, new properties do not seem to get registered.
>>>
>>> you can only register 'trivial' node type changes, i.e. changes that
>>> do not affect existing content.
>>>
>>> a trivial change would e.g. be adding a non-mandatory property.
>>>
>>> a non-trivial (and thus non-supported change) would e.g. be adding a
>>> mandatory property
>>> or adding a value constraint to an existing property definition.
>>>
>>> what exactly are you trying to change?
>>>
>>>>
>>>> What does reregisterNodeType() actually do?
>>>
>>> reregisterNodeType() allows to modify the definition of
>>> an existing, already registered node type. only trivial
>>> changes are currently supported.
>>>
>>> for more details see:
>>>
>>> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
>>> http://issues.apache.org/jira/browse/JCR-322.
>>>
>>> cheers
>>> stefan
>>>
>>>>
>>>> Betty
>>>>
>>>>
>>>
>>
>>
>


Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -- Did you wish to see sample code on the server side where I do the
re-register, or on the
client side where I read the stuff?

Betty

----- Original Message -----
From: "Stefan Guggisberg" <stefan.guggisberg@...>
To: <users@...>
Sent: Friday, July 25, 2008 1:43 AM
Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?


> On Thu, Jul 24, 2008 at 8:19 PM, Betty Chang <bchang@...> wrote:
>> Hi --
>>
>> I was trying to just add another string property, and I did not specify
>> "mandatory" in my .cnd file, so does that mean it is
>> non-mandatory?
>
> yes
>
>>
>> I did a dump after the re-register, but the new property does not show up
>> under  /jcr:system/jcr:nodeTypes anywhere, and
>> I cannot seem to set it when I add my node.
>
> could you please provide some sample code?
>
> cheers
> stefan
>
>>
>> Thanks
>>
>> Betty
>>
>> ----- Original Message ----- From: "Stefan Guggisberg"
>> <stefan.guggisberg@...>
>> To: <users@...>
>> Sent: Thursday, July 24, 2008 2:21 AM
>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>
>>
>>> hi betty
>>>
>>> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...>
>>> wrote:
>>>>
>>>> Hi -
>>>>
>>>> I've been able to add custom node types within the jackrabbit server
>>>> app.
>>>>
>>>> However, is it possible to add new properties to a node type that is
>>>> already registered?
>>>>
>>>> I first call isRegistered() to see if a nodeTypeName is registered, and
>>>> if it is, I call
>>>> reregisterNodeType() in the hopes that it would re-register the node
>>>> type
>>>> with the new properties I have
>>>> added.
>>>>
>>>> However, new properties do not seem to get registered.
>>>
>>> you can only register 'trivial' node type changes, i.e. changes that
>>> do not affect existing content.
>>>
>>> a trivial change would e.g. be adding a non-mandatory property.
>>>
>>> a non-trivial (and thus non-supported change) would e.g. be adding a
>>> mandatory property
>>> or adding a value constraint to an existing property definition.
>>>
>>> what exactly are you trying to change?
>>>
>>>>
>>>> What does reregisterNodeType() actually do?
>>>
>>> reregisterNodeType() allows to modify the definition of
>>> an existing, already registered node type. only trivial
>>> changes are currently supported.
>>>
>>> for more details see:
>>>
>>> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
>>> http://issues.apache.org/jira/browse/JCR-322.
>>>
>>> cheers
>>> stefan
>>>
>>>>
>>>> Betty
>>>>
>>>>
>>>
>>
>>
>


Is it possible to version few selected properties of node?

by Sangeeta-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I have node type with following structure.
book:file  and book:folder  extends book:node.

When I make an node as node:file , is it possible to make property of
book:node non- versionable and property of book:file as versionable.
Basically user can change name, path title ...without making versions but
when book:content is changed, node should be versioned.



[book:node] > nt:base
- book:name (string) mandatory
- book:path (string)  
- book:title (string)
- book:nodeType (string)
- book:description (string)
- book:reportID (string)
- book:createdDate (date)
- book:publishedDate (date)
- book:unPublishedDate (date)
- book:region (string)
- book:department (string)
- book:language (string)
- book:organizationID (string)
- book:keywords (string)
- book:securityRoles (string)multiple

[book:file] >  book:node
- book:content (binary)  
- book:contentTxt (string)


[book:folder] >  book:node
+ * = book:file multiple

Thanks
Sangeeta


Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Stefan Guggisberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi betty

On Fri, Jul 25, 2008 at 10:00 PM, Betty Chang <bchang@...> wrote:
> Hi -- Did you wish to see sample code on the server side where I do the
> re-register, or on the
> client side where I read the stuff?

both if possible.

BTW: what protocol are you using for remotely accessing the repository?

cheers
stefan

>
> Betty
>
> ----- Original Message ----- From: "Stefan Guggisberg"
> <stefan.guggisberg@...>
> To: <users@...>
> Sent: Friday, July 25, 2008 1:43 AM
> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>
>
>> On Thu, Jul 24, 2008 at 8:19 PM, Betty Chang <bchang@...> wrote:
>>>
>>> Hi --
>>>
>>> I was trying to just add another string property, and I did not specify
>>> "mandatory" in my .cnd file, so does that mean it is
>>> non-mandatory?
>>
>> yes
>>
>>>
>>> I did a dump after the re-register, but the new property does not show up
>>> under  /jcr:system/jcr:nodeTypes anywhere, and
>>> I cannot seem to set it when I add my node.
>>
>> could you please provide some sample code?
>>
>> cheers
>> stefan
>>
>>>
>>> Thanks
>>>
>>> Betty
>>>
>>> ----- Original Message ----- From: "Stefan Guggisberg"
>>> <stefan.guggisberg@...>
>>> To: <users@...>
>>> Sent: Thursday, July 24, 2008 2:21 AM
>>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>>
>>>
>>>> hi betty
>>>>
>>>> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...>
>>>> wrote:
>>>>>
>>>>> Hi -
>>>>>
>>>>> I've been able to add custom node types within the jackrabbit server
>>>>> app.
>>>>>
>>>>> However, is it possible to add new properties to a node type that is
>>>>> already registered?
>>>>>
>>>>> I first call isRegistered() to see if a nodeTypeName is registered, and
>>>>> if it is, I call
>>>>> reregisterNodeType() in the hopes that it would re-register the node
>>>>> type
>>>>> with the new properties I have
>>>>> added.
>>>>>
>>>>> However, new properties do not seem to get registered.
>>>>
>>>> you can only register 'trivial' node type changes, i.e. changes that
>>>> do not affect existing content.
>>>>
>>>> a trivial change would e.g. be adding a non-mandatory property.
>>>>
>>>> a non-trivial (and thus non-supported change) would e.g. be adding a
>>>> mandatory property
>>>> or adding a value constraint to an existing property definition.
>>>>
>>>> what exactly are you trying to change?
>>>>
>>>>>
>>>>> What does reregisterNodeType() actually do?
>>>>
>>>> reregisterNodeType() allows to modify the definition of
>>>> an existing, already registered node type. only trivial
>>>> changes are currently supported.
>>>>
>>>> for more details see:
>>>>
>>>>
>>>> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
>>>> http://issues.apache.org/jira/browse/JCR-322.
>>>>
>>>> cheers
>>>> stefan
>>>>
>>>>>
>>>>> Betty
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>

Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi --

I got side-tracked a bit, but I will try to put together a code snippet.

In answer to the protocol question,  the remote client uses the spi webdav
interface

Betty

----- Original Message -----
From: "Stefan Guggisberg" <stefan.guggisberg@...>
To: <users@...>
Sent: Monday, July 28, 2008 5:28 AM
Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?


> hi betty
>
> On Fri, Jul 25, 2008 at 10:00 PM, Betty Chang <bchang@...>
> wrote:
>> Hi -- Did you wish to see sample code on the server side where I do the
>> re-register, or on the
>> client side where I read the stuff?
>
> both if possible.
>
> BTW: what protocol are you using for remotely accessing the repository?
>
> cheers
> stefan
>
>>
>> Betty
>>
>> ----- Original Message ----- From: "Stefan Guggisberg"
>> <stefan.guggisberg@...>
>> To: <users@...>
>> Sent: Friday, July 25, 2008 1:43 AM
>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>
>>
>>> On Thu, Jul 24, 2008 at 8:19 PM, Betty Chang <bchang@...>
>>> wrote:
>>>>
>>>> Hi --
>>>>
>>>> I was trying to just add another string property, and I did not specify
>>>> "mandatory" in my .cnd file, so does that mean it is
>>>> non-mandatory?
>>>
>>> yes
>>>
>>>>
>>>> I did a dump after the re-register, but the new property does not show
>>>> up
>>>> under  /jcr:system/jcr:nodeTypes anywhere, and
>>>> I cannot seem to set it when I add my node.
>>>
>>> could you please provide some sample code?
>>>
>>> cheers
>>> stefan
>>>
>>>>
>>>> Thanks
>>>>
>>>> Betty
>>>>
>>>> ----- Original Message ----- From: "Stefan Guggisberg"
>>>> <stefan.guggisberg@...>
>>>> To: <users@...>
>>>> Sent: Thursday, July 24, 2008 2:21 AM
>>>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>>>
>>>>
>>>>> hi betty
>>>>>
>>>>> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...>
>>>>> wrote:
>>>>>>
>>>>>> Hi -
>>>>>>
>>>>>> I've been able to add custom node types within the jackrabbit server
>>>>>> app.
>>>>>>
>>>>>> However, is it possible to add new properties to a node type that is
>>>>>> already registered?
>>>>>>
>>>>>> I first call isRegistered() to see if a nodeTypeName is registered,
>>>>>> and
>>>>>> if it is, I call
>>>>>> reregisterNodeType() in the hopes that it would re-register the node
>>>>>> type
>>>>>> with the new properties I have
>>>>>> added.
>>>>>>
>>>>>> However, new properties do not seem to get registered.
>>>>>
>>>>> you can only register 'trivial' node type changes, i.e. changes that
>>>>> do not affect existing content.
>>>>>
>>>>> a trivial change would e.g. be adding a non-mandatory property.
>>>>>
>>>>> a non-trivial (and thus non-supported change) would e.g. be adding a
>>>>> mandatory property
>>>>> or adding a value constraint to an existing property definition.
>>>>>
>>>>> what exactly are you trying to change?
>>>>>
>>>>>>
>>>>>> What does reregisterNodeType() actually do?
>>>>>
>>>>> reregisterNodeType() allows to modify the definition of
>>>>> an existing, already registered node type. only trivial
>>>>> changes are currently supported.
>>>>>
>>>>> for more details see:
>>>>>
>>>>>
>>>>> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
>>>>> http://issues.apache.org/jira/browse/JCR-322.
>>>>>
>>>>> cheers
>>>>> stefan
>>>>>
>>>>>>
>>>>>> Betty
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>


Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Stefan Guggisberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi betty

On Tue, Jul 29, 2008 at 8:13 PM, Betty Chang <bchang@...> wrote:
> Hi --
>
> I got side-tracked a bit, but I will try to put together a code snippet.
>
> In answer to the protocol question,  the remote client uses the spi webdav
> interface

ah, i see. that explains it. this is probably a caching issue of the spi layer.
please feel free to create a jira issue. you can attach your sample code to
that issue.

thanks
stefan

>
> Betty
>
> ----- Original Message ----- From: "Stefan Guggisberg"
> <stefan.guggisberg@...>
> To: <users@...>
> Sent: Monday, July 28, 2008 5:28 AM
> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>
>
>> hi betty
>>
>> On Fri, Jul 25, 2008 at 10:00 PM, Betty Chang <bchang@...>
>> wrote:
>>>
>>> Hi -- Did you wish to see sample code on the server side where I do the
>>> re-register, or on the
>>> client side where I read the stuff?
>>
>> both if possible.
>>
>> BTW: what protocol are you using for remotely accessing the repository?
>>
>> cheers
>> stefan
>>
>>>
>>> Betty
>>>
>>> ----- Original Message ----- From: "Stefan Guggisberg"
>>> <stefan.guggisberg@...>
>>> To: <users@...>
>>> Sent: Friday, July 25, 2008 1:43 AM
>>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>>
>>>
>>>> On Thu, Jul 24, 2008 at 8:19 PM, Betty Chang <bchang@...>
>>>> wrote:
>>>>>
>>>>> Hi --
>>>>>
>>>>> I was trying to just add another string property, and I did not specify
>>>>> "mandatory" in my .cnd file, so does that mean it is
>>>>> non-mandatory?
>>>>
>>>> yes
>>>>
>>>>>
>>>>> I did a dump after the re-register, but the new property does not show
>>>>> up
>>>>> under  /jcr:system/jcr:nodeTypes anywhere, and
>>>>> I cannot seem to set it when I add my node.
>>>>
>>>> could you please provide some sample code?
>>>>
>>>> cheers
>>>> stefan
>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Betty
>>>>>
>>>>> ----- Original Message ----- From: "Stefan Guggisberg"
>>>>> <stefan.guggisberg@...>
>>>>> To: <users@...>
>>>>> Sent: Thursday, July 24, 2008 2:21 AM
>>>>> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>>>>>
>>>>>
>>>>>> hi betty
>>>>>>
>>>>>> On Thu, Jul 24, 2008 at 1:22 AM, Betty Chang <bchang@...>
>>>>>> wrote:
>>>>>>>
>>>>>>> Hi -
>>>>>>>
>>>>>>> I've been able to add custom node types within the jackrabbit server
>>>>>>> app.
>>>>>>>
>>>>>>> However, is it possible to add new properties to a node type that is
>>>>>>> already registered?
>>>>>>>
>>>>>>> I first call isRegistered() to see if a nodeTypeName is registered,
>>>>>>> and
>>>>>>> if it is, I call
>>>>>>> reregisterNodeType() in the hopes that it would re-register the node
>>>>>>> type
>>>>>>> with the new properties I have
>>>>>>> added.
>>>>>>>
>>>>>>> However, new properties do not seem to get registered.
>>>>>>
>>>>>> you can only register 'trivial' node type changes, i.e. changes that
>>>>>> do not affect existing content.
>>>>>>
>>>>>> a trivial change would e.g. be adding a non-mandatory property.
>>>>>>
>>>>>> a non-trivial (and thus non-supported change) would e.g. be adding a
>>>>>> mandatory property
>>>>>> or adding a value constraint to an existing property definition.
>>>>>>
>>>>>> what exactly are you trying to change?
>>>>>>
>>>>>>>
>>>>>>> What does reregisterNodeType() actually do?
>>>>>>
>>>>>> reregisterNodeType() allows to modify the definition of
>>>>>> an existing, already registered node type. only trivial
>>>>>> changes are currently supported.
>>>>>>
>>>>>> for more details see:
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://jackrabbit.apache.org/api-1/org/apache/jackrabbit/core/nodetype/NodeTypeDefDiff.html
>>>>>> http://issues.apache.org/jira/browse/JCR-322.
>>>>>>
>>>>>> cheers
>>>>>> stefan
>>>>>>
>>>>>>>
>>>>>>> Betty
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>

Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Angela Schreiber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>> In answer to the protocol question,  the remote client uses the spi webdav
>> interface

> ah, i see. that explains it. this is probably a caching issue of the spi layer.

the SPI layer does not support nodetype registration
anyway, since this a jackrabbit specific extension
and not part of the JCR API.
how did you register the nodetype?

> please feel free to create a jira issue.

before you create an issue, i'd like to understand
how you registered the nodetype.

angela

Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -- I'm doing the nodetype registration on the server side as a servlet.
Originally,
I did it in a separate webapp in the same tomcat server
as the jackrabbit server, then I changed it to a servlet within the
jackrabbit webapp.
I configured the servlet to load on startup after all other startup
servlets.  It reads in the .CND file, checks if a nodetype
already exists, and if so, it re-registers it.  If not, it just registers
it.

My client programs are able to add to the repository using these custom node
types and they show up under
jcr:system/jcr:nodeTypes in the tree.

I can add a new node type to the CND file, restart the tomcat, and the new
node type shows up in the dump on
the client side.
However, if I add a new property to an existing node type, the new property
does not show up.

I'm not sure why it would be a caching issue, because my client program is
just a little test program that can dump out all
the nodes and I run it fresh everytime.

Betty

----- Original Message -----
From: "Angela Schreiber" <anchela@...>
To: <users@...>
Sent: Wednesday, July 30, 2008 2:10 AM
Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?


>
>>> In answer to the protocol question,  the remote client uses the spi
>>> webdav
>>> interface
>
>> ah, i see. that explains it. this is probably a caching issue of the spi
>> layer.
>
> the SPI layer does not support nodetype registration
> anyway, since this a jackrabbit specific extension
> and not part of the JCR API.
> how did you register the nodetype?
>
>> please feel free to create a jira issue.
>
> before you create an issue, i'd like to understand
> how you registered the nodetype.
>
> angela
>


Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -- I've attached a couple of pieces of code.  The servlet is the code
that registers or re-registers the node types.  I run it
in the same webapp as jackrabbit, and have it load on startup after
everything else.
The dumpsnippet.java is from a test program that just dumps the nodes.   I
call it at the "/jcr.system/jcr.nodeTypes" level
  to see all the node types and their properties.   This is run via the spi
webdav interface.

I can add node types to the CND file and restart tomcat and all is well, but
adding non-mandatory properties to an
exisiting node type does not seem to do anything.

Thanks

Betty

----- Original Message -----
From: "Betty Chang" <bchang@...>
To: <users@...>
Sent: Wednesday, July 30, 2008 12:13 PM
Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?


> Hi -- I'm doing the nodetype registration on the server side as a servlet.
> Originally,
> I did it in a separate webapp in the same tomcat server
> as the jackrabbit server, then I changed it to a servlet within the
> jackrabbit webapp.
> I configured the servlet to load on startup after all other startup
> servlets.  It reads in the .CND file, checks if a nodetype
> already exists, and if so, it re-registers it.  If not, it just registers
> it.
>
> My client programs are able to add to the repository using these custom
> node types and they show up under
> jcr:system/jcr:nodeTypes in the tree.
>
> I can add a new node type to the CND file, restart the tomcat, and the new
> node type shows up in the dump on
> the client side.
> However, if I add a new property to an existing node type, the new
> property does not show up.
>
> I'm not sure why it would be a caching issue, because my client program is
> just a little test program that can dump out all
> the nodes and I run it fresh everytime.
>
> Betty
>
> ----- Original Message -----
> From: "Angela Schreiber" <anchela@...>
> To: <users@...>
> Sent: Wednesday, July 30, 2008 2:10 AM
> Subject: Re: what does NodeTypeRegistry.reregisterNodeType() do?
>
>
>>
>>>> In answer to the protocol question,  the remote client uses the spi
>>>> webdav
>>>> interface
>>
>>> ah, i see. that explains it. this is probably a caching issue of the spi
>>> layer.
>>
>> the SPI layer does not support nodetype registration
>> anyway, since this a jackrabbit specific extension
>> and not part of the JCR API.
>> how did you register the nodetype?
>>
>>> please feel free to create a jira issue.
>>
>> before you create an issue, i'd like to understand
>> how you registered the nodetype.
>>
>> angela
>>
>
>

Re: what does NodeTypeRegistry.reregisterNodeType() do?

by Betty Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi --  my attachments did not  appear.  Let me try that again with just code
inserted.

Here's the servlet code that registers or re-registers node types:

===========================================

public class NodeTypeConfigServlet extends HttpServlet{

 /**
  * default logger
  */
 private static final Logger log =
LoggerFactory.getLogger(NodeTypeConfigServlet.class);

 static final String NODETYPE_CND_FILE_NAME="edgeNodeTypes.cnd";
 static final String EDGE_NAMESPACE_URI="http://www.edgenuity.com/edge";
 static final String EDGE_PREFIX="edge";
 static final String SUPERUSER_USER="admin";
 static final String SUPERUSER_PW ="admin";

 private Repository repository = null;

 public void init() throws ServletException {
  super.init();
  CompactNodeTypeDefReader cndReader;

  try {
   //repository = rf.getRepository();
   repository = new ServletRepository(this);

   char[] pwarr = SUPERUSER_PW.toCharArray();
   SimpleCredentials sc = new SimpleCredentials(SUPERUSER_USER,pwarr);
   Session session = repository.login(sc, null);
   Workspace ws = session.getWorkspace();
   NamespaceRegistry nsReg = ws.getNamespaceRegistry();
   try {
    String uri = nsReg.getURI(EDGE_PREFIX);
    log.info("Prefix "+EDGE_PREFIX+" has already been registered under URI
of "+uri);

   } catch(NamespaceException nex) {
    // prefix is not mapped, so register it
    nsReg.registerNamespace(EDGE_PREFIX, EDGE_NAMESPACE_URI);
   }

   // Read in the CND file
   InputStreamReader rd = new
InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(NODETYPE_CND_FILE_NAME));
   //
   // Create a CompactNodeTypeDefReader
   cndReader = new CompactNodeTypeDefReader(rd, NODETYPE_CND_FILE_NAME);

   // Get the List of NodeTypeDef objects
   List ntdList = cndReader.getNodeTypeDefs();

   // Get the NodeTypeManager from the Workspace.
   // Note that it must be cast from the generic JCR NodeTypeManager to the
   // Jackrabbit-specific implementation.
   NodeTypeManagerImpl ntmgr =(NodeTypeManagerImpl)ws.getNodeTypeManager();

   // Acquire the NodeTypeRegistry
   NodeTypeRegistry ntreg = ntmgr.getNodeTypeRegistry();


   // Loop through the prepared NodeTypeDefs
   for (Iterator i = ntdList.iterator(); i.hasNext();) {

    // Get the NodeTypeDef...
    NodeTypeDef ntd = (NodeTypeDef)i.next();

    log.info("----NODE TYPE DEF node name="+ntd.getName());
    // register it if it is not already registered
    if (ntreg.isRegistered(ntd.getName())) {
      log.info("Node type "+ntd.getName()+ " is already registered -- it
will be re-registered in case properties have been changed");
    }

    else {
     log.info("Node type "+ntd.getName()+" wil be registered ");
     ntreg.registerNodeType(ntd);
    }
   }

  }
  catch (NamespaceException nex) {
   throw new ServletException(nex);
  }
  catch (RepositoryException ex) {
   throw new ServletException(ex);
  }
  catch (org.apache.jackrabbit.core.nodetype.compact.ParseException pex) {
   throw new ServletException(pex);
  }
  catch (org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException
iex) {
   throw new ServletException(iex);
  }
 }
}

======================================================
and here's the snippet that dumps out nodes on the client side via the spi
webdav interface:

private void dump(Node node, boolean expandBin) throws RepositoryException
  {
    System.out.println("NODE = "+node.getPath());
    PropertyIterator properties = node.getProperties();
    Property property = null;
    while (properties.hasNext()) {
 property = properties.nextProperty();
 System.out.print("----Property "+property.getPath() + "=");