Static link to get variables

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

Static link to get variables

Florian Minjat
Hi,
   I would like to use some Flash to interact with my seaside app. To
create the required tags with the chosen params, no problem.
   But I don't know how to make Flash communicate with Seaside. My
primary idea is to have a static link where the flash app could send
GET variables to seaside. For example
http://localhost:9090/seaside/MyApp/aName?param1=var1&param2=var2 .
But I have no idea how to create a static link like this in Seaside
nor to compute the get variables.
   Any idea ?

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

Re: Static link to get variables

Dmitry Dorofeev
Hi,

You need to subclass WARenderLoopMain
and implement (start: aRequest) method

Consult my example:

start: aRequest
|stat|

        "aRequest inspect."
        stat := aRequest at: 'serial' ifAbsent: [nil].
        stat ifNil: [
                stat := aRequest at: 'student' ifAbsent: [nil].
                stat ifNil: [
                        super start: aRequest
                ] ifNotNil: [
                        self loginStudent: aRequest.
                ].
        ] ifNotNil: [
                self processStat: aRequest.
        ]


--------------------------------------------

Don't forget to assign your new RenderLoopMain class to your seaside app
in seaside configuration usually at http://localhost/seaside/config

-Dmitry.

Florian Minjat wrote:

> Hi,
>   I would like to use some Flash to interact with my seaside app. To
> create the required tags with the chosen params, no problem.
>   But I don't know how to make Flash communicate with Seaside. My
> primary idea is to have a static link where the flash app could send GET
> variables to seaside. For example
> http://localhost:9090/seaside/MyApp/aName?param1=var1&param2=var2 . But
> I have no idea how to create a static link like this in Seaside nor to
> compute the get variables.
>   Any idea ?
>
> Florian
> _______________________________________________
> 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: Static link to get variables

Avi  Bryant

On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:

> Hi,
>
> You need to subclass WARenderLoopMain
> and implement (start: aRequest) method

There's a somewhat easier way to do this in recent versions of  
Seaside - after the initial component tree is created by #createRoot,  
every component in the tree will be sent #initialRequest: with the  
request object that started the session.  This can be especially  
effective when paired with a WATask subclass as the root, so that it  
can, eg, present a login page as needed depending on the request.

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

Re: Static link to get variables

Dmitry Dorofeev
Avi,
your improvements are brilliant.
My next project will be based on 2.6 !

-Dmitry

Avi Bryant wrote:

>
> On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:
>
>> Hi,
>>
>> You need to subclass WARenderLoopMain
>> and implement (start: aRequest) method
>
>
> There's a somewhat easier way to do this in recent versions of  Seaside
> - after the initial component tree is created by #createRoot,  every
> component in the tree will be sent #initialRequest: with the  request
> object that started the session.  This can be especially  effective when
> paired with a WATask subclass as the root, so that it  can, eg, present
> a login page as needed depending on the request.
>
> Avi
> _______________________________________________
> 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: Static link to get variables

Florian Minjat
In reply to this post by Avi Bryant
Thanks !
   So now i know how to handle request like
http://.../seaside/myApp?foo=bar to start my app.
   A little more complex now : I want to do the same, but from an
