MAFileModel renderOn: error

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

MAFileModel renderOn: error

dtrussardi@tiscali.it
Hi,

i work with Magritte2 on Pharo and GLASS.

The MAFileModel method:

renderOn: html "Renders a download link of the receiver." html anchor title: (String streamContents: [ :stream | stream nextPutAll: self filename; nextPutAll: ' ('. stream nextPutAll: self filesize asFileSize; nextPutAll: ', '. stream nextPutAll: self mimetype ; nextPut: $) ]); url: self url; with: self filename

erase the error:

MessageNotUnderstood 2010: No method was found for the selector <#'do:'> when sent to <aWAMimeType(image/jpeg)> with arguments contained in <anArray( aComplexBlock)>.


i change it with:

stream nextPutAll: self mimetype asString ;

Now it work fine, but i don't know if it is right solution.


Thanks,

Dario

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAFileModel renderOn: error

Lukas Renggli
That looks like the right solution. I will fix it in the code-base.

Lukas

On 22 July 2010 22:17, [hidden email] <[hidden email]> wrote:

> Hi,
> i work with Magritte2 on Pharo and GLASS.
> The MAFileModel method:
> renderOn: html "Renders a download link of the receiver." html anchor title:
> (String streamContents: [ :stream | stream nextPutAll: self filename;
> nextPutAll: ' ('. stream nextPutAll: self filesize asFileSize; nextPutAll:
> ', '. stream nextPutAll: self mimetype ; nextPut: $) ]); url: self url;
> with: self filename
> erase the error:
>
> MessageNotUnderstood 2010: No method was found for the selector <#'do:'>
> when sent to <aWAMimeType(image/jpeg)> with arguments contained in <anArray(
> aComplexBlock)>.
>
> i change it with:
> stream nextPutAll: self mimetype asString ;
> Now it work fine, but i don't know if it is right solution.
>
> Thanks,
> Dario
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: MAFileModel renderOn: error

Lukas Renggli
Well, actually it is not. The mimetype is a string in Magritte and
MAFileUploadComponent is also setting it like that, so I wonder why
you get a WAMimeType there?

MAFIleUploadComponent>>upload: aFile
        self value: (aFile isNil ifFalse:
                        [ self description kind new
                                mimetype: aFile contentType greaseString;
                                filename: aFile fileName;
                                contents: aFile contents;
                                yourself
                        "Seaside now has MimeType objects, but MAFileModel expects strings" ])

On 22 July 2010 22:20, Lukas Renggli <[hidden email]> wrote:

> That looks like the right solution. I will fix it in the code-base.
>
> Lukas
>
> On 22 July 2010 22:17, [hidden email] <[hidden email]> wrote:
>> Hi,
>> i work with Magritte2 on Pharo and GLASS.
>> The MAFileModel method:
>> renderOn: html "Renders a download link of the receiver." html anchor title:
>> (String streamContents: [ :stream | stream nextPutAll: self filename;
>> nextPutAll: ' ('. stream nextPutAll: self filesize asFileSize; nextPutAll:
>> ', '. stream nextPutAll: self mimetype ; nextPut: $) ]); url: self url;
>> with: self filename
>> erase the error:
>>
>> MessageNotUnderstood 2010: No method was found for the selector <#'do:'>
>> when sent to <aWAMimeType(image/jpeg)> with arguments contained in <anArray(
>> aComplexBlock)>.
>>
>> i change it with:
>> stream nextPutAll: self mimetype asString ;
>> Now it work fine, but i don't know if it is right solution.
>>
>> Thanks,
>> Dario
>> _______________________________________________
>> 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