You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Everton Agner <ev...@yahoo.com.br> on 2010/01/23 20:02:45 UTC

Beast approach for a page redirection situation

Hi,

Let's assume that:

- The user's Login info is stored on Session;
- Every user have many profiles;
- Plenty of pages works on one specific Profile for the user;
- The current user profile is always stored on Session also;
- I have a page of Profile selection that shows all of the user's profiles and let him choose which one he wants to work with;
- So, every page that needs the user's current profile looks on the @SessionState data... and if it doesn't exists yet, redirects to the Profile Selection Page;

Now is the goal i need to get to it... When these pages redirect to the Profile Selection Page, they need to pass information about which page the Profile Selection Page needs to redirect automatically when the user select which profile he wants to.

For my first approach, I thought about passing one String by the page activation context about the page path (like "user/profile/foo/bar"). It works, but i didn't like the URL result.

I want to know which would be the best approach to get to my goal...

I though about @InjectPage my Profile Selection Page and have in it one @Persist("flash") field like "redirectTo", so it's value is alive when the page is rendered, and cleared after that... Would that be ok?

Thanks,

Everton



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: Beast approach for a page redirection situation

Posted by Howard Lewis Ship <hl...@gmail.com>.
Sounds like you could use a SSO to store the page to redirect back to,
after the profile selection page behavior completes.

On Sun, Jan 24, 2010 at 9:01 AM, Everton Agner
<ev...@yahoo.com.br> wrote:
> Sorry, i think i didn't explaint it well (and also messed up with the url example).
>
> I don't have different pages that does the same job on some specific Profile. It's simplier... The same page needs to show information based on the current (stored on session) Profile the user chose. So, when the User Profile info is not on Session yet, when that page is opened, it needs to redirect automatically to the Profile Selection Page, so it redirects again to the last page when the user choose it.
>
> Example:
>
> Profile selection page : /user/profiles
> One page that needs the current profile chosen : /user/.../info/edit
>
> In this case, it's like profiles could edit different info.
>
> So, if the user just logged on and opened [ /user/.../info/edit ], it needs to redirect to the Profile Selection Page, attaching information to it like "when the user chose the profile, redirect again to [ /user/.../info/edit ]". The approach i said i used was attaching to the page activation context the URL of the "redirectTo" page, so it ended like:
>
> User requests [ /user/.../info/edit ]
> It redirects to [ /user/profiles/user$002info$002edit ]
> When the user choose the profile, it redirects to [ /user/.../info/edit ]
> And now the page could open properly
>
> Anyways, it was good to know the @Meta annotation. :)
>
> Thanks,
>
> Everton
>
>
>
> ________________________________
> De: Howard Lewis Ship <hl...@gmail.com>
> Para: Tapestry users <us...@tapestry.apache.org>
> Enviadas: Domingo, 24 de Janeiro de 2010 13:13:33
> Assunto: Re: Beast approach for a page redirection situation
>
> You could use the @Meta annotation to put meta data on each page,
> identifying which associated profile page to use (assuming that such a
> link is statically defined).  If that becomes cumbersome, you could
> define your own annotation, and contribute a component class transform
> worker to set the meta data from your annotation.
>
> MetaData is available from the component model:
> page.getComponentResources().getComponentModel().getMeta().
>
> On Sat, Jan 23, 2010 at 11:02 AM, Everton Agner
> <ev...@yahoo.com.br> wrote:
>> Hi,
>>
>> Let's assume that:
>>
>> - The user's Login info is stored on Session;
>> - Every user have many profiles;
>> - Plenty of pages works on one specific Profile for the user;
>> - The current user profile is always stored on Session also;
>> - I have a page of Profile selection that shows all of the user's profiles and let him choose which one he wants to work with;
>> - So, every page that needs the user's current profile looks on the @SessionState data... and if it doesn't exists yet, redirects to the Profile Selection Page;
>>
>> Now is the goal i need to get to it... When these pages redirect to the Profile Selection Page, they need to pass information about which page the Profile Selection Page needs to redirect automatically when the user select which profile he wants to.
>>
>> For my first approach, I thought about passing one String by the page activation context about the page path (like "user/profile/foo/bar"). It works, but i didn't like the URL result.
>>
>> I want to know which would be the best approach to get to my goal...
>>
>> I though about @InjectPage my Profile Selection Page and have in it one @Persist("flash") field like "redirectTo", so it's value is alive when the page is rendered, and cleared after that... Would that be ok?
>>
>> Thanks,
>>
>> Everton
>>
>>
>>
>>      ____________________________________________________________________________________
>> Veja quais são os assuntos do momento no Yahoo! +Buscados
>> http://br.maisbuscados.yahoo.com
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Res: Beast approach for a page redirection situation

Posted by Everton Agner <ev...@yahoo.com.br>.
Sorry, i think i didn't explaint it well (and also messed up with the url example).

I don't have different pages that does the same job on some specific Profile. It's simplier... The same page needs to show information based on the current (stored on session) Profile the user chose. So, when the User Profile info is not on Session yet, when that page is opened, it needs to redirect automatically to the Profile Selection Page, so it redirects again to the last page when the user choose it.

Example:

Profile selection page : /user/profiles
One page that needs the current profile chosen : /user/.../info/edit

In this case, it's like profiles could edit different info.

So, if the user just logged on and opened [ /user/.../info/edit ], it needs to redirect to the Profile Selection Page, attaching information to it like "when the user chose the profile, redirect again to [ /user/.../info/edit ]". The approach i said i used was attaching to the page activation context the URL of the "redirectTo" page, so it ended like:

User requests [ /user/.../info/edit ]
It redirects to [ /user/profiles/user$002info$002edit ] 
When the user choose the profile, it redirects to [ /user/.../info/edit ]
And now the page could open properly

Anyways, it was good to know the @Meta annotation. :)

Thanks,

Everton



________________________________
De: Howard Lewis Ship <hl...@gmail.com>
Para: Tapestry users <us...@tapestry.apache.org>
Enviadas: Domingo, 24 de Janeiro de 2010 13:13:33
Assunto: Re: Beast approach for a page redirection situation

You could use the @Meta annotation to put meta data on each page,
identifying which associated profile page to use (assuming that such a
link is statically defined).  If that becomes cumbersome, you could
define your own annotation, and contribute a component class transform
worker to set the meta data from your annotation.

MetaData is available from the component model:
page.getComponentResources().getComponentModel().getMeta().

On Sat, Jan 23, 2010 at 11:02 AM, Everton Agner
<ev...@yahoo.com.br> wrote:
> Hi,
>
> Let's assume that:
>
> - The user's Login info is stored on Session;
> - Every user have many profiles;
> - Plenty of pages works on one specific Profile for the user;
> - The current user profile is always stored on Session also;
> - I have a page of Profile selection that shows all of the user's profiles and let him choose which one he wants to work with;
> - So, every page that needs the user's current profile looks on the @SessionState data... and if it doesn't exists yet, redirects to the Profile Selection Page;
>
> Now is the goal i need to get to it... When these pages redirect to the Profile Selection Page, they need to pass information about which page the Profile Selection Page needs to redirect automatically when the user select which profile he wants to.
>
> For my first approach, I thought about passing one String by the page activation context about the page path (like "user/profile/foo/bar"). It works, but i didn't like the URL result.
>
> I want to know which would be the best approach to get to my goal...
>
> I though about @InjectPage my Profile Selection Page and have in it one @Persist("flash") field like "redirectTo", so it's value is alive when the page is rendered, and cleared after that... Would that be ok?
>
> Thanks,
>
> Everton
>
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: Beast approach for a page redirection situation

Posted by Howard Lewis Ship <hl...@gmail.com>.
You could use the @Meta annotation to put meta data on each page,
identifying which associated profile page to use (assuming that such a
link is statically defined).  If that becomes cumbersome, you could
define your own annotation, and contribute a component class transform
worker to set the meta data from your annotation.

MetaData is available from the component model:
page.getComponentResources().getComponentModel().getMeta().

On Sat, Jan 23, 2010 at 11:02 AM, Everton Agner
<ev...@yahoo.com.br> wrote:
> Hi,
>
> Let's assume that:
>
> - The user's Login info is stored on Session;
> - Every user have many profiles;
> - Plenty of pages works on one specific Profile for the user;
> - The current user profile is always stored on Session also;
> - I have a page of Profile selection that shows all of the user's profiles and let him choose which one he wants to work with;
> - So, every page that needs the user's current profile looks on the @SessionState data... and if it doesn't exists yet, redirects to the Profile Selection Page;
>
> Now is the goal i need to get to it... When these pages redirect to the Profile Selection Page, they need to pass information about which page the Profile Selection Page needs to redirect automatically when the user select which profile he wants to.
>
> For my first approach, I thought about passing one String by the page activation context about the page path (like "user/profile/foo/bar"). It works, but i didn't like the URL result.
>
> I want to know which would be the best approach to get to my goal...
>
> I though about @InjectPage my Profile Selection Page and have in it one @Persist("flash") field like "redirectTo", so it's value is alive when the page is rendered, and cleared after that... Would that be ok?
>
> Thanks,
>
> Everton
>
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org