You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Sven Richter <sr...@gmx.net> on 2005/09/07 00:05:43 UTC

J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Hello,

At the moment I'm using a logout portlet the user can reach by clicking 
on a tab, which is then showing a page with the logout portlet. Now I'm 
trying to find a way to implement an Action, where a user can logout by 
simply clicking on the tab.

Is that even possible?

Thanks a lot,
Sven.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by Sven Richter <sr...@gmx.net>.
Hello David,

David Sean Taylor schrieb:

> Sven Richter wrote:
>
>> Hello David,
>>
>> well, I only need a login for one part of my portal, not the whole 
>> thing. So the login in the top nav would be useless for most of the 
>> users.
>>
> For the logout link, why not put some logic in your top nav to only 
> display the logout link if a user is already logged on. There are 
> examples of that in our top navigations.
>
The top nav is used for a banner.

> As for the login link, it sounds like its only displayed on certain 
> pages, or are there other conditions?
>
I put the functionality in an extra portlet, which is used in a certain 
psml file for users. The portlet is used for login and logout, depending 
on the status of the user. Now I want to create an extra portlet for 
logout, which is supposed to be executed, when a logged-in user is 
clicking on a tab.

I hope I expressed my intentitions a bit more precicely this time.

Thank you very much,
Sven.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by David Sean Taylor <da...@bluesunrise.com>.
Sven Richter wrote:
> Hello David,
> 
> well, I only need a login for one part of my portal, not the whole 
> thing. So the login in the top nav would be useless for most of the users.
> 
For the logout link, why not put some logic in your top nav to only 
display the logout link if a user is already logged on. There are 
examples of that in our top navigations.

As for the login link, it sounds like its only displayed on certain 
pages, or are there other conditions?


> Is there really no easy way to execute the Logout action (or to logout 
> any other way) by clicking on a tab?
> 
I still think the Redirect portlet would work with a few changes 
described in the last email. Im Sorry but for tabs, since tabs in J1 are 
associated only with portlets, I can't think of another way to do this 
without writing a portlet or extending the redirect portlet to work with 
local links.

-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by Sven Richter <sr...@gmx.net>.
Hello David,

well, I only need a login for one part of my portal, not the whole 
thing. So the login in the top nav would be useless for most of the users.

Is there really no easy way to execute the Logout action (or to logout 
any other way) by clicking on a tab?


Thanks again for your help,
Sven.


David Sean Taylor schrieb:

