Hi,

More in another reply...

On 20.07.2010 11:47, Bertrand Delacretaz wrote:
> Hi Victor,
> 
> Thanks very much for exposing your use case.
> 
> On Tue, Jul 20, 2010 at 10:42 AM, Victor Saar <[email protected]> wrote:
>> What I'm trying to do right now is to render selected parts of the content
>> in a certain representation, which is identified by an extension and
>> selectors. The result is then packed in a zip file and stored in the
>> repository
>> for later delivery. The update of the zip file is triggered by some event
>> (e.g.
>> a change to the repository or configuration) and is thus outside of the
>> usual
>> request/response cycle...
> 
> Ok, so in your case the SlingServlet would be called programmatically,
> not from an existing http request.
> 
> I think the detached requests factory that I suggest in my previous
> mail might help, how does the following scenario sound?

Maybe a request/response-builder is better:

  SlingHttpServletRequest = new SlingHttpServletRequestBuilder(
        resolver)
        .addAttribute(name,value)
        .addParameter(name,value)
        .setMethod(name)
        .setPath(path)
        .toSlingHttpServletRequest();

Provided some useful defaults (like request method and path) and
constructor arguments (e.g. HttpServletRequest for the "default" use
case). This might be more flexible and easier to use.

A corresponding SlingHttpServletResponseBuilder would do the same for
responses.

Regards
Felix

> 
> @Reference
> DetachedRRFactory f;
> 
> @Reference
> SlingServlet s;
> 
> Map<String, String> parameters = ...
> RRpair p = f.getRequestResponsePair("POST", "/foo", parameters);
> s.processrequest(p.getRequest(), p.getResponse());
> 
> -Bertrand
> 

Reply via email to