integrated flash menu. The trick is that I don't want to loose my
session and context. I tried by just adding the '&foo=bar' at the end
of the url (
http://.../seaside/myApp?_k=UeGCjSsi&_s=OTvjybecbYCHpKsn&foo=bar) and
it seemed to work, but I don't know how to get this string for a
particuliar action. Any idea ?

Florian

Avi Bryant wrote:

>
> On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:
>
>> Hi,
>>
>> You need to subclass WARenderLoopMain
>> and implement (start: aRequest) method
>
> There's a somewhat easier way to do this in recent versions of Seaside -
> after the initial component tree is created by #createRoot, every
> component in the tree will be sent #initialRequest: with the request
> object that started the session.  This can be especially effective when
> paired with a WATask subclass as the root, so that it can, eg, present a
> login page as needed depending on the request.
>
> Avi
> _______________________________________________
> 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: Static link to get variables

Florian Minjat
Nobody knows how to do that or is it impossible for the moment with
Seaside ? Or perhaps nobody understood what I meant.

Florian

Florian Minjat wrote:

> Thanks !
>   So now i know how to handle request like
> http://.../seaside/myApp?foo=bar to start my app.
>   A little more complex now : I want to do the same, but from an
> integrated flash menu. The trick is that I don't want to loose my
> session and context. I tried by just adding the '&foo=bar' at the end of
> the url (
> http://.../seaside/myApp?_k=UeGCjSsi&_s=OTvjybecbYCHpKsn&foo=bar) and it
> seemed to work, but I don't know how to get this string for a
> particuliar action. Any idea ?
>
> Florian
>
> Avi Bryant wrote:
>>
>> On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:
>>
>>> Hi,
>>>
>>> You need to subclass WARenderLoopMain
>>> and implement (start: aRequest) method
>>
>> There's a somewhat easier way to do this in recent versions of Seaside
>> - after the initial component tree is created by #createRoot, every
>> component in the tree will be sent #initialRequest: with the request
>> object that started the session.  This can be especially effective
>> when paired with a WATask subclass as the root, so that it can, eg,
>> present a login page as needed depending on the request.
>>
>> Avi
>> _______________________________________________
>> 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
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Static link to get variables

Lukas Renggli
> Nobody knows how to do that or is it impossible for the moment with
> Seaside ? Or perhaps nobody understood what I meant.

>From within #renderContentOn: you can get an action url by evaluating
something like:

    url := html context actionUrl withParameter: (self callbacks
        registerActionCallback: [ .... ]).

I don't know, but it should be then possible to pass this URL to your
flash application, or send as a mail (that is what i use the above
code for), or ...

Lukas

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

Re: Static link to get variables

Avi  Bryant
In reply to this post by Florian Minjat

On Feb 12, 2006, at 6:51 AM, Florian Minjat wrote:

> Nobody knows how to do that or is it impossible for the moment with  
> Seaside ? Or perhaps nobody understood what I meant.

I'm not exactly clear on what you meant, no.  Where do you want to be  
able to get this URL from?

Avi

> Florian
>
> Florian Minjat wrote:
>> Thanks !
>>   So now i know how to handle request like http://.../seaside/ 
>> myApp?foo=bar to start my app.
>>   A little more complex now : I want to do the same, but from an  
>> integrated flash menu. The trick is that I don't want to loose my  
>> session and context. I tried by just adding the '&foo=bar' at the  
>> end of the url ( http://.../seaside/myApp?
>> _k=UeGCjSsi&_s=OTvjybecbYCHpKsn&foo=bar) and it seemed to work,  
>> but I don't know how to get this string for a particuliar action.  
>> Any idea ?
>> Florian
>> Avi Bryant wrote:
>>>
>>> On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:
>>>
>>>> Hi,
>>>>
>>>> You need to subclass WARenderLoopMain
>>>> and implement (start: aRequest) method
>>>
>>> There's a somewhat easier way to do this in recent versions of  
>>> Seaside - after the initial component tree is created by  
>>> #createRoot, every component in the tree will be sent  
>>> #initialRequest: with the request object that started the  
>>> session.  This can be especially effective when paired with a  
>>> WATask subclass as the root, so that it can, eg, present a login  
>>> page as needed depending on the request.
>>>
>>> Avi
>>> _______________________________________________
>>> 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
> _______________________________________________
> 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: Static link to get variables

Florian Minjat
My aim is to embed a flash menu in my seaside app.
So I need to feed this flash menu with the different links. Thoses
links must be the equivalent of a message call to a seaside component.

I could use the #initialRequest: method to send GET variables to the
seaside app from the flash menu. But when I tried this method, the
context was lost (my app requires an authentification).

I am trying the method suggested by Lukas with :
url := html context actionUrl withParameter: (html callbacks
registerActionCallback: [ mycall ]).
And it seems to work. I need to make more tests to be sure.

Florian

Avi Bryant wrote:

>
> On Feb 12, 2006, at 6:51 AM, Florian Minjat wrote:
>
>> Nobody knows how to do that or is it impossible for the moment with
>> Seaside ? Or perhaps nobody understood what I meant.
>
> I'm not exactly clear on what you meant, no.  Where do you want to be
> able to get this URL from?
>
> Avi
>
>> Florian
>>
>> Florian Minjat wrote:
>>> Thanks !
>>>   So now i know how to handle request like
>>> http://.../seaside/myApp?foo=bar to start my app.
>>>   A little more complex now : I want to do the same, but from an
>>> integrated flash menu. The trick is that I don't want to loose my
>>> session and context. I tried by just adding the '&foo=bar' at the end
>>> of the url (
>>> http://.../seaside/myApp?_k=UeGCjSsi&_s=OTvjybecbYCHpKsn&foo=bar) and
>>> it seemed to work, but I don't know how to get this string for a
>>> particuliar action. Any idea ?
>>> Florian
>>> Avi Bryant wrote:
>>>>
>>>> On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> You need to subclass WARenderLoopMain
>>>>> and implement (start: aRequest) method
>>>>
>>>> There's a somewhat easier way to do this in recent versions of
>>>> Seaside - after the initial component tree is created by
>>>> #createRoot, every component in the tree will be sent
>>>> #initialRequest: with the request object that started the session.  
>>>> This can be especially effective when paired with a WATask subclass
>>>> as the root, so that it can, eg, present a login page as needed
>>>> depending on the request.
>>>>
>>>> Avi
>>>> _______________________________________________
>>>> 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
>> _______________________________________________
>> 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: Static link to get variables

Brad Fuller
Florian Minjat wrote:

> My aim is to embed a flash menu in my seaside app.
> So I need to feed this flash menu with the different links. Thoses
> links must be the equivalent of a message call to a seaside component.
>
> I could use the #initialRequest: method to send GET variables to the
> seaside app from the flash menu. But when I tried this method, the
> context was lost (my app requires an authentification).
>
> I am trying the method suggested by Lukas with :
> url := html context actionUrl withParameter: (html callbacks
> registerActionCallback: [ mycall ]).
> And it seems to work. I need to make more tests to be sure.
Old msg... but, did you ever finalize this issue? Any solution? How are
you doing with using flash? talking back and forth between seaside and
the embedded flash app.

any war stories? :-)

brad

>
> Florian
>
> Avi Bryant wrote:
>>
>> On Feb 12, 2006, at 6:51 AM, Florian Minjat wrote:
>>
>>> Nobody knows how to do that or is it impossible for the moment with
>>> Seaside ? Or perhaps nobody understood what I meant.
>>
>> I'm not exactly clear on what you meant, no.  Where do you want to be
>> able to get this URL from?
>>
>> Avi
>>
>>> Florian
>>>
>>> Florian Minjat wrote:
>>>> Thanks !
>>>>   So now i know how to handle request like
>>>> http://.../seaside/myApp?foo=bar to start my app.
>>>>   A little more complex now : I want to do the same, but from an
>>>> integrated flash menu. The trick is that I don't want to loose my
>>>> session and context. I tried by just adding the '&foo=bar' at the
>>>> end of the url (
>>>> http://.../seaside/myApp?_k=UeGCjSsi&_s=OTvjybecbYCHpKsn&foo=bar)
>>>> and it seemed to work, but I don't know how to get this string for
>>>> a particuliar action. Any idea ?
>>>> Florian
>>>> Avi Bryant wrote:
>>>>>
>>>>> On Feb 7, 2006, at 12:52 AM, Dmitry Dorofeev wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> You need to subclass WARenderLoopMain
>>>>>> and implement (start: aRequest) method
>>>>>
>>>>> There's a somewhat easier way to do this in recent versions of
>>>>> Seaside - after the initial component tree is created by
>>>>> #createRoot, every component in the tree will be sent
>>>>> #initialRequest: with the request object that started the
>>>>> session.  This can be especially effective when paired with a
>>>>> WATask subclass as the root, so that it can, eg, present a login
>>>>> page as needed depending on the request.
>>>>>
>>>>> Avi

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

Re: Static link to get variables

cbeler


Brad Fuller a écrit :

>Florian Minjat wrote:
>  
>
>>My aim is to embed a flash menu in my seaside app.
>>So I need to feed this flash menu with the different links. Thoses
>>links must be the equivalent of a message call to a seaside component.
>>
>>I could use the #initialRequest: method to send GET variables to the
>>seaside app from the flash menu. But when I tried this method, the
>>context was lost (my app requires an authentification).
>>
>>I am trying the method suggested by Lukas with :
>>url := html context actionUrl withParameter: (html callbacks
>>registerActionCallback: [ mycall ]).
>>And it seems to work. I need to make more tests to be sure.
>>    
>>
>Old msg... but, did you ever finalize this issue? Any solution? How are
>you doing with using flash? talking back and forth between seaside and
>the embedded flash app.
>
>any war stories? :-)
>
>brad
>  
>
I'm also playing with request to call an external web and to get  some
data back...

What I'd like to do is calling from seaside, and waiting for a
request...  something like:

http://www.aPage.php/carto?_k=lQEsdNrE&_s=WJqhqfFUpMOJWiPv   (sent from
seaside)

and then It opens the page that collects the 2 parameters, I click on
the map (kind of GIS) and it returns a GET request with all parameters I
need... like the following:

http://mySeasideServer:8000/myApp?_k=lQEsdNrE&_s=WJqhqfFUpMOJWiPv&point1=12345&point2=12345


Now I'm just tring to get a point1 and point 2  but without success. The
session is preserved but the 2 last parameters aren't processed.

If you have any ideas or comments, I'll appreciate. For instance, is there a way to call: anExternalPage with a request being interpreted as an answer ?

Thanks

Cédrick





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

Static link to get variables

cbeler
Hi :)

I managed to get values from the request but I'm not really happy with
the way I did it

> What I'd like to do is calling from seaside, and waiting for a
> request...  something like:
>
> http://www.aPage.php/carto?_k=lQEsdNrE&_s=WJqhqfFUpMOJWiPv   (sent
> from seaside)
>
> and then It opens the page that collects the 2 parameters, I click on
> the map (kind of GIS) and it returns a GET request with all parameters
> I need... like the following:
>
> http://mySeasideServer:8000/myApp?_k=lQEsdNrE&_s=WJqhqfFUpMOJWiPv&point1=12345&point2=12345 
>
>
>
when I get this url back, I use some code to fetch the data but this
code is in the rendering code of my component which is not really where
it should be.
( I use:   html context request at:...   in
MyComponent>>renderContentOn: html)

Is there any other way to do that ?

(I cannot use initialRequest as I need the _k and _s parameters...)


thanks

Cédrick

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