> Sven Richter wrote:
>
>> Hello David,
>>
>> thanks a lot for your help, but unfortunately it dosen't work like 
>> that. The pages with the portlets are not generated from the psml, 
>> when I include this portlet in the portlet registry and refer to it 
>> in psml files. The problem probably is, that you use a hard link to 
>> the psml file of the admin (I tried to include this portlet in the 
>> psml of the admin and not the other users, but it doesn't work 
>> either). Is there no way to register the portlet with an relative 
>> path to the psml file, where the portlet is used? Or maybe a 
>> different way to call the action JLogoutUser?
>
>
> Why not extend RedirectPortlet and override the createDynamicUrl 
> method instead generate a relative JsLink?
>
> Anyway, you don't like the logout as a simple $link on the top nav ?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by David Sean Taylor <da...@bluesunrise.com>.
Sven Richter wrote:
> Hello David,
> 
> thanks a lot for your help, but unfortunately it dosen't work like that. 
> The pages with the portlets are not generated from the psml, when I 
> include this portlet in the portlet registry and refer to it in psml 
> files. The problem probably is, that you use a hard link to the psml 
> file of the admin (I tried to include this portlet in the psml of the 
> admin and not the other users, but it doesn't work either). Is there no 
> way to register the portlet with an relative path to the psml file, 
> where the portlet is used? Or maybe a different way to call the action 
> JLogoutUser?

Why not extend RedirectPortlet and override the createDynamicUrl method 
instead generate a relative JsLink?

Anyway, you don't like the logout as a simple $link on the top nav ?


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by Sven Richter <sr...@gmx.net>.
Hello David,

thanks a lot for your help, but unfortunately it dosen't work like that. 
The pages with the portlets are not generated from the psml, when I 
include this portlet in the portlet registry and refer to it in psml 
files. The problem probably is, that you use a hard link to the psml 
file of the admin (I tried to include this portlet in the psml of the 
admin and not the other users, but it doesn't work either). Is there no 
way to register the portlet with an relative path to the psml file, 
where the portlet is used? Or maybe a different way to call the action 
JLogoutUser?

I don't know what the problem is, but none of the pages, generated from 
the psml files, are actually generated. All you can see is an empty page.

Thanks a lot,
Sven.

David Sean Taylor schrieb:

> Jacek Wiślicki wrote:
>
>> Wiadomosc od Sven Richter z 2005-09-07 00:05 brzmiala:
>>
>>> At the moment I'm using a logout portlet the user can reach by 
>>> clicking on a tab, which is then showing a page with the logout 
>>> portlet. Now I'm trying to find a way to implement an Action, where 
>>> a user can logout by simply clicking on the tab.
>>>
>>> Is that even possible?
>>
>>
>
> Normally its done thru a link:
>
> <a href="$jslink.setAction($config.getString("action.logout"))" 
> $FontStyle>$l10n.TOP_LOGOUT</a>
>
> but to get it to work in a tab is more challenging
> I would try a redirect portlet with the URL set to:
>
> http://localhost:8080/jetspeed/portal/media-type/html/user/admin/page/default.psml?action=JLogoutUser 
>
>
> although you may want to extend and create that at runtime
>
> See the portlets.xreg:
>
>     <portlet-entry name="RedirectPortlet" hidden="false" 
> type="abstract" application="false">
>         <meta-info>
>             <title>Redirect Portlet</title>
>             <description>Redirects the portal to the configured URL 
> when associated with a Jetspeed menu.</description>
>         </meta-info>
>
> <classname>org.apache.jetspeed.portal.portlets.RedirectPortlet</classname> 
>
>         <parameter name="url" 
> value="http://localhost:8080/jetspeed/portal/media-type/html/user/admin/page/default.psml?action=JLogoutUser" 
>
>
>  hidden="false" cachedOnName="true" cachedOnValue="true">
>             <meta-info>
>                 <title>URL</title>
>                 <description>Redirects a menu option to this 
> URL</description>
>             </meta-info>
>         </parameter>
>
>
> Just don't put it on the first tab or it will log you out immediately!
>
>> Well, I'm trying to perform a similar task. A solution in my case is 
>> rather simple, as 'logut' action is realized with redirecting to 
>> something like 'http://localhost:8080/jetspeed/login/logout' (of 
>> course, generate the URL dynamicaly, so that it points to your 
>> portal's appropriate resource), which link can be placed anywhere, 
>> even in a tab (by a decorator script).
>
>
> The question was for 1.6, this is a 2.0 solution
>
>> By the way, I'm trying to title such a link as 'logout username' and 
>> 'not log-on' if none user is logged on. Is there any Jetspeed global 
>> variable in Velocity storing a name (or other data) of a current 
>> user? Or I should rather create it myself?
>>
> (this is off thread now, because im speaking of 2.0)
> we don't store any user attributes in our tables
> try getting it from the user attributes (which you will need to manage)
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by Jacek Wiślicki <ja...@gmail.com>.
Wiadomosc od David Sean Taylor z 2005-09-07 10:27 brzmiala:

>> By the way, I'm trying to title such a link as 'logout username' and 
>> 'not log-on' if none user is logged on. Is there any Jetspeed global 
>> variable in Velocity storing a name (or other data) of a current user? 
>> Or I should rather create it myself?
> (this is off thread now, because im speaking of 2.0)
> we don't store any user attributes in our tables
> try getting it from the user attributes (which you will need to manage)
Well, what I meant was what I've finally ;) found in JetspeedPowerTool 
source, i.e.: $jetspeed.getLoggedOn() and $jetspeed.getSubject() and 
further $jetspeed.getSubject().getPrincipals().

-- 
pozdrawiam,
     Jacek Wislicki

jacek.wislicki@gmail.com
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by David Sean Taylor <da...@bluesunrise.com>.
Jacek Wiślicki wrote:
> Wiadomosc od Sven Richter z 2005-09-07 00:05 brzmiala:
> 
>> At the moment I'm using a logout portlet the user can reach by 
>> clicking on a tab, which is then showing a page with the logout 
>> portlet. Now I'm trying to find a way to implement an Action, where a 
>> user can logout by simply clicking on the tab.
>>
>> Is that even possible?
> 

Normally its done thru a link:

<a href="$jslink.setAction($config.getString("action.logout"))" 
$FontStyle>$l10n.TOP_LOGOUT</a>

but to get it to work in a tab is more challenging
I would try a redirect portlet with the URL set to:

http://localhost:8080/jetspeed/portal/media-type/html/user/admin/page/default.psml?action=JLogoutUser

although you may want to extend and create that at runtime

See the portlets.xreg:

     <portlet-entry name="RedirectPortlet" hidden="false" 
type="abstract" application="false">
         <meta-info>
             <title>Redirect Portlet</title>
             <description>Redirects the portal to the configured URL 
when associated with a Jetspeed menu.</description>
         </meta-info>
 
<classname>org.apache.jetspeed.portal.portlets.RedirectPortlet</classname>
         <parameter name="url" 
value="http://localhost:8080/jetspeed/portal/media-type/html/user/admin/page/default.psml?action=JLogoutUser"

  hidden="false" cachedOnName="true" cachedOnValue="true">
             <meta-info>
                 <title>URL</title>
                 <description>Redirects a menu option to this 
URL</description>
             </meta-info>
         </parameter>


Just don't put it on the first tab or it will log you out immediately!

> Well, I'm trying to perform a similar task. A solution in my case is 
> rather simple, as 'logut' action is realized with redirecting to 
> something like 'http://localhost:8080/jetspeed/login/logout' (of course, 
> generate the URL dynamicaly, so that it points to your portal's 
> appropriate resource), which link can be placed anywhere, even in a tab 
> (by a decorator script).

The question was for 1.6, this is a 2.0 solution

> By the way, I'm trying to title such a link as 'logout username' and 
> 'not log-on' if none user is logged on. Is there any Jetspeed global 
> variable in Velocity storing a name (or other data) of a current user? 
> Or I should rather create it myself?
> 
(this is off thread now, because im speaking of 2.0)
we don't store any user attributes in our tables
try getting it from the user attributes (which you will need to manage)


-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: J1.6: How to execute an Action (Logout) by simply clicking on a Tab?

Posted by Jacek Wiślicki <ja...@gmail.com>.
Wiadomosc od Sven Richter z 2005-09-07 00:05 brzmiala:

> At the moment I'm using a logout portlet the user can reach by clicking 
> on a tab, which is then showing a page with the logout portlet. Now I'm 
> trying to find a way to implement an Action, where a user can logout by 
> simply clicking on the tab.
> 
> Is that even possible?
Well, I'm trying to perform a similar task. A solution in my case is 
rather simple, as 'logut' action is realized with redirecting to 
something like 'http://localhost:8080/jetspeed/login/logout' (of course, 
generate the URL dynamicaly, so that it points to your portal's 
appropriate resource), which link can be placed anywhere, even in a tab 
(by a decorator script).
By the way, I'm trying to title such a link as 'logout username' and 
'not log-on' if none user is logged on. Is there any Jetspeed global 
variable in Velocity storing a name (or other data) of a current user? 
Or I should rather create it myself?

-- 
pozdrawiam,
     Jacek Wislicki

jacek.wislicki@gmail.com
tel.: +48 502 408 444
gg: 2540358
skype: jacek_wislicki

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org