Hi Michael,

I just updated the jcr/resource module to create a sling:Resource mixin
node type, which defines a sling:resourceType property as a String. You
may attach this mixin node type to your mail node and set resource type
accordingly. This gives you the full flexibility to render your mail
specifically.

Alternatively, of course, you may create a servlet or script for the
nt:file resource type. But this has the advantage that all nt:file nodes
regardless of whether they are actually mail or not will be rendered by
that servlet or script. The first option is probably better.

Regards
Felix

Am Freitag, den 15.02.2008, 11:52 +0100 schrieb Michael Marth:
> Hi,
> 
> I have an existing content model and want to build a sling app on top. The
> model is Jukka Zitting's mail model he coded for James (see [1]). One mail
> is stored as:
> 
> nt:file
> |-jcr:content (unstructured)
>   |- from (string)
>   |- to (string)
>   |- jcr:data (binary)
> ...
> 
> In order to display a mail via Sling I added a property sling:resourceType
> to the jcr:content sub node (because I could not add it to nt:file). My URL
> now looks something like:
> 
> http://localhost:8888/content/.../emailtitle/jcr:content
> or
> http://localhost:8888/content/.../emailtitle
> 
> but in both cases the binary jcr:data is returned directly.
> 
> Do I have to change my content model or do you guys see a way that I can
> access my mail resources and have a script being executed?
> 
> Thanks for hints
> Cheers
> Michael
> 
> 
> [1] http://dev.day.com/microsling/content/blogs/main/jcrmail.html
> 

Reply via email to