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 [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
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 <[hidden email]> 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 [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
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 <[hidden email]> 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 > <[hidden email]> 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 > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by John Chludzinski
Will a change-set do? ---John
On Wed, Jun 3, 2009 at 6:33 PM, John Chludzinski<[hidden email]> 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 > <[hidden email]> 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 [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside Listener-Magritte fix.1.cs.gz (1K) Download Attachment |
A Monticello file would be much simpler to merge, but a change-set is fine too.
What I need to know is the Monticello version the code is based on, I am pretty sure that it changed in the meantime. Cheers, Lukas On Fri, Jun 5, 2009 at 4:57 PM, John Chludzinski<[hidden email]> wrote: > Will a change-set do? ---John > > On Wed, Jun 3, 2009 at 6:33 PM, John > Chludzinski<[hidden email]> 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 >> <[hidden email]> 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 > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
I published Seaside2.8a1-lr.589. Loading into the latest Seaside 2.8
was simpler than I expected, there were no conflicts. Thanks for the contribution. Cheers, Lukas On Fri, Jun 5, 2009 at 5:13 PM, Lukas Renggli<[hidden email]> wrote: > A Monticello file would be much simpler to merge, but a change-set is fine too. > > What I need to know is the Monticello version the code is based on, I > am pretty sure that it changed in the meantime. > > Cheers, > Lukas > > > On Fri, Jun 5, 2009 at 4:57 PM, John > Chludzinski<[hidden email]> wrote: >> Will a change-set do? ---John >> >> On Wed, Jun 3, 2009 at 6:33 PM, John >> Chludzinski<[hidden email]> 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 >>> <[hidden email]> 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 >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> >> > > > > -- > Lukas Renggli > http://www.lukas-renggli.ch > -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by John Chludzinski
One other thing: I'm trying to use Magritte to display profile info
about different people and was wondering about support for small (a la passport) pictures I could use. I was playing with MAFileDescription to help give me something along those lines. Is there something in Magritte that would display the picture in a report? ---John On Fri, Jun 5, 2009 at 10:57 AM, John Chludzinski<[hidden email]> wrote: > Will a change-set do? ---John > > On Wed, Jun 3, 2009 at 6:33 PM, John > Chludzinski<[hidden email]> 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 >> <[hidden email]> 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 [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |