SqueakSource: RESTful URLs?

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

SqueakSource: RESTful URLs?

Andreas.Raab
Hi Guys -

I've been looking to link up source code directly to web pages and was
wondering how hard it would be to support RESTful Urls on SqueakSource.
What I'm thinking about is something like an interface that allows us to
browse particular classes, for example:

http://www.squeaksource.com/browse/ss/SqueakSource-pmm.1002/SSAccessPolicy/admins

There might be other ways to formulate the request in nicer ways but you
get the idea, namely that we can link to particular classes and methods
in a well-defined way instead of having to explain "go to
http://squeaksource.com/ss.html then click on <versions>, then find
SqueakSource-pmm.1002, then click on <browse code>, then click on
SSAccessPolicy, and then click on the admins method".

Since I have never touched the SS code base I have no idea how hard it
would be to implement such a feature. So perhaps anyone else is
interested in adding an improvement like that?

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource: RESTful URLs?

Philippe Marschall
2006/10/25, Andreas Raab <[hidden email]>:

> Hi Guys -
>
> I've been looking to link up source code directly to web pages and was
> wondering how hard it would be to support RESTful Urls on SqueakSource.
> What I'm thinking about is something like an interface that allows us to
> browse particular classes, for example:
>
> http://www.squeaksource.com/browse/ss/SqueakSource-pmm.1002/SSAccessPolicy/admins
>
> There might be other ways to formulate the request in nicer ways but you
> get the idea, namely that we can link to particular classes and methods
> in a well-defined way instead of having to explain "go to
> http://squeaksource.com/ss.html then click on <versions>, then find
> SqueakSource-pmm.1002, then click on <browse code>, then click on
> SSAccessPolicy, and then click on the admins method".
>
> Since I have never touched the SS code base I have no idea how hard it
> would be to implement such a feature. So perhaps anyone else is
> interested in adding an improvement like that?

Hi

The biggest problem is that SS runs on Seaside 2.3. Later versions of
Seaside have much better support for dealing with RESTful urls.
The 2xx versions where an attempt to to port it to Seaside 2.5. It failed.

If you want to have a look at it, SSSession would be the starter since
all the handling of the urls happens there. Just be warned, it is
quite messy code.

Cheers
Philippe

Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource: RESTful URLs?

Andreas.Raab
Philippe Marschall wrote:
> The biggest problem is that SS runs on Seaside 2.3. Later versions of
> Seaside have much better support for dealing with RESTful urls.
> The 2xx versions where an attempt to to port it to Seaside 2.5. It failed.

Is there hope to revive that process?

> If you want to have a look at it, SSSession would be the starter since
> all the handling of the urls happens there. Just be warned, it is
> quite messy code.

Thanks. Unfortunately, I have no idea where the control flow is in
Seaside...

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource: RESTful URLs?

Philippe Marschall
2006/10/25, Andreas Raab <[hidden email]>:
> Philippe Marschall wrote:
> > The biggest problem is that SS runs on Seaside 2.3. Later versions of
> > Seaside have much better support for dealing with RESTful urls.
> > The 2xx versions where an attempt to to port it to Seaside 2.5. It failed.
>
> Is there hope to revive that process?

Well you summarized it pretty good in your open source vs. commercial
software rant ;)
I think there are plans for a student project that aims for a complete rewrite.

> > If you want to have a look at it, SSSession would be the starter since
> > all the handling of the urls happens there. Just be warned, it is
> > quite messy code.
>
> Thanks. Unfortunately, I have no idea where the control flow is in
> Seaside...

Place a halt in the code ;)
the starting point is #enterSessionWithRequest:
#createRootFromRequest: creates the component and selects the project
if the url ends with .html. There you could do more things like
depending on the url like displaying classes and urls.
You will probably also have to adjust #wantsSessionForRequest: and friends.

Generating restful links (that can be bookmarked) with Seaside 2.3 is
a whole different issue.

Philippe

Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource: RESTful URLs?

Bert Freudenberg
Am 25.10.2006 um 11:08 schrieb Philippe Marschall:

> the starting point is #enterSessionWithRequest:
> #createRootFromRequest: creates the component and selects the project
> if the url ends with .html. There you could do more things like
> depending on the url like displaying classes and urls.
> You will probably also have to adjust #wantsSessionForRequest: and  
> friends.

Right, this is what makes bookmarkable project html pages work.

> Generating restful links (that can be bookmarked) with Seaside 2.3 is
> a whole different issue.

Well, if you know what you parse in the methods above, it should not  
be too hard to generate a bookmarkable link on each page, right? And  
if you disable #alwaysRedirect, clicking on the link actually takes  
you to the page so that you can copy the address.

- Bert -

Reply | Threaded
Open this post in threaded view
|

Re: SqueakSource: RESTful URLs?

Philippe Marschall
2006/10/25, Bert Freudenberg <[hidden email]>:

> Am 25.10.2006 um 11:08 schrieb Philippe Marschall:
>
> > the starting point is #enterSessionWithRequest:
> > #createRootFromRequest: creates the component and selects the project
> > if the url ends with .html. There you could do more things like
> > depending on the url like displaying classes and urls.
> > You will probably also have to adjust #wantsSessionForRequest: and
> > friends.
>
> Right, this is what makes bookmarkable project html pages work.
>
> > Generating restful links (that can be bookmarked) with Seaside 2.3 is
> > a whole different issue.
>
> Well, if you know what you parse in the methods above, it should not
> be too hard to generate a bookmarkable link on each page, right? And
> if you disable #alwaysRedirect, clicking on the link actually takes
> you to the page so that you can copy the address.

Well I meant always having a bookmarkable url. So lets say you browse
the method #wantsSessionForRequest: in the class SSSession in versoion
SqueakSource-pmm.1002 the url would automaically be something like:
http://www.squeaksource.com/ss/browse/SqueakSource-pmm.1002/SSSession/wantsSessionForRequest:
like in RoR. Not having somewhere a bookmarkable link like on the
project page.

Philippe