MIMEdatabase fix?

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

Re: MIMEdatabase fix?

johnmci
So does contentType -> ^self somthing mimeType

On 25-Feb-09, at 12:03 PM, Michael Rueger wrote:

> Hi all,
>
> ok, suggestion:
> if we change Kom and Seaside to use the message contentType where they
> expect a mime type string, then it would be easy to make it work on  
> both
> Pharo and Squeak without too much trouble.
> Seaside doesn't call mimeType on many places and usage is somewhat
> inconsistent right now as in
> httpResponse contentType = aHandler mimeType
>
> Comments? Suggestions?
>
> Michael

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Michael Rueger-6
John M McIntosh wrote:
> So does contentType -> ^self somthing mimeType

yes, should really be in the compatibility category

Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Michael Rueger-6
In reply to this post by Lukas Renggli

OK, here we go...
in the Pharo inbox there is a new version of Network-MIME and
KomHTTPServer. The Kom package should also work on Squeak.

Seaside would need to change its use of mimeType to contentType in a
handful of places (my guess).

Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Michael Rueger-6
Michael Rueger wrote:
> OK, here we go...
> in the Pharo inbox there is a new version of Network-MIME and
> KomHTTPServer. The Kom package should also work on Squeak.

ok, one more thing ;-)
Newer version of MIME package plus the attached change for Seaside makes
at least the tests pass.

Michael


'From Pharo0.1 of 16 May 2008 [Latest update: #10243] on 25 February 2009 at 1:09:34 pm'!

!SeasidePlatformSupport class methodsFor: 'factory' stamp: 'michael.rueger 2/25/2009 13:05'!
mimeDocumentOfType: type from: aFilename
        "WACachedDocument clearCache.
        (WACachedDocument fileName: 'SqueakDebug.log') asMIMEDocument.
        (WACachedDocument fileName: 'SqueakDebug.log') asMIMEDocument."


        | content mimeType |
        mimeType := type ifNil: [
                self mimeDocumentClass guessContentTypeFromExtension: (FileDirectory extensionFor: aFilename) ].
        content := (StandardFileStream readOnlyFileNamed: aFilename) contentsOfEntireFile.
        ^self mimeDocumentClass
                contentType: mimeType
                content: content! !

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Stéphane Ducasse
In reply to this post by Michael Rueger-6

On Feb 25, 2009, at 5:59 PM, Michael Rueger wrote:

> Lukas Renggli wrote:
>>> what seasiders think?
>>> I would be in favor to get a KOM pharo version
>>
>> Having two incompatible versions of Kom makes distribution even more
>> painful as it is today. I would prefer to have compatible versions if
>> this is possible.
>
> As I said, we are at or at least close to the point where we have to
> make the decision which version to support. If you want to have Pharo
> stay compatible with Squeak, we can just as well abandon Pharo now.
> It's as simple as that.

No else we would not have done pharo.
The point is more how can we help people migrating to pharo.
Probably having a specific Kom version.
Stef
>
>
> Michael
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Stéphane Ducasse
In reply to this post by Michael Rueger-6
Ok I will try to get some time to integrate that this evening.
Thanks mike.

Stef
On Feb 25, 2009, at 9:53 PM, Michael Rueger wrote:

>
> OK, here we go...
> in the Pharo inbox there is a new version of Network-MIME and
> KomHTTPServer. The Kom package should also work on Squeak.
>
> Seaside would need to change its use of mimeType to contentType in a
> handful of places (my guess).
>
> Michael
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Philippe Marschall-2-3
In reply to this post by Michael Rueger-6
Michael Rueger wrote:
> Michael Rueger wrote:
>> OK, here we go...
>> in the Pharo inbox there is a new version of Network-MIME and
>> KomHTTPServer. The Kom package should also work on Squeak.
>
> ok, one more thing ;-)
> Newer version of MIME package plus the attached change for Seaside makes
> at least the tests pass.

-1

I don't have any interest at all to have a version of Seaside 2.8 for
Squeak and one for Pharo.

