Call application with parameter

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

Call application with parameter

dtrussardi@tiscali.it
Ciao,

        i have a WAComponent subclass DisplayArticoli   register as   'articoliOnLine' .

        The application implement some traditional anchor and some AJAX element.

        The goal of this application is rendering all the items of one specific shop.

        I' have some shops: shopA,  shopB, shopC
.
        When from browser i request it i'm interested to pass  a parameter with a specific shop name.
       
        For example:

                http://www.test.com:9090/articoliOnLine?_shop=shopA

        So when a new session is open a specific shop reference is set.
               
               
        What is the best implementation to do it ?


        I do some test:

                        for now i change the WASession handleFiltered: aRequestContext.
       
               
                If in the aRequestContext request  fields i found the _shop parameter

                         i set  the shop reference in the WASession shop instance to the relative value.

        In DisplayArticoli renderContentOn:   method i had:
       
                html document addLoadScript: (html jQuery ajaxSetup
       onError: (html javascript
           alert: 'The session has expired. ';
                                goto:  'http://www.test.com:9090/articoliOnLine?_shop=shopA' ))

        this redirect the browser when a ajax request trigger a  error  ( after a expired session for example ) and work fine.

        The problem is relative to the anchor  event when the session is expired because the default

        expiredRegistryKey
        "The session key has expired, redirect the request to the home directory preserving the path as good as possible."

        lose the path _shop=shopA parameter.

       
        Is my test in the right direction or i wrong ?

        Any considerations is welcome.

        Thank,

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

Re: Call application with parameter

Paul DeBruicker
I think this should be helpful:

http://book.seaside.st/book/in-action/session/recovering






On 12-04-17 10:09 AM, [hidden email] wrote:

> Ciao,
>
> i have a WAComponent subclass DisplayArticoli   register as   'articoliOnLine' .
>
> The application implement some traditional anchor and some AJAX element.
>
> The goal of this application is rendering all the items of one specific shop.
>
> I' have some shops: shopA,  shopB, shopC
> .
> When from browser i request it i'm interested to pass  a parameter with a specific shop name.
>
> For example:
>
> http://www.test.com:9090/articoliOnLine?_shop=shopA
>
> So when a new session is open a specific shop reference is set.
>
>
> What is the best implementation to do it ?
>
>
> I do some test:
>
> for now i change the WASession handleFiltered: aRequestContext.
>
>
> If in the aRequestContext request  fields i found the _shop parameter
>
> i set  the shop reference in the WASession shop instance to the relative value.
>
> In DisplayArticoli renderContentOn:   method i had:
>
> html document addLoadScript: (html jQuery ajaxSetup
>          onError: (html javascript
>              alert: 'The session has expired. ';
> goto:  'http://www.test.com:9090/articoliOnLine?_shop=shopA' ))
>
> this redirect the browser when a ajax request trigger a  error  ( after a expired session for example ) and work fine.
>
> The problem is relative to the anchor  event when the session is expired because the default
>
> expiredRegistryKey
> "The session key has expired, redirect the request to the home directory preserving the path as good as possible."
>
> lose the path _shop=shopA parameter.
>
>
> Is my test in the right direction or i wrong ?
>
> Any considerations is welcome.
>
> Thank,
>
> Dario
> _______________________________________________
> 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: Call application with parameter

dtrussardi@tiscali.it
Thank Paul,

i read your reference and do some test.


I change the updateUrl:   to
updateUrl: anUrl super updateUrl: anUrl. anUrl purgeOtherFields. anUrl addField: 'shop'  value: 'shopA'.


Now all the request ( ajax  - anchor  ) work fine.

The only doubt is relative to the url display in the browser.

After click one anchor it is set to : 

http://www.test.com:9090/articoliOnLine?shop= shopA#_s=HIGDcqS-fkc87zSa&_k=SbwG0-VBlC6tn8-l&shop= shopA&12

The  query filed include two   shop = shopA     field-value pairs.

It's right ?

Ciao, thank for any suggestions,

Dario

I think this should be helpful:

http://book.seaside.st/book/in-action/session/recovering






On 12-04-17 10:09 AM, [hidden email] wrote:
Ciao,

i have a WAComponent subclass DisplayArticoli   register as   'articoliOnLine' .

The application implement some traditional anchor and some AJAX element.

The goal of this application is rendering all the items of one specific shop.

I' have some shops: shopA,  shopB, shopC
.
When from browser i request it i'm interested to pass  a parameter with a specific shop name.

For example:

http://www.test.com:9090/articoliOnLine?_shop=shopA

So when a new session is open a specific shop reference is set.


What is the best implementation to do it ?


I do some test:

for now i change the WASession handleFiltered: aRequestContext.


If in the aRequestContext request  fields i found the _shop parameter

i set  the shop reference in the WASession shop instance to the relative value.

In DisplayArticoli renderContentOn:   method i had:

html document addLoadScript: (html jQuery ajaxSetup
        onError: (html javascript
            alert: 'The session has expired. ';
goto:  'http://www.test.com:9090/articoliOnLine?_shop=shopA' ))

this redirect the browser when a ajax request trigger a  error  ( after a expired session for example ) and work fine.

The problem is relative to the anchor  event when the session is expired because the default

expiredRegistryKey
"The session key has expired, redirect the request to the home directory preserving the path as good as possible."

lose the path _shop=shopA parameter.


Is my test in the right direction or i wrong ?

Any considerations is welcome.

Thank,

Dario
_______________________________________________
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: Call application with parameter

dtrussardi@tiscali.it
Ciao,

i found what i wrong.

When register the entry point application  i had the  JQAjaxifierLibrary

it change the url management.

Thanks in any case.

Dario


Thank Paul,

i read your reference and do some test.


I change the updateUrl:   to
updateUrl: anUrl super updateUrl: anUrl. anUrl purgeOtherFields. anUrl addField: 'shop'  value: 'shopA'.


Now all the request ( ajax  - anchor  ) work fine.

The only doubt is relative to the url display in the browser.

After click one anchor it is set to : 

http://www.test.com:9090/articoliOnLine?shop= shopA#_s=HIGDcqS-fkc87zSa&_k=SbwG0-VBlC6tn8-l&shop= shopA&12

The  query filed include two   shop = shopA     field-value pairs.

It's right ?

Ciao, thank for any suggestions,

Dario

I think this should be helpful:

http://book.seaside.st/book/in-action/session/recovering






On 12-04-17 10:09 AM, [hidden email] wrote:
Ciao,

i have a WAComponent subclass DisplayArticoli   register as   'articoliOnLine' .

The application implement some traditional anchor and some AJAX element.

The goal of this application is rendering all the items of one specific shop.

I' have some shops: shopA,  shopB, shopC
.
When from browser i request it i'm interested to pass  a parameter with a specific shop name.

For example:

http://www.test.com:9090/articoliOnLine?_shop=shopA

So when a new session is open a specific shop reference is set.


What is the best implementation to do it ?


I do some test:

for now i change the WASession handleFiltered: aRequestContext.


If in the aRequestContext request  fields i found the _shop parameter

i set  the shop reference in the WASession shop instance to the relative value.

In DisplayArticoli renderContentOn:   method i had:

html document addLoadScript: (html jQuery ajaxSetup
        onError: (html javascript
            alert: 'The session has expired. ';
goto:  'http://www.test.com:9090/articoliOnLine?_shop=shopA' ))

this redirect the browser when a ajax request trigger a  error  ( after a expired session for example ) and work fine.

The problem is relative to the anchor  event when the session is expired because the default

expiredRegistryKey
"The session key has expired, redirect the request to the home directory preserving the path as good as possible."

lose the path _shop=shopA parameter.


Is my test in the right direction or i wrong ?

Any considerations is welcome.

Thank,

Dario
_______________________________________________
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