Am Freitag, den 16.11.2007, 11:22 -0500 schrieb Bertrand Delacretaz:
> Hi,
> 
> On Nov 14, 2007 4:16 AM, Michael Marth <[EMAIL PROTECTED]> wrote:
> 
> > ...I think that the processing of POSTs, i.e. writing into the repository
> > should be scriptable just like the processing of GETs is. ...
> 
> As others said, this is already the case, using a POST.js script for example.
> 
> But that completely replaces the default servlet behaviour, I agree
> that it might be useful to expose this behaviour (creating nodes,
> copying request parameters etc.) to user scripts. Maybe make the
> default servlet available in the SlingRequest, or some of its methods
> to help with that.

I would not do that, this would violate different good behaviours :-)

Rather I would separate the frontend task of analyzing the input and
writing the output from the backend task of acting upon the input and
preparing the output. This way, the backend operation may be re-used.

So, we would have server-side microjax support which may be used by both
the defualt servlet (in a better way than just forwarding the POST to
another servlet, the MicrojaxPostServlet) and any other servlet or even
script.

Of course we might reach a point, were the functionality of microsling
is at an end and  real-world applications should turn towards the
real-sling which is much more open to extension etc.

> 
> But there's another interesting option, let's look at your use cases:
> 
> > ...- the comments shall have a date. Currently, I need to set the date in 
> > the
> > browser and pass it along as a request parameter. What I would really like
> > is to set this date on the server, i.e. add a custom property before the
> > node gets written
> > (I am aware that I could use Repository Observers to get this done but do
> > not I want to write Java code for this)...
> 
> I was actually thinking about making JCR observers scriptable as well.

This is in fact a very interesting extension. Still I would strongly
suggest to not implement this in microsling but in Sling. In addition, I
wonder whether such observers would have access to the repository and
what access rights these scripts would have ? And further on, who would
be allowed to put scripts there ?

Regards
Felix

Reply via email to