If you absolutely have to you can make some unholy, brittle hacks like
we currently do for author initials to figure out if we're Squeak or
Pharo. Maybe even an #isPharo method.

Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Michael Rueger-6
Philippe Marschall wrote:
>> Newer version of MIME package plus the attached change for Seaside makes
>> at least the tests pass.
>
> -1
>
> I don't have any interest at all to have a version of Seaside 2.8 for
> Squeak and one for Pharo.

That's what I'm currently trying to avoid, but I need a little of your
help on the Seaside side of things, at least a bit of testing.

There is actually on more method (attached) that we need to add to
either Kom or Seaside to make Pharo and Squeak compatible on the API level.

Michael

'From Pharo0.1 of 16 May 2008 [Latest update: #10243] on 26 February 2009 at 10:50:21 am'!

!MIMEDocument class methodsFor: 'compatibility' stamp: 'michael.rueger 2/25/2009 13:05'!
guessContentTypeFromExtension: ext
        "guesses a content type from the extension"
        ^(self guessTypeFromExtension: ext) asString! !

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Philippe Marschall-2-3
Michael Rueger wrote:

> Philippe Marschall wrote:
>>> Newer version of MIME package plus the attached change for Seaside makes
>>> at least the tests pass.
>>
>> -1
>>
>> I don't have any interest at all to have a version of Seaside 2.8 for
>> Squeak and one for Pharo.
>
> That's what I'm currently trying to avoid,

It's better than monkey patching the system which is guaranteed to break
again in the future.

> but I need a little of your
> help on the Seaside side of things, at least a bit of testing.

Sure.

> There is actually on more method (attached) that we need to add to
> either Kom or Seaside to make Pharo and Squeak compatible on the API level.

Sorry but no, see previous posts. Have a look at Seaside2.8a1-pmm.583
for what I would find acceptable.

Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Michael Rueger-6
Philippe Marschall wrote:

>> There is actually on more method (attached) that we need to add to
>> either Kom or Seaside to make Pharo and Squeak compatible on the API level.
>
> Sorry but no, see previous posts. Have a look at Seaside2.8a1-pmm.583
> for what I would find acceptable.

OK, can you explain how I should make Seaside work on both Pharo and
Squeak? I spent two days figuring out a minimal set of changes that
would not require doing some ugly hack testing for which underlying
platform you are dealing with and you say that is not acceptable? You
*want* ugly hacks? I don't understand...
I'm not even touching seaside (except the one method rename/addition for
a method being called by Seaside).


Michael

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Philippe Marschall-2-3
Michael Rueger wrote:

> Philippe Marschall wrote:
>
>>> There is actually on more method (attached) that we need to add to
>>> either Kom or Seaside to make Pharo and Squeak compatible on the API level.
>> Sorry but no, see previous posts. Have a look at Seaside2.8a1-pmm.583
>> for what I would find acceptable.
>
> OK, can you explain how I should make Seaside work on both Pharo and
> Squeak? I spent two days figuring out a minimal set of changes that
> would not require doing some ugly hack testing for which underlying
> platform you are dealing with and you say that is not acceptable? You
> *want* ugly hacks? I don't understand...

- Monkey patching either Seaside or Kom is not acceptable. We have this
issue partially because Kom is monkey patching Squeak.
- Forking Seaside for Pharo is not acceptable.
- Relying on a forked Kom is not acceptable, we need to have a
consistent interface for Kom in both Squeak an Pharo.

That kinda limits our options.

Second the fix is not that ugly. It just sends #asString to something it
expects to be a String. This is not a that uncommon idiom. And we
already have to do something way uglier for ensuring author initials.

That's what happens if you break the API. You brake a lot of code and
cause a lot of pain for a lot of people.

Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Stéphane Ducasse
In reply to this post by Philippe Marschall-2-3
Hi philppe

If seaside people does not help then you should not complain that  
Squeak sucks
and that nothing is fixed.
So what is important it to find what is reasonable to do. So either  
help and we will
arrive to a fix point or don't complain for the next 5 years.

