You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2008/04/06 16:24:50 UTC

Script Resolution for JCR Nodes

Hi,

I'm currently writing a simple demo app and would like to call a
script to render a node based on a mixin. It's currently only possible
to use register the script for the primary node type or to use
the special sling:resourceType property.

What do you think about extending this to mixins? For instance, you 
could add a mixin to an nt:folder which adds additional data to this 
folder. If the mixin is available the folder is rendered differently.
I'm not sure if this is a good idea, therefore I would like to hear your 
input on this.

Supporting mixins here of course creates the problem if a node has more 
than one mixin etc. I could also argue if I'm already adding a mixin to 
the node, i can also add the sling:resourceType mixin as well.

WDYT?

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Script Resolution for JCR Nodes

Posted by Carsten Ziegeler <cz...@apache.org>.
Tobias Bocanegra wrote:
>>  I'm currently writing a simple demo app and would like to call a
>>  script to render a node based on a mixin. It's currently only possible
>>  to use register the script for the primary node type or to use
>>  the special sling:resourceType property.
>>
>>  What do you think about extending this to mixins? For instance, you could
>> add a mixin to an nt:folder which adds additional data to this folder. If
>> the mixin is available the folder is rendered differently.
>>  I'm not sure if this is a good idea, therefore I would like to hear your
>> input on this.
>>
>>  Supporting mixins here of course creates the problem if a node has more
>> than one mixin etc. I could also argue if I'm already adding a mixin to the
>> node, i can also add the sling:resourceType mixin as well.
> i think if the resolution rules are well defined for the nodetype
> hierarchy of a node, this is a good feature. this is not only cool for
> mixins but also for extended nodetypes. eg, when my:File extends
> nt:file i want the default nt:file script unless i create one for
> my:File.
> 
While I totally agree with you that this is a nice feature, rethinking 
this I guess it will lead to problems. There is no guaranteed order of 
mixins or super types. So you might have a different order on different 
installations - which obviously leads to problems.

I guess, I'll use the JcrDefaultResourceTypeProvider Bertrand added 
recently to solve my problem.

Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Script Resolution for JCR Nodes

Posted by Tobias Bocanegra <to...@day.com>.
>  I'm currently writing a simple demo app and would like to call a
>  script to render a node based on a mixin. It's currently only possible
>  to use register the script for the primary node type or to use
>  the special sling:resourceType property.
>
>  What do you think about extending this to mixins? For instance, you could
> add a mixin to an nt:folder which adds additional data to this folder. If
> the mixin is available the folder is rendered differently.
>  I'm not sure if this is a good idea, therefore I would like to hear your
> input on this.
>
>  Supporting mixins here of course creates the problem if a node has more
> than one mixin etc. I could also argue if I'm already adding a mixin to the
> node, i can also add the sling:resourceType mixin as well.
i think if the resolution rules are well defined for the nodetype
hierarchy of a node, this is a good feature. this is not only cool for
mixins but also for extended nodetypes. eg, when my:File extends
nt:file i want the default nt:file script unless i create one for
my:File.

--
toby