You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Dan Tenenbaum <da...@dandante.com> on 2008/11/06 21:41:13 UTC

making a script to handle all node resource types

Hi,

In the tutorial "sling in 15 minutes" (
http://incubator.apache.org/sling/site/discover-sling-in-15-minutes.html),
it shows how to create a script that will provide an HTML rendering of a
node
with a specific resource type.

How can I create a script that will render any node, regardless of resource
type?

I want to do this in order to enable a quick node browser....I'd like to be
able to go to any node and see its properties and children, etc.

Dan

Re: making a script to handle all node resource types

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Dan,

Just create a script for the "special" resource type
sling/servlet/default for example /apps/sling/servlet/default/default.esp.

A little bit of background: resource types have a type hierarchy where
the sling/servlet/default is the (implied) root resource type (much like
java.lang.Object in Java). So creating scripts for the
sling/servlet/default resource type will be applicable all resources
(should not any more specific script be available).

Hope this helps.

Regards
Felix


Dan Tenenbaum schrieb:
> Hi,
> 
> In the tutorial "sling in 15 minutes" (
> http://incubator.apache.org/sling/site/discover-sling-in-15-minutes.html),
> it shows how to create a script that will provide an HTML rendering of a
> node
> with a specific resource type.
> 
> How can I create a script that will render any node, regardless of resource
> type?
> 
> I want to do this in order to enable a quick node browser....I'd like to be
> able to go to any node and see its properties and children, etc.
> 
> Dan
> 

Re: making a script to handle all node resource types

Posted by Dan Tenenbaum <da...@dandante.com>.
Uh, I found the answer to my question:
http://cwiki.apache.org/SLING/faq.html#FAQ-Howtoreplacethedefaultjsonrenderer%2528forexample%2529withmyown%253F
Never mind.
Dan


On Thu, Nov 6, 2008 at 12:41 PM, Dan Tenenbaum <da...@dandante.com>wrote:

> Hi,
>
> In the tutorial "sling in 15 minutes" (
> http://incubator.apache.org/sling/site/discover-sling-in-15-minutes.html),
> it shows how to create a script that will provide an HTML rendering of a
> node
> with a specific resource type.
>
> How can I create a script that will render any node, regardless of resource
> type?
>
> I want to do this in order to enable a quick node browser....I'd like to be
> able to go to any node and see its properties and children, etc.
>
> Dan
>
>