Hi Alexander, > -----Original Message----- > From: Alexander Klimetschek [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 18, 2008 8:31 AM > To: [email protected] > Subject: Re: Json Rendering > > On Wed, Jun 18, 2008 at 2:04 PM, Bertrand Delacretaz > <[EMAIL PROTECTED]> wrote: > >> Something like providing a new JsonWriter component at runtime ? > > > > Yes, that would work. We could also have a > JsonWriterFactory that's an > > OSGi service, but that feels like overkill right now. > > Yes, I have the same feeling. I think it is a general issue: > as the default servlets are a core feature in Sling (ie. > simple updating of JCR content), but very often you want to > customize the behaviour for certain properties or nodes, this > seems like a general pattern, that yet needs to be solved. > Having a different plugin architecture in each default > servlet (providing custom writers, request objects etc.) > feels like the wrong solution. Especially if you consider the > elegant way of script/servlet resolution in Sling by using > resource-types with inheritance etc. > > IMHO this is the same (development) problem that Ruby on > Rails solved very well: using scaffolding to provide a > working out-of-the-box experience but then also allowing you > to refine the default behaviour step-by-step. The way it's > done in Ruby is a combination of source generating scripts, > code generating logic in the classes itself (easy with a > dynamic language) and also using Ruby's missing-method (that > is called when a method is called that is not defined on the object). > > I have no clear solution in my head, but I think it's a place > where Sling could improve. WDYT? >
You had suggested that I use a selector for my special json rendering, would maybe allowing the user to map a rendering output to a selector in a general way be a good way to do this? You might need to "namespace" the selectors so that you don't collide with potential future sling-provided selectors, but I'm not sure if that's a valid idea or not given the fairly strict rules govering URI composition. Something like this would help me with the JCR explorer and my need for more information about the nodes than the current JSON rendering provides today. Just a thought. > Regards, > Alex > > -- > Alexander Klimetschek > [EMAIL PROTECTED] > Cheers, Craig
