[Seaside] Re: Magritte + Comet problem?

Lukas Renggli renggli at gmail.com
Thu Jun 4 05:49:13 UTC 2009


Hi John, thanks for your fixes. That looks indeed like an omission.

Could you please post the Monticello mcz file, so that we can easily
merge your changes?

Cheers,
Lukas

On Thu, Jun 4, 2009 at 12:33 AM, John Chludzinski
<john.chludzinski at gmail.com> wrote:
> The problem occurred when I tried to use MAFileDescription from
> Magritte.  When I tried to 'upload' a file I had selected, I got an
> error in my Opera browser.  After some investigation I found that the
> 'fields' instance variable in WARequest was an empty Dictionary.
> Hence, the changes in the class WAListener.  ---John
>
>
> On Wed, Jun 3, 2009 at 3:18 PM, John Chludzinski
> <john.chludzinski at gmail.com> wrote:
>> To use Comet I use:
>>
>>      WAListener startOn: 8080.
>>
>> But it appears that Magritte doesn't work with WAListener.  To get it
>> to work Bob Arning & I made mods to WAListener (let me know anyone if
>> this is problematic?):
>>
>> !WAListener methodsFor: 'private' stamp: 'raa 6/3/2009 14:42'!
>> convertFileName: aString
>>        ^aString! !
>>
>> !WAListener methodsFor: 'private' stamp: 'raa 6/3/2009 14:42'!
>> convertRequest: aKomRequest
>>        | request |
>>
>>        self processMultipartFields: aKomRequest.
>>
>>        request := WARequest
>>                method: aKomRequest method
>>                url: aKomRequest url unescapePercents
>>                headers: aKomRequest header
>>                fields: (self fieldsOf: aKomRequest)
>>                cookies: aKomRequest cookies
>>                nativeRequest: aKomRequest.
>>
>>        aKomRequest method = 'PUT'
>>                ifTrue: [request fields
>>                                        at: 'PUTData'
>>                                        put: (aKomRequest stream next: aKomRequest contentLength)].
>>        ^ request! !
>>
>> !WAListener methodsFor: 'as yet unclassified' stamp: 'raa 6/3/2009 14:42'!
>> convertMultipartFileField: aChunk
>>
>>        ^(WAFile fromChunk: aChunk)
>>                fileName: (self convertFileName: aChunk fileName);
>>                contentType: aChunk contentType
>>                yourself! !
>>
>> !WAListener methodsFor: 'as yet unclassified' stamp: 'raa 6/3/2009 14:42'!
>> processMultipartFields: aRequest
>>
>>        aRequest multipartFormFieldsDo: [ :chunk |
>>                | contents fieldName previousValue |
>>                fieldName := chunk fieldName.
>>                contents := chunk fileName isEmptyOrNil
>>                        ifTrue: [
>>                                String streamContents: [ :stream |
>>                                        chunk saveToStream: stream ] ]
>>                        ifFalse: [ self convertMultipartFileField: chunk ].
>>                previousValue := aRequest postFields at: fieldName ifAbsent: [ nil ].
>>                previousValue isNil
>>                        ifTrue: [  aRequest postFields at: fieldName put: contents ]
>>                        ifFalse: [
>>                                (previousValue isKindOf: self collectionClass)
>>                                        ifTrue: [ previousValue add: contents ]
>>                                        ifFalse: [ aRequest postFields at: fieldName put: (self
>> collectionClass with: previousValue with: contents) ] ] ]! !
>>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list