You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Dirk V. Schesmer" <di...@mac.com> on 2006/04/23 17:29:57 UTC
How to unregister NodeTypes ?
Hello list,
I am trying to unregister a custom node type "myapp:User" by executing:
QName quName = new QName("myapp", "User");
NodeTypeManagerImpl ntMgr = (NodeTypeManagerImpl) session.getWorkspace
().getNodeTypeManager();
NodeTypeRegistry ntreg = ntMgr.getNodeTypeRegistry();
ntreg.unregisterNodeType(quName);
As a result when executing the code, I get reported
"javax.jcr.RepositoryException: not yet implemented"
Am I doing something incorrectly? If not, is there a work around ?
Thanks a lot,
Dirk V. Schesmer
Stuttgart/Germany
Re: How to unregister NodeTypes ?
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On 4/23/06, Dirk V. Schesmer <di...@mac.com> wrote:
> I am trying to unregister a custom node type "myapp:User" by executing:
> [...]
> As a result when executing the code, I get reported
> "javax.jcr.RepositoryException: not yet implemented"
>
> Am I doing something incorrectly? If not, is there a work around ?
Unfortunately node type modification or removal is not much supported
by Jackrabbit at the moment. The feature request JCR-322 is used to
track this issue.
The safest workaround to modifying or removing existing types is to
create a new repository and use the system view XML format to transfer
existing content.
BR,
Jukka Zitting
--
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development
Re: How to unregister NodeTypes ?
Posted by Tobias Bocanegra <to...@day.com>.
the proper unregistration of nodetypes is not fully implemented in
jackrabbit yet (as the exception mentions). the method that is missing
should provide a check, if any node still uses the respective
nodetype.
nevertheless, if you anyways want to unregister a nodetype, either:
1) shutdown the repository, edit the custom_nodetypes.xml, and restart it again
or
2) edit the NodeTypeRegistry.java and remove the exception in
"checkForReferencesInContent()" (around line 1719).
please note, that both solutions do not check if content exists that
use that nodetype.
regards, toby
On 4/23/06, Dirk V. Schesmer <di...@mac.com> wrote:
> Hello list,
>
> I am trying to unregister a custom node type "myapp:User" by executing:
>
> QName quName = new QName("myapp", "User");
> NodeTypeManagerImpl ntMgr = (NodeTypeManagerImpl) session.getWorkspace
> ().getNodeTypeManager();
> NodeTypeRegistry ntreg = ntMgr.getNodeTypeRegistry();
> ntreg.unregisterNodeType(quName);
>
> As a result when executing the code, I get reported
> "javax.jcr.RepositoryException: not yet implemented"
>
> Am I doing something incorrectly? If not, is there a work around ?
>
> Thanks a lot,
>
> Dirk V. Schesmer
> Stuttgart/Germany
>
--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---