Hi Felix, thanks a lot - I'll give it a try.
Maybe it would be helpful if we had some additional script resolution based on URLs or paths. In my example I could map a script to nt:resource if the resource is below /content/mails or so. Such a mechanism could really be helpful for users that have no possibility to modify existing content. Cheers Michael On 2/15/08, Felix Meschberger <[EMAIL PROTECTED]> wrote: > > 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 > > > > -- Michael Marth, http://dev.day.com