sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: List of available resource types
Date Mon, 01 Dec 2008 07:52:44 GMT
Felix Meschberger wrote:
> 
> Basically, Sling does not care for the actual node types. It just tries
> to get the sling:resourceType property, if this is missing the pluggable
> resource type resolver are called. If this does not resolve either, the
> primary node type is used.
> 
> On the other hand, to help in the creation of nodes with setting the
> sling:resourceType property, Sling provides the sling:Resource mixin
> node type, which just defines the sling:resourceType property. Likewise
> there is a sling:ResourceSuperType mixin which defines the
> sling:resourceSuperType property.
> 
> Final words:
> * Sling doesn't care for the actual node type
> * Sling helps setting the property providing a mixin node type for such
> nodes, whose actual node type prevents setting the sling:resourceType
> property.
> 
> Hope this helps.
> 
:) Thanks for summarizing this, Felix.

While Sling in theory does not care about the actual node type, in
practice it does as it uses the primary node type for script resolution
if no sling:resourceType or sling:resourceSuperType property is set.
(and no pluggable mechanism is used).

Therefore if you want to display some random data contained in the
repository, the primary node type is used as it is very likely that you
don't have the special sling:* properties already set for your data.

I think this is a very handy behaviour when it comes to check out Sling,
so I personally would rather tell new people to use script resolution
based on node types than using a special property.

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

Mime
View raw message