Stef



> Michael Rueger wrote:
>> Michael Rueger wrote:
>>> OK, here we go...
>>> in the Pharo inbox there is a new version of Network-MIME and
>>> KomHTTPServer. The Kom package should also work on Squeak.
>>
>> ok, one more thing ;-)
>> Newer version of MIME package plus the attached change for Seaside  
>> makes
>> at least the tests pass.
>
> -1
>
> I don't have any interest at all to have a version of Seaside 2.8 for
> Squeak and one for Pharo.
>
> If you absolutely have to you can make some unholy, brittle hacks like
> we currently do for author initials to figure out if we're Squeak or
> Pharo. Maybe even an #isPharo method.
>
> Cheers
> Philippe
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Stéphane Ducasse
In reply to this post by Philippe Marschall-2-3
I have problems to understand why this would be not reasonable that
people load a give kom version for seaside on squeak
and one for seaside on pharo.

If you put too much constraints then do not cry after that squeak code  
is shitty
because it is.


On Feb 27, 2009, at 7:39 AM, Philippe Marschall wrote:

> Michael Rueger wrote:
>> Philippe Marschall wrote:
>>
>>>> There is actually on more method (attached) that we need to add to
>>>> either Kom or Seaside to make Pharo and Squeak compatible on the  
>>>> API level.
>>> Sorry but no, see previous posts. Have a look at Seaside2.8a1-pmm.
>>> 583
>>> for what I would find acceptable.
>>
>> OK, can you explain how I should make Seaside work on both Pharo and
>> Squeak? I spent two days figuring out a minimal set of changes that
>> would not require doing some ugly hack testing for which underlying
>> platform you are dealing with and you say that is not acceptable? You
>> *want* ugly hacks? I don't understand...
>
> - Monkey patching either Seaside or Kom is not acceptable. We have  
> this
> issue partially because Kom is monkey patching Squeak.
> - Forking Seaside for Pharo is not acceptable.
> - Relying on a forked Kom is not acceptable, we need to have a
> consistent interface for Kom in both Squeak an Pharo.
>
> That kinda limits our options.
>
> Second the fix is not that ugly. It just sends #asString to  
> something it
> expects to be a String. This is not a that uncommon idiom. And we
> already have to do something way uglier for ensuring author initials.
>
> That's what happens if you break the API. You brake a lot of code and
> cause a lot of pain for a lot of people.
>
> Cheers
> Philippe
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Lukas Renggli
On Fri, Feb 27, 2009 at 10:30 AM, Stéphane Ducasse
<[hidden email]> wrote:
> I have problems to understand why this would be not reasonable that
> people load a give kom version for seaside on squeak
> and one for seaside on pharo.

The problem is that people load released versions from SqueakMap or
Package Universe. As long as Pharo shares the Squeak Package Universe
there is no way of cleanly deciding which version of Kom to load.

In the long term (for upcoming version) we will have to decide what
platform to support. I guess this will be Pharo 1.0 as soon as it has
been released. It is too much trouble to keep the installers
up-to-date and try to test and make them work on different versions
and platforms. I suggest that people stick with Squeak 3.9.1 or early
versions of Pharo for now.

Lukas

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

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

keith1y
In reply to this post by Philippe Marschall-2-3

> Second the fix is not that ugly. It just sends #asString to something it
> expects to be a String. This is not a that uncommon idiom. And we
> already have to do something way uglier for ensuring author initials.
>  
How about taking the Author initials stuff from pharo, and publishing it
as a package that will load into squeak. Then coding seaside to the new api.

This is something I plan to do for squeak anyway at some point, but if
you have a need for it now.

Also if you have any pressing fixes that squeak needs we can put that
fix into lpf for all images 3.7+

Keith


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Damien Cassou
In reply to this post by Lukas Renggli
On Fri, Feb 27, 2009 at 12:02 PM, Lukas Renggli <[hidden email]> wrote:
> The problem is that people load released versions from SqueakMap or
> Package Universe. As long as Pharo shares the Squeak Package Universe
> there is no way of cleanly deciding which version of Kom to load.

