Hi,
It looks like BOZipView is out of date: - it implements renderContentOn: but this is never reached - it misses the respondUsing: hook method that seems to be the preferred way to generate a response I tried to implement respondUsing: by copying from renderContentOn:: BOZipView>>respondUsing: aResponse | archive | super respondUsing: aResponse. aResponse contentType: 'application/zip'; attachmentWithFileName: self book name , '.zip'. archive := ZipArchive new. self addLatexTo: archive; addFilesTo: archive. archive writeTo: aResponse stream. archive close It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). Again, binary should probably be implemented in the GRCodecStream, but I do not know how. Any hints? Cheers, Doru -- www.tudorgirba.com "It's not what we do that matters most, it's how we do it." _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
> It looks like BOZipView is out of date:
Yeah, this is all Seaside 2.8 code that has never been updated. > - it implements renderContentOn: but this is never reached Yeah, this is never reached. Override #respondUsing: instead. > - it misses the respondUsing: hook method that seems to be the preferred way to generate a response > I tried to implement respondUsing: by copying from renderContentOn:: > BOZipView>>respondUsing: aResponse > | archive | > super respondUsing: aResponse. > aResponse > contentType: 'application/zip'; > attachmentWithFileName: self book name , '.zip'. > archive := ZipArchive new. > self addLatexTo: archive; addFilesTo: archive. > archive writeTo: aResponse stream. > archive close > > It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). GRPharoUtf8CodecStream is a text stream by definition (hence the codec). You have to put the response into binary mode using #binary, then you should get a binary stream, not an codec stream. Lukas -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Hi Lukas,
Thanks for fixing the code. Now, there is no error when exporting the zip file, but still the book.tex file contains strange characters. I guess it is related to an encoding problem. Just open the file with TextMate and the problem is quite apparent. Cheers, Doru On 25 Sep 2011, at 11:27, Lukas Renggli wrote: >> It looks like BOZipView is out of date: > > Yeah, this is all Seaside 2.8 code that has never been updated. > >> - it implements renderContentOn: but this is never reached > > Yeah, this is never reached. Override #respondUsing: instead. > >> - it misses the respondUsing: hook method that seems to be the preferred way to generate a response > > >> I tried to implement respondUsing: by copying from renderContentOn:: >> BOZipView>>respondUsing: aResponse >> | archive | >> super respondUsing: aResponse. >> aResponse >> contentType: 'application/zip'; >> attachmentWithFileName: self book name , '.zip'. >> archive := ZipArchive new. >> self addLatexTo: archive; addFilesTo: archive. >> archive writeTo: aResponse stream. >> archive close >> >> It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). > > GRPharoUtf8CodecStream is a text stream by definition (hence the codec). > > You have to put the response into binary mode using #binary, then you > should get a binary stream, not an codec stream. > > Lukas > > -- > Lukas Renggli > www.lukas-renggli.ch > > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki -- www.tudorgirba.com "Be rather willing to give than demanding to get." _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Ok, I guess that is because of the missing encoding into the Zip
archive. That should be fixable. Give me a few minutes. Note that I also fixed the verbatim support for different output types. So writing {{{html:<b>strong</b>}}} will only show up in html. Similarly {{{latex:\strong{strong} }}} will only show up in LaTeX. If you don't specify a type {{{something}}} this shows up verbatim in all output. Likely this is not wanted when producing some decent output in various formats (such as in the book). Cheers, Lukas On 25 September 2011 12:54, Tudor Girba <[hidden email]> wrote: > Hi Lukas, > > Thanks for fixing the code. > > Now, there is no error when exporting the zip file, but still the book.tex file contains strange characters. I guess it is related to an encoding problem. Just open the file with TextMate and the problem is quite apparent. > > Cheers, > Doru > > > On 25 Sep 2011, at 11:27, Lukas Renggli wrote: > >>> It looks like BOZipView is out of date: >> >> Yeah, this is all Seaside 2.8 code that has never been updated. >> >>> - it implements renderContentOn: but this is never reached >> >> Yeah, this is never reached. Override #respondUsing: instead. >> >>> - it misses the respondUsing: hook method that seems to be the preferred way to generate a response >> >> >>> I tried to implement respondUsing: by copying from renderContentOn:: >>> BOZipView>>respondUsing: aResponse >>> | archive | >>> super respondUsing: aResponse. >>> aResponse >>> contentType: 'application/zip'; >>> attachmentWithFileName: self book name , '.zip'. >>> archive := ZipArchive new. >>> self addLatexTo: archive; addFilesTo: archive. >>> archive writeTo: aResponse stream. >>> archive close >>> >>> It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). >> >> GRPharoUtf8CodecStream is a text stream by definition (hence the codec). >> >> You have to put the response into binary mode using #binary, then you >> should get a binary stream, not an codec stream. >> >> Lukas >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> >> _______________________________________________ >> Magritte, Pier and Related Tools ... >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki > > -- > www.tudorgirba.com > > "Be rather willing to give than demanding to get." > > > > > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki > -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On 25 September 2011 14:11, Lukas Renggli <[hidden email]> wrote:
> Ok, I guess that is because of the missing encoding into the Zip > archive. That should be fixable. Give me a few minutes. > > Note that I also fixed the verbatim support for different output > types. So writing > > {{{html:<b>strong</b>}}} > > will only show up in html. Similarly > > {{{latex:\strong{strong} }}} > > will only show up in LaTeX. If you don't specify a type > > {{{something}}} > > this shows up verbatim in all output. Likely this is not wanted when > producing some decent output in various formats (such as in the book). Some more testing is needed, and we should update PRBookDistribution accordingly. Lukas > > Cheers, > Lukas > > On 25 September 2011 12:54, Tudor Girba <[hidden email]> wrote: >> Hi Lukas, >> >> Thanks for fixing the code. >> >> Now, there is no error when exporting the zip file, but still the book.tex file contains strange characters. I guess it is related to an encoding problem. Just open the file with TextMate and the problem is quite apparent. >> >> Cheers, >> Doru >> >> >> On 25 Sep 2011, at 11:27, Lukas Renggli wrote: >> >>>> It looks like BOZipView is out of date: >>> >>> Yeah, this is all Seaside 2.8 code that has never been updated. >>> >>>> - it implements renderContentOn: but this is never reached >>> >>> Yeah, this is never reached. Override #respondUsing: instead. >>> >>>> - it misses the respondUsing: hook method that seems to be the preferred way to generate a response >>> >>> >>>> I tried to implement respondUsing: by copying from renderContentOn:: >>>> BOZipView>>respondUsing: aResponse >>>> | archive | >>>> super respondUsing: aResponse. >>>> aResponse >>>> contentType: 'application/zip'; >>>> attachmentWithFileName: self book name , '.zip'. >>>> archive := ZipArchive new. >>>> self addLatexTo: archive; addFilesTo: archive. >>>> archive writeTo: aResponse stream. >>>> archive close >>>> >>>> It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). >>> >>> GRPharoUtf8CodecStream is a text stream by definition (hence the codec). >>> >>> You have to put the response into binary mode using #binary, then you >>> should get a binary stream, not an codec stream. >>> >>> Lukas >>> >>> -- >>> Lukas Renggli >>> www.lukas-renggli.ch >>> >>> _______________________________________________ >>> Magritte, Pier and Related Tools ... >>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >> >> -- >> www.tudorgirba.com >> >> "Be rather willing to give than demanding to get." >> >> >> >> >> _______________________________________________ >> Magritte, Pier and Related Tools ... >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >> > > > > -- > Lukas Renggli > www.lukas-renggli.ch > -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Hi,
On 25 Sep 2011, at 14:12, Lukas Renggli wrote: > On 25 September 2011 14:11, Lukas Renggli <[hidden email]> wrote: >> Ok, I guess that is because of the missing encoding into the Zip >> archive. That should be fixable. Give me a few minutes. >> >> Note that I also fixed the verbatim support for different output >> types. So writing >> >> {{{html:<b>strong</b>}}} >> >> will only show up in html. Similarly >> >> {{{latex:\strong{strong} }}} >> >> will only show up in LaTeX. If you don't specify a type >> >> {{{something}}} >> >> this shows up verbatim in all output. Likely this is not wanted when >> producing some decent output in various formats (such as in the book). > > Some more testing is needed, It looks good. > and we should update PRBookDistribution > accordingly. What do you mean? To add an example? Cheers, Doru > Lukas > > >> >> Cheers, >> Lukas >> >> On 25 September 2011 12:54, Tudor Girba <[hidden email]> wrote: >>> Hi Lukas, >>> >>> Thanks for fixing the code. >>> >>> Now, there is no error when exporting the zip file, but still the book.tex file contains strange characters. I guess it is related to an encoding problem. Just open the file with TextMate and the problem is quite apparent. >>> >>> Cheers, >>> Doru >>> >>> >>> On 25 Sep 2011, at 11:27, Lukas Renggli wrote: >>> >>>>> It looks like BOZipView is out of date: >>>> >>>> Yeah, this is all Seaside 2.8 code that has never been updated. >>>> >>>>> - it implements renderContentOn: but this is never reached >>>> >>>> Yeah, this is never reached. Override #respondUsing: instead. >>>> >>>>> - it misses the respondUsing: hook method that seems to be the preferred way to generate a response >>>> >>>> >>>>> I tried to implement respondUsing: by copying from renderContentOn:: >>>>> BOZipView>>respondUsing: aResponse >>>>> | archive | >>>>> super respondUsing: aResponse. >>>>> aResponse >>>>> contentType: 'application/zip'; >>>>> attachmentWithFileName: self book name , '.zip'. >>>>> archive := ZipArchive new. >>>>> self addLatexTo: archive; addFilesTo: archive. >>>>> archive writeTo: aResponse stream. >>>>> archive close >>>>> >>>>> It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). >>>> >>>> GRPharoUtf8CodecStream is a text stream by definition (hence the codec). >>>> >>>> You have to put the response into binary mode using #binary, then you >>>> should get a binary stream, not an codec stream. >>>> >>>> Lukas >>>> >>>> -- >>>> Lukas Renggli >>>> www.lukas-renggli.ch >>>> >>>> _______________________________________________ >>>> Magritte, Pier and Related Tools ... >>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >>> >>> -- >>> www.tudorgirba.com >>> >>> "Be rather willing to give than demanding to get." >>> >>> >>> >>> >>> _______________________________________________ >>> Magritte, Pier and Related Tools ... >>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >>> >> >> >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> > > > > -- > Lukas Renggli > www.lukas-renggli.ch > > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki -- www.tudorgirba.com "Obvious things are difficult to teach." _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
>> and we should update PRBookDistribution
>> accordingly. > > What do you mean? To add an example? No, but the book is full of HTML markup that is actually ment for the HTML book only. I've posted a quick fix for the encoding issue in the Zip archive. Please verify that it works: Name: Pier-Book-lr.151 Author: lr Time: 25 September 2011, 2:21:49 pm UUID: 798b6ff9-3f0f-43f2-848c-43eeed1ffa2d Ancestors: Pier-Book-lr.150 - encode the latex in the zip archive There is something strange in Pharo though. The ZipArchive somehow expects textual contents to be a ByteArray, which is really weird and should probably be fixed in Pharo. Lukas > > Cheers, > Doru > > >> Lukas >> >> >>> >>> Cheers, >>> Lukas >>> >>> On 25 September 2011 12:54, Tudor Girba <[hidden email]> wrote: >>>> Hi Lukas, >>>> >>>> Thanks for fixing the code. >>>> >>>> Now, there is no error when exporting the zip file, but still the book.tex file contains strange characters. I guess it is related to an encoding problem. Just open the file with TextMate and the problem is quite apparent. >>>> >>>> Cheers, >>>> Doru >>>> >>>> >>>> On 25 Sep 2011, at 11:27, Lukas Renggli wrote: >>>> >>>>>> It looks like BOZipView is out of date: >>>>> >>>>> Yeah, this is all Seaside 2.8 code that has never been updated. >>>>> >>>>>> - it implements renderContentOn: but this is never reached >>>>> >>>>> Yeah, this is never reached. Override #respondUsing: instead. >>>>> >>>>>> - it misses the respondUsing: hook method that seems to be the preferred way to generate a response >>>>> >>>>> >>>>>> I tried to implement respondUsing: by copying from renderContentOn:: >>>>>> BOZipView>>respondUsing: aResponse >>>>>> | archive | >>>>>> super respondUsing: aResponse. >>>>>> aResponse >>>>>> contentType: 'application/zip'; >>>>>> attachmentWithFileName: self book name , '.zip'. >>>>>> archive := ZipArchive new. >>>>>> self addLatexTo: archive; addFilesTo: archive. >>>>>> archive writeTo: aResponse stream. >>>>>> archive close >>>>>> >>>>>> It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). >>>>> >>>>> GRPharoUtf8CodecStream is a text stream by definition (hence the codec). >>>>> >>>>> You have to put the response into binary mode using #binary, then you >>>>> should get a binary stream, not an codec stream. >>>>> >>>>> Lukas >>>>> >>>>> -- >>>>> Lukas Renggli >>>>> www.lukas-renggli.ch >>>>> >>>>> _______________________________________________ >>>>> Magritte, Pier and Related Tools ... >>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >>>> >>>> -- >>>> www.tudorgirba.com >>>> >>>> "Be rather willing to give than demanding to get." >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Magritte, Pier and Related Tools ... >>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >>>> >>> >>> >>> >>> -- >>> Lukas Renggli >>> www.lukas-renggli.ch >>> >> >> >> >> -- >> Lukas Renggli >> www.lukas-renggli.ch >> >> _______________________________________________ >> Magritte, Pier and Related Tools ... >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki > > -- > www.tudorgirba.com > > "Obvious things are difficult to teach." > > > > > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki > -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Hi,
On 25 Sep 2011, at 14:24, Lukas Renggli wrote: >>> and we should update PRBookDistribution >>> accordingly. >> >> What do you mean? To add an example? > > No, but the book is full of HTML markup that is actually ment for the > HTML book only. > I've posted a quick fix for the encoding issue in the Zip archive. > Please verify that it works: > > Name: Pier-Book-lr.151 > Author: lr > Time: 25 September 2011, 2:21:49 pm > UUID: 798b6ff9-3f0f-43f2-848c-43eeed1ffa2d > Ancestors: Pier-Book-lr.150 > > - encode the latex in the zip archive Thanks. It works fine now. Cheers, Doru > There is something strange in Pharo though. The ZipArchive somehow > expects textual contents to be a ByteArray, which is really weird and > should probably be fixed in Pharo. > > Lukas > > > > > >> >> Cheers, >> Doru >> >> >>> Lukas >>> >>> >>>> >>>> Cheers, >>>> Lukas >>>> >>>> On 25 September 2011 12:54, Tudor Girba <[hidden email]> wrote: >>>>> Hi Lukas, >>>>> >>>>> Thanks for fixing the code. >>>>> >>>>> Now, there is no error when exporting the zip file, but still the book.tex file contains strange characters. I guess it is related to an encoding problem. Just open the file with TextMate and the problem is quite apparent. >>>>> >>>>> Cheers, >>>>> Doru >>>>> >>>>> >>>>> On 25 Sep 2011, at 11:27, Lukas Renggli wrote: >>>>> >>>>>>> It looks like BOZipView is out of date: >>>>>> >>>>>> Yeah, this is all Seaside 2.8 code that has never been updated. >>>>>> >>>>>>> - it implements renderContentOn: but this is never reached >>>>>> >>>>>> Yeah, this is never reached. Override #respondUsing: instead. >>>>>> >>>>>>> - it misses the respondUsing: hook method that seems to be the preferred way to generate a response >>>>>> >>>>>> >>>>>>> I tried to implement respondUsing: by copying from renderContentOn:: >>>>>>> BOZipView>>respondUsing: aResponse >>>>>>> | archive | >>>>>>> super respondUsing: aResponse. >>>>>>> aResponse >>>>>>> contentType: 'application/zip'; >>>>>>> attachmentWithFileName: self book name , '.zip'. >>>>>>> archive := ZipArchive new. >>>>>>> self addLatexTo: archive; addFilesTo: archive. >>>>>>> archive writeTo: aResponse stream. >>>>>>> archive close >>>>>>> >>>>>>> It seems to go in the right direction, but the issue is that GRPharoUtf8CodecStream does not understand binary (a method needed by ZipArchive). >>>>>> >>>>>> GRPharoUtf8CodecStream is a text stream by definition (hence the codec). >>>>>> >>>>>> You have to put the response into binary mode using #binary, then you >>>>>> should get a binary stream, not an codec stream. >>>>>> >>>>>> Lukas >>>>>> >>>>>> -- >>>>>> Lukas Renggli >>>>>> www.lukas-renggli.ch >>>>>> >>>>>> _______________________________________________ >>>>>> Magritte, Pier and Related Tools ... >>>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >>>>> >>>>> -- >>>>> www.tudorgirba.com >>>>> >>>>> "Be rather willing to give than demanding to get." >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Magritte, Pier and Related Tools ... >>>>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >>>>> >>>> >>>> >>>> >>>> -- >>>> Lukas Renggli >>>> www.lukas-renggli.ch >>>> >>> >>> >>> >>> -- >>> Lukas Renggli >>> www.lukas-renggli.ch >>> >>> _______________________________________________ >>> Magritte, Pier and Related Tools ... >>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >> >> -- >> www.tudorgirba.com >> >> "Obvious things are difficult to teach." >> >> >> >> >> _______________________________________________ >> Magritte, Pier and Related Tools ... >> https://www.iam.unibe.ch/mailman/listinfo/smallwiki >> > > > > -- > Lukas Renggli > www.lukas-renggli.ch > > _______________________________________________ > Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki -- www.tudorgirba.com "Beauty is where we see it." _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Free forum by Nabble | Edit this page |