You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "Philipp Koetz, mVISE AG" <Ph...@mvise.de> on 2020/07/27 13:24:08 UTC

Node type definition update

Hallo oak devs and community,

we are currently looking for a way to update our node type definitions using the cnd file. First of all, we are using OAK 1.6.20.

In general we create our custom node types via a cnd file

                               NodeTypeRegistry.register(root, cndFileStream, "custom node types");

This worked mostly fine as long as we didn't had changes to these. Now we wanted to add an additional value to the value constrain, but on existing repositories, these changes are not applied.

We managed to change these by using the NodeTypeManager, defining the node type through a  NodeTypeTemplate and register it again.

                               NodeTypeTemplate mixin = nodeTypeManager.createNodeTypeTemplate();
                               ...
                               nodeTypeManager.registerNodeType(mixin, true);

My question now is, is there a way to update node type definitions also with the cnd file or do we have to us the NodeTypeManager for it and if there is a way, how can we archive this?

Mit freundlichen Grüßen / Kind regards
Philipp Koetz



Re: Node type definition update

Posted by Angela Schreiber <an...@adobe.com.INVALID>.
Hi Philipp

Looking at the code of NodeTypeRegistry.register it also ends up calling NodeTypeManager.registerNodeTypes. Without having a closer look I would expect this to work the same. But there might be subtle differences, which I am not aware of that explain the difference.

Would you be able to extract a test-case illustrating the problem and attach it to a bug report in the Oak JIRA? that would be great.

thanks and kind regards
Angela


________________________________
From: Philipp Koetz, mVISE AG <Ph...@mvise.de>
Sent: Monday, July 27, 2020 3:24 PM
To: oak-dev@jackrabbit.apache.org <oa...@jackrabbit.apache.org>
Subject: Node type definition update

Hallo oak devs and community,

we are currently looking for a way to update our node type definitions using the cnd file. First of all, we are using OAK 1.6.20.

In general we create our custom node types via a cnd file

                               NodeTypeRegistry.register(root, cndFileStream, "custom node types");

This worked mostly fine as long as we didn't had changes to these. Now we wanted to add an additional value to the value constrain, but on existing repositories, these changes are not applied.

We managed to change these by using the NodeTypeManager, defining the node type through a  NodeTypeTemplate and register it again.

                               NodeTypeTemplate mixin = nodeTypeManager.createNodeTypeTemplate();
                               ...
                               nodeTypeManager.registerNodeType(mixin, true);

My question now is, is there a way to update node type definitions also with the cnd file or do we have to us the NodeTypeManager for it and if there is a way, how can we archive this?

Mit freundlichen Grüßen / Kind regards
Philipp Koetz