Pharo will probably have its own copy of Universe.

--
Damien Cassou
http://damiencassou.seasidehosting.st

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Stéphane Ducasse
In reply to this post by Lukas Renggli

On Feb 27, 2009, at 12:02 PM, Lukas Renggli wrote:

> On Fri, Feb 27, 2009 at 10:30 AM, Stéphane Ducasse
> <[hidden email]> wrote:
>> I have problems to understand why this would be not reasonable that
>> people load a give kom version for seaside on squeak
>> and one for seaside on pharo.
>
> The problem is that people load released versions from SqueakMap or
> Package Universe. As long as Pharo shares the Squeak Package Universe
> there is no way of cleanly deciding which version of Kom to load.

ok now we can say that we have one Universe for Pharo
so does it help solving the problem?

> In the long term (for upcoming version) we will have to decide what
> platform to support. I guess this will be Pharo 1.0 as soon as it has
> been released. It is too much trouble to keep the installers
> up-to-date and try to test and make them work on different versions
> and platforms.

I imagine that pretty well.


> I suggest that people stick with Squeak 3.9.1 or early
> versions of Pharo for now.

So may be we should tagged one version for alpha-pharo seasider
and we take the decision that there will be a KOM for pharo and one for
Squeak.

Now I can integrate the changes of mike but I need a seaside
creating the Pharo-KOM and testing that everything is ok.

>
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Philippe Marschall-2-3
In reply to this post by Stéphane Ducasse
Stéphane Ducasse wrote:
> I have problems to understand why this would be not reasonable that
> people load a give kom version for seaside on squeak
> and one for seaside on pharo.

Loading is one thing. What bothers we more is the maintenance situation.
Let's face it, there are far too resources behind something as important
as Kom. Making a fork of it cuts these resources in half.

Maintenance is not doing a quick fix now so that it loads. Maintenance
is taking care of something for several years (!) to come, fixing issues
as they arrive, being there and responding. Removing time from other
activities instead of finding excuses.


Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Philippe Marschall-2-3
In reply to this post by Stéphane Ducasse
Stéphane Ducasse wrote:

> On Feb 25, 2009, at 5:59 PM, Michael Rueger wrote:
>
>> Lukas Renggli wrote:
>>>> what seasiders think?
>>>> I would be in favor to get a KOM pharo version
>>> Having two incompatible versions of Kom makes distribution even more
>>> painful as it is today. I would prefer to have compatible versions if
>>> this is possible.
>> As I said, we are at or at least close to the point where we have to
>> make the decision which version to support. If you want to have Pharo
>> stay compatible with Squeak, we can just as well abandon Pharo now.
>> It's as simple as that.
>
> No else we would not have done pharo.
> The point is more how can we help people migrating to pharo.
> Probably having a specific Kom version.

You help people if you have a maintained version of Kom (see other
mail). If you don't have a maintained web server then you are hurting
people. Simply making a fork of Kom is not maintenance, on the contrary.

Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: MIMEdatabase fix?

Michael Rueger-6
In reply to this post by Philippe Marschall-2-3
Philippe Marschall wrote:
> Stéphane Ducasse wrote:
>> I have problems to understand why this would be not reasonable that
>> people load a give kom version for seaside on squeak
>> and one for seaside on pharo.
>
> Loading is one thing. What bothers we more is the maintenance situation.
> Let's face it, there are far too resources behind something as important
> as Kom. Making a fork of it cuts these resources in half.

Hmm, I think most of the discussion is simply a misunderstanding, I'm
not forking anything.

With my changes to Pharo (which of course first need to be integrated),
the changed (not forked!) version of Kom and the few changes for Seaside
(which need to be integrated) there is no need for a fork!!!

Those versions should work on both Squeak and Pharo.

It's not monkey patching, none of the packages touch other stuff any
more than they did before. I just changed Kom so its monkey patching now
works on both Seaside and Pharo.

And that's where I need you help testing.

Michael


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
123