Dynamic WAMimeDocument

Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic WAMimeDocument

Philippe Marschall
Hello

For my demo at Smalltalk WebCamp I needed a web "resource" (image)
whose contents are generated dynamically. I solved this using a
dynamic mime document that takes a block which produces the contents
on demand. Have some of you had similar requirements at one point? How
did you solve it? Would this be generally useful?

Some of the things I struggled with:
- equality with WAMimeDocument is tricky as the full contents have to
be produced
- rather than having to produce the full contents it would sometimes
be useful to get access to the stream of the response and write to
this instead

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic WAMimeDocument

Philippe Marschall
Hello

As nobody has responded I don't assume that's something that anybody
has had a need for.

Cheers
Philippe

On Sun, Oct 20, 2019 at 11:23 AM Philippe Marschall
<[hidden email]> wrote:

>
> Hello
>
> For my demo at Smalltalk WebCamp I needed a web "resource" (image)
> whose contents are generated dynamically. I solved this using a
> dynamic mime document that takes a block which produces the contents
> on demand. Have some of you had similar requirements at one point? How
> did you solve it? Would this be generally useful?
>
> Some of the things I struggled with:
> - equality with WAMimeDocument is tricky as the full contents have to
> be produced
> - rather than having to produce the full contents it would sometimes
> be useful to get access to the stream of the response and write to
> this instead
>
> Cheers
> Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic WAMimeDocument

Max Leske
Hi Philippe,

I havene't had the need so far but from reading your description I feel
it migth be interesting to have for unit tests. Not sure what those unit
tests would be about though...


Cheers,
Max


On 27 Oct 2019, at 9:25, Philippe Marschall wrote:

> Hello
>
> As nobody has responded I don't assume that's something that anybody
> has had a need for.
>
> Cheers
> Philippe
>
> On Sun, Oct 20, 2019 at 11:23 AM Philippe Marschall
> <[hidden email]> wrote:
>>
>> Hello
>>
>> For my demo at Smalltalk WebCamp I needed a web "resource" (image)
>> whose contents are generated dynamically. I solved this using a
>> dynamic mime document that takes a block which produces the contents
>> on demand. Have some of you had similar requirements at one point?
>> How
>> did you solve it? Would this be generally useful?
>>
>> Some of the things I struggled with:
>> - equality with WAMimeDocument is tricky as the full contents have to
>> be produced
>> - rather than having to produce the full contents it would sometimes
>> be useful to get access to the stream of the response and write to
>> this instead
>>
>> Cheers
>> Philippe
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic WAMimeDocument

Johan Brichau-2
Dynamic generation of documents is a topic that pops up from time to time in the questions.
It might be good to save the code in the examples or in the tests.

Johan

> On 27 Oct 2019, at 09:41, Max Leske <[hidden email]> wrote:
>
> Hi Philippe,
>
> I havene't had the need so far but from reading your description I feel it migth be interesting to have for unit tests. Not sure what those unit tests would be about though...
>
>
> Cheers,
> Max
>
>
> On 27 Oct 2019, at 9:25, Philippe Marschall wrote:
>
>> Hello
>>
>> As nobody has responded I don't assume that's something that anybody
>> has had a need for.
>>
>> Cheers
>> Philippe
>>
>> On Sun, Oct 20, 2019 at 11:23 AM Philippe Marschall
>> <[hidden email]> wrote:
>>>
>>> Hello
>>>
>>> For my demo at Smalltalk WebCamp I needed a web "resource" (image)
>>> whose contents are generated dynamically. I solved this using a
>>> dynamic mime document that takes a block which produces the contents
>>> on demand. Have some of you had similar requirements at one point? How
>>> did you solve it? Would this be generally useful?
>>>
>>> Some of the things I struggled with:
>>> - equality with WAMimeDocument is tricky as the full contents have to
>>> be produced
>>> - rather than having to produce the full contents it would sometimes
>>> be useful to get access to the stream of the response and write to
>>> this instead
>>>
>>> Cheers
>>> Philippe
>> _______________________________________________
>> seaside-dev mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic WAMimeDocument

DiegoLont
Hi all,

It depends of course on the size of the files … I can remember that I made a solution that generated a file to disk and included a link in the reply. This is recommended if the file size is large. In this way I did not need to generate the stream myself. The stream itself is usually encoded, depending on the content type.

Regards,
Diego

> On 27 Oct 2019, at 12:13, Johan Brichau <[hidden email]> wrote:
>
> Dynamic generation of documents is a topic that pops up from time to time in the questions.
> It might be good to save the code in the examples or in the tests.
>
> Johan
>
>> On 27 Oct 2019, at 09:41, Max Leske <[hidden email]> wrote:
>>
>> Hi Philippe,
>>
>> I havene't had the need so far but from reading your description I feel it migth be interesting to have for unit tests. Not sure what those unit tests would be about though...
>>
>>
>> Cheers,
>> Max
>>
>>
>> On 27 Oct 2019, at 9:25, Philippe Marschall wrote:
>>
>>> Hello
>>>
>>> As nobody has responded I don't assume that's something that anybody
>>> has had a need for.
>>>
>>> Cheers
>>> Philippe
>>>
>>> On Sun, Oct 20, 2019 at 11:23 AM Philippe Marschall
>>> <[hidden email]> wrote:
>>>>
>>>> Hello
>>>>
>>>> For my demo at Smalltalk WebCamp I needed a web "resource" (image)
>>>> whose contents are generated dynamically. I solved this using a
>>>> dynamic mime document that takes a block which produces the contents
>>>> on demand. Have some of you had similar requirements at one point? How
>>>> did you solve it? Would this be generally useful?
>>>>
>>>> Some of the things I struggled with:
>>>> - equality with WAMimeDocument is tricky as the full contents have to
>>>> be produced
>>>> - rather than having to produce the full contents it would sometimes
>>>> be useful to get access to the stream of the response and write to
>>>> this instead
>>>>
>>>> Cheers
>>>> Philippe
>>> _______________________________________________
>>> seaside-dev mailing list
>>> [hidden email]
>>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>> _______________________________________________
>> seaside-dev mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev