dynamic entry points

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

dynamic entry points

Yann Monclair-5
Hello list,

I've been scratching my head on this most of today and I'm still stuck, so I thought I would ask for help.

I'm working on a web app to access the test results generated by our automated test system.
The results are stored in folders named with the timestamp when the test completed. The folder includes various files, like the time spent on each test, the logs generated...
The folder structure would look something like this:

results
  20081002145402
    logs.tar.gz
    elapsedTimes.txt
    info.txt
  20081002153408
    logs.tar.gz
    elapsedTimes.txt
    info.txt

Currently the system we have offers a central webpage, that displays all available result (in chronological order), and when you click on a link, it opens a popup with a seaside page displaying the results. The seaside page provides links to the logs and displays the various files in a nicely formatted way.

What I would like to do is send each developer a permanent url (s)he can use to consult the results for that test run.

the url woudl be something like this http://mydomain.com/seaside/results/20081002145402
and that would open directly the seaside view for that test run.

So I started of by subclassing WADispatcher, to override #entryPointAt:. I was thinking I could intercept the string '20081002145402' and that way know which test run to return.
I can register my dispatcher at /seaside/results and if I check WADispatcher default entryPoints it is there.

However, when I try to access this url, I get an error /seaside/results/20081002145402 doesn't exist (I don't remember the exact Seaside wording).

My idea was that the request would go like this:

/seaside/results/20081002145402
seaside -> this goes to WADispatcher default
results -> this goes to ResultsDispatcher default
20081002145402 -> ResultsDispatcher creates on the fly the page for that test run and returns that.

I'm sure I'm missing something fairly basic to manage to get my dispatcher in the loop properly. Or I just misunderstood how this part works.

Any help is appreciated.

I'm currently using Seaside 2.6 in VisualWorks. I don't plan on upgrading in the next weeks, but should upgrade over the next few months up to 2.8 (via 2.7).

Cheers,

Yann


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: dynamic entry points

Boris Popov, DeepCove Labs (SNN)
Yann,

I think all you need to do is implement #initialRequest: on your
application component and then look at the URL and have it configure
itself appropriately without having to much with dispatchers and such.

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Yann
Monclair
Sent: October 2, 2008 1:24 PM
To: [hidden email]
Subject: [Seaside] dynamic entry points

Hello list,

I've been scratching my head on this most of today and I'm still stuck,
so I thought I would ask for help.

I'm working on a web app to access the test results generated by our
automated test system.
The results are stored in folders named with the timestamp when the test
completed. The folder includes various files, like the time spent on
each test, the logs generated...
The folder structure would look something like this:

results
  20081002145402
    logs.tar.gz
    elapsedTimes.txt
    info.txt
  20081002153408
    logs.tar.gz
    elapsedTimes.txt
    info.txt

Currently the system we have offers a central webpage, that displays all
available result (in chronological order), and when you click on a link,
it opens a popup with a seaside page displaying the results. The seaside
page provides links to the logs and displays the various files in a
nicely formatted way.

What I would like to do is send each developer a permanent url (s)he can
use to consult the results for that test run.

the url woudl be something like this
http://mydomain.com/seaside/results/20081002145402
and that would open directly the seaside view for that test run.

So I started of by subclassing WADispatcher, to override #entryPointAt:.
I was thinking I could intercept the string '20081002145402' and that
way know which test run to return.
I can register my dispatcher at /seaside/results and if I check
WADispatcher default entryPoints it is there.

However, when I try to access this url, I get an error
/seaside/results/20081002145402 doesn't exist (I don't remember the
exact Seaside wording).

My idea was that the request would go like this:

/seaside/results/20081002145402
seaside -> this goes to WADispatcher default
results -> this goes to ResultsDispatcher default
20081002145402 -> ResultsDispatcher creates on the fly the page for that
test run and returns that.

I'm sure I'm missing something fairly basic to manage to get my
dispatcher in the loop properly. Or I just misunderstood how this part
works.

Any help is appreciated.

I'm currently using Seaside 2.6 in VisualWorks. I don't plan on
upgrading in the next weeks, but should upgrade over the next few months
up to 2.8 (via 2.7).

Cheers,

Yann


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: dynamic entry points

Philippe Marschall
2008/10/2, Boris Popov <[hidden email]>:
> Yann,
>
> I think all you need to do is implement #initialRequest: on your
> application component and then look at the URL and have it configure
> itself appropriately without having to much with dispatchers and such.

That's the way to go. If what you have there is more a web page than a
web application you might also want to consider doing simply a request
handler / entry point and doing all your request processing there,
bypassing a lot of Seaside machinery. You might want to have a look at
WAHtmlBuilder in Seaside 2.8 for html generation.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: dynamic entry points

John McKeon
In reply to this post by Yann Monclair-5
This is something I was looking into with the FLEX question earlier this
week. This could easily be done with parameterized url
http://www.mydomain.com/seaside/results?ts=20091000949whatever like the
age old CGI(?) parameters.
Then use self session currentRequest fields to obtain a collection of
the parameters in the form paramname=paravalue. Used in a WATask this
should be a cinch. You would get the parameter ts=2008100949whatever and
away you go.

HTH
Johnny


Yann Monclair wrote:

> Hello list,
>
> I've been scratching my head on this most of today and I'm still
> stuck, so I thought I would ask for help.
>
> I'm working on a web app to access the test results generated by our
> automated test system.
> The results are stored in folders named with the timestamp when the
> test completed. The folder includes various files, like the time spent
> on each test, the logs generated...
> The folder structure would look something like this:
>
> results
>   20081002145402
>     logs.tar.gz
>     elapsedTimes.txt
>     info.txt
>   20081002153408
>     logs.tar.gz
>     elapsedTimes.txt
>     info.txt
>
> Currently the system we have offers a central webpage, that displays
> all available result (in chronological order), and when you click on a
> link, it opens a popup with a seaside page displaying the results. The
> seaside page provides links to the logs and displays the various files
> in a nicely formatted way.
>
> What I would like to do is send each developer a permanent url (s)he
> can use to consult the results for that test run.
>
> the url woudl be something like this
> http://mydomain.com/seaside/results/20081002145402
> and that would open directly the seaside view for that test run.
>
> So I started of by subclassing WADispatcher, to override
> #entryPointAt:. I was thinking I could intercept the string
> '20081002145402' and that way know which test run to return.
> I can register my dispatcher at /seaside/results and if I check
> WADispatcher default entryPoints it is there.
>
> However, when I try to access this url, I get an error
> /seaside/results/20081002145402 doesn't exist (I don't remember the
> exact Seaside wording).
>
> My idea was that the request would go like this:
>
> /seaside/results/20081002145402
> seaside -> this goes to WADispatcher default
> results -> this goes to ResultsDispatcher default
> 20081002145402 -> ResultsDispatcher creates on the fly the page for
> that test run and returns that.
>
> I'm sure I'm missing something fairly basic to manage to get my
> dispatcher in the loop properly. Or I just misunderstood how this part
> works.
>
> Any help is appreciated.
>
> I'm currently using Seaside 2.6 in VisualWorks. I don't plan on
> upgrading in the next weeks, but should upgrade over the next few
> months up to 2.8 (via 2.7).
>
> Cheers,
>
> Yann
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>  

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: dynamic entry points

Karsten Kusche
In reply to this post by Yann Monclair-5
Hi Yann,

you should have a look at how WAFileHandler is implemented, create your
own EntryPoint subclass and you're done. But make sure you implement
#default on class-side properly, so that it doesn't conflict with other
entry points.

Karsten




Yann Monclair wrote:

> Hello list,
>
> I've been scratching my head on this most of today and I'm still
> stuck, so I thought I would ask for help.
>
> I'm working on a web app to access the test results generated by our
> automated test system.
> The results are stored in folders named with the timestamp when the
> test completed. The folder includes various files, like the time spent
> on each test, the logs generated...
> The folder structure would look something like this:
>
> results
>   20081002145402
>     logs.tar.gz
>     elapsedTimes.txt
>     info.txt
>   20081002153408
>     logs.tar.gz
>     elapsedTimes.txt
>     info.txt
>
> Currently the system we have offers a central webpage, that displays
> all available result (in chronological order), and when you click on a
> link, it opens a popup with a seaside page displaying the results. The
> seaside page provides links to the logs and displays the various files
> in a nicely formatted way.
>
> What I would like to do is send each developer a permanent url (s)he
> can use to consult the results for that test run.
>
> the url woudl be something like this
> http://mydomain.com/seaside/results/20081002145402
> and that would open directly the seaside view for that test run.
>
> So I started of by subclassing WADispatcher, to override
> #entryPointAt:. I was thinking I could intercept the string
> '20081002145402' and that way know which test run to return.
> I can register my dispatcher at /seaside/results and if I check
> WADispatcher default entryPoints it is there.
>
> However, when I try to access this url, I get an error
> /seaside/results/20081002145402 doesn't exist (I don't remember the
> exact Seaside wording).
>
> My idea was that the request would go like this:
>
> /seaside/results/20081002145402
> seaside -> this goes to WADispatcher default
> results -> this goes to ResultsDispatcher default
> 20081002145402 -> ResultsDispatcher creates on the fly the page for
> that test run and returns that.
>
> I'm sure I'm missing something fairly basic to manage to get my
> dispatcher in the loop properly. Or I just misunderstood how this part
> works.
>
> Any help is appreciated.
>
> I'm currently using Seaside 2.6 in VisualWorks. I don't plan on
> upgrading in the next weeks, but should upgrade over the next few
> months up to 2.8 (via 2.7).
>
> Cheers,
>
> Yann
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>  

--
Karsten Kusche - Dipl.Inf. - [hidden email]
Tel: +49 3496 21 43 29
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside