Re: FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-12 Thread Bertrand Delacretaz
On Thu, Jun 11, 2020 at 8:20 PM Andreas Schaefer wrote: >... Nevermind. I just realized that getResponse().getStatus() gives me access >to the status code... Yes, but you have to ignore the status check explicitly by calling checkStatus() with no argument, meaning "I want to ignore the status v

Re: FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-11 Thread Andreas Schaefer
> On Jun 11, 2020, at 11:03 AM, Andreas Schaefer > wrote: > > Hi > > >> On Jun 11, 2020, at 1:38 AM, Bertrand Delacretaz >> wrote: >> >> Hi Andy, >> >> On Wed, Jun 10, 2020 at 7:14 PM Andreas Schaefer >> wrote: >>> >>> I will try to fit into my use caseI am thinking of having big f

Re: FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-11 Thread Andreas Schaefer
Hi > On Jun 11, 2020, at 1:38 AM, Bertrand Delacretaz > wrote: > > Hi Andy, > > On Wed, Jun 10, 2020 at 7:14 PM Andreas Schaefer > wrote: >> >> I will try to fit into my use caseI am thinking of having big files or >> images than then later are streamed >> to the caller outside of Slin

Re: FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-11 Thread Bertrand Delacretaz
Hi Andy, On Wed, Jun 10, 2020 at 7:14 PM Andreas Schaefer wrote: > > I will try to fit into my use caseI am thinking of having big files or > images than then later are streamed > to the caller outside of Sling... My current use cases are about small String inputs and outputs, so I haven't

Re: FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-10 Thread Andreas Schaefer
I tested the InternalRequest in my use cases and its works just fine. > On Jun 10, 2020, at 10:14 AM, Andreas Schaefer > wrote: > > I will try to fit into my use case. That said I am sort of confused with the > OutputStream. As far as I understand it the output stream is when I write to > a s

Re: FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-10 Thread Andreas Schaefer
I will try to fit into my use case. That said I am sort of confused with the OutputStream. As far as I understand it the output stream is when I write to a sink but not read from a source. If we want to support streaming in the InternalRequest it needs to provide an InputStream and the Response

FYI, fluent helper for internal requests (was: Intra Sling Calls)

2020-06-10 Thread Bertrand Delacretaz
Hi, On Wed, Jun 3, 2020 at 11:03 AM Bertrand Delacretaz wrote: > ...for my use cases a fluent interface to the SlingRequestProcessor would be > nice... I have now implemented a fluent helper for internal requests, using either the SlingRequestProcessor (for full fidelity compared to HTTP reques

Re: Intra Sling Calls

2020-06-03 Thread Bertrand Delacretaz
Hi, On Tue, Jun 2, 2020 at 7:06 PM Andreas Schaefer wrote: > ...I do not like to use a “Mock” class for a in-production code.. If you don't have a request but need a request, you do need to mock it ;-) I agree that the term "mocks" is often connected to testing but if you look at our servlet he

Re: Intra Sling Calls

2020-06-02 Thread Carsten Ziegeler
Hi, so you rather want to call the http service instead (which then eventually calls Sling), correct? Regards Carsten Am 02.06.2020 um 19:32 schrieb Andreas Schaefer: Hi Carsten Not really an HTTP request but internally go through the HTTP stack. We are using these Intra Sling Calls for

Re: Intra Sling Calls

2020-06-02 Thread Andreas Schaefer
Hi Carsten Not really an HTTP request but internally go through the HTTP stack. We are using these Intra Sling Calls for Image Rendering and to delegate Composum Package handling because we cannot use an OSGI services, or there is code executed before hitting an OSGi service. Cheers - Andy

Re: Intra Sling Calls

2020-06-02 Thread Andreas Schaefer
Hi Dirk First I do not like to use a “Mock” class for a in-production code. Second I cannot do multiparts forms in the Mock classes (getParts(), getPart() is throwing an Unsupported Operation Exception). - Andy > On Jun 2, 2020, at 12:14 AM, Dirk Rudolph wrote: > > The mock implementations i

Re: Intra Sling Calls

2020-06-02 Thread Bertrand Delacretaz
Hi Andy, On Tue, Jun 2, 2020 at 6:10 AM Andreas Schaefer wrote: > ...So I am wondering if you guys would mind for me to build a service > providing the means to make > internal Sling calls through the HTTP stack with an official internal Sling > Request / Response object > that provides all fea

Re: Intra Sling Calls

2020-06-02 Thread Dirk Rudolph
The mock implementations in o.a.s.servlet-helpers are actually quite complete for common use cases. What do you have in mind that might be missing? Kind regards, Dirk On Tue, 2 Jun 2020 at 08:58, Konrad Windszus wrote: > If you don’t have a request at hand it will be impossible to implement > f

Re: Intra Sling Calls

2020-06-01 Thread Konrad Windszus
If you don’t have a request at hand it will be impossible to implement fully. If you have a request just use regular request dispatching. Konrad > Am 02.06.2020 um 08:21 schrieb Carsten Ziegeler : > > So you want to make an HTTP request from within Sling to itself? > I wouldn't recommend doing

Re: Intra Sling Calls

2020-06-01 Thread Carsten Ziegeler
So you want to make an HTTP request from within Sling to itself? I wouldn't recommend doing this, but I see no problem of having this as a new separate module, maybe starting in the whiteboard. Regards Carsten Am 02.06.2020 um 06:10 schrieb Andreas Schaefer: Hi As of know - and place correct

Intra Sling Calls

2020-06-01 Thread Andreas Schaefer
Hi As of know - and place correct me if I am wrong - there is no way for a service to call Sling internally as a request in a full fledged manner. Even though one can call Sling internally through SlingRequestProcessor usable Request and Response objects are only available as Mock objects and t