You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Stefan Seifert <ss...@pro-vision.de> on 2009/03/17 00:03:23 UTC

re-registering node type definitions on bundle deploy

with using manifest headers like

Sling-Namespaces: pvplayground=http://www.playground.org/playground/1.0
Sling-Nodetypes: SLING-INF/content/apps/playground/nodetypes/playground.cnd

it is possible to automatically register namespaces and node types when the bundle jar is deployed into sling.
unfortunately node types are not re-registered if a new version of the bundle is deployed (and they are not unregistered if the bundle is undeployed, but this is perhaps by design to avoid conflicts with existing content). but the lack of re-registering support really limits this feature preventing deployment of updated content type definitions.

the jackrabbit implementation seems to support re-registering (see http://issues.apache.org/jira/browse/JCR-545), but unfortunately not via the interface JackrabbitNodeTypeManager, but only in the implementation class NodeTypeManagerImpl:
registerNodeTypes(InputStream, String, boolean)

setting the third parameter to true should re-register the content types.

the registering of node types in sling is done in org.apache.sling.jcr.base.NodeTypeLoader - a workaround could be to try to cast the node type manager to NodeTypeManagerImpl and call this alterantive method directly.

wdyt?

stefan


Re: re-registering node type definitions on bundle deploy

Posted by Dominik Süß <do...@gmail.com>.
If  re-registering (only) fails when there are conflicts this might by the
intended and sufficient behaviour.
It would be possible to extend nodetypes by bundle-deployment in a running
system or remove unused (/empty) atttributes.
Only if there are any conflicts the reregistering should fail with an
error/warning.

Wdyt?

Regards,
Dominik


On Tue, Mar 17, 2009 at 8:55 AM, Alexander Klimetschek <ak...@day.com>wrote:

> On Tue, Mar 17, 2009 at 12:03 AM, Stefan Seifert <ss...@pro-vision.de>
> wrote:
> > with using manifest headers like
> >
> > Sling-Namespaces: pvplayground=http://www.playground.org/playground/1.0
> > Sling-Nodetypes:
> SLING-INF/content/apps/playground/nodetypes/playground.cnd
> >
> > it is possible to automatically register namespaces and node types when
> the bundle jar is deployed into sling.
> > unfortunately node types are not re-registered if a new version of the
> bundle is deployed (and they are not unregistered if the bundle is
> undeployed, but this is perhaps by design to avoid conflicts with existing
> content). but the lack of re-registering support really limits this feature
> preventing deployment of updated content type definitions.
> >
> > the jackrabbit implementation seems to support re-registering (see
> http://issues.apache.org/jira/browse/JCR-545), but unfortunately not via
> the interface JackrabbitNodeTypeManager, but only in the implementation
> class NodeTypeManagerImpl:
> > registerNodeTypes(InputStream, String, boolean)
> >
> > setting the third parameter to true should re-register the content types.
> >
> > the registering of node types in sling is done in
> org.apache.sling.jcr.base.NodeTypeLoader - a workaround could be to try to
> cast the node type manager to NodeTypeManagerImpl and call this alterantive
> method directly.
>
> AFAIK that re-registering node types is only possible if no conflicts
> arise with existing content, therefore it's not something that could
> generally work (from Sling's point of view).
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>

Re: re-registering node type definitions on bundle deploy

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Mar 17, 2009 at 12:03 AM, Stefan Seifert <ss...@pro-vision.de> wrote:
> with using manifest headers like
>
> Sling-Namespaces: pvplayground=http://www.playground.org/playground/1.0
> Sling-Nodetypes: SLING-INF/content/apps/playground/nodetypes/playground.cnd
>
> it is possible to automatically register namespaces and node types when the bundle jar is deployed into sling.
> unfortunately node types are not re-registered if a new version of the bundle is deployed (and they are not unregistered if the bundle is undeployed, but this is perhaps by design to avoid conflicts with existing content). but the lack of re-registering support really limits this feature preventing deployment of updated content type definitions.
>
> the jackrabbit implementation seems to support re-registering (see http://issues.apache.org/jira/browse/JCR-545), but unfortunately not via the interface JackrabbitNodeTypeManager, but only in the implementation class NodeTypeManagerImpl:
> registerNodeTypes(InputStream, String, boolean)
>
> setting the third parameter to true should re-register the content types.
>
> the registering of node types in sling is done in org.apache.sling.jcr.base.NodeTypeLoader - a workaround could be to try to cast the node type manager to NodeTypeManagerImpl and call this alterantive method directly.

AFAIK that re-registering node types is only possible if no conflicts
arise with existing content, therefore it's not something that could
generally work (from Sling's point of view).

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com