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 Shah Amit <am...@hotmail.com> on 2005/06/23 19:58:03 UTC

J2 - Login fields in Banner area

Hi all,

I need to put the login fields on the banner area which implies I have to 
put them in the decorator. Now I use the existing mechanism shipped with 
jetspeed without anychange, and till now I had the "login portlet" that 
ships with jetspeed as a place holder.

In the login portlet, action for the html form is generated via c:url 
taglibrary so it takes care of encoding it. How can I do it in velocity :-( 
because the decorators are written in velocity.

Any helps, guidelines...

Thanks,
Amit



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


Re: J2 - Login fields in Banner area

Posted by Randy Watler <wa...@wispertel.net>.
Amit,

Forgot this line before content below:

#set($userPrincipal=$request.getUserPrincipal())

Randy

Randy Watler wrote:

> Amit,
>
> Hope this helps:
>
> Randy
>
> ...
>
> <table cellpadding="0" cellspacing="0" border="0" width="100%">
>    <tr height="82">
>        <td width="312" height="82"><img width="312" height="82" 
> src="content/layout/images/bannerleft.jpg" border="0"></td>
>        <td width="100%" height="82" 
> background="content/layout/images/banner.jpg">
>            <table width="100%" cellpadding="0" cellspacing="0" 
> border="0">
>                <tr height="82">
>                    #if($myPage.defaultSkin != "nologin")
>                        #if($userPrincipal)
>                            
> #if(!$request.getSession().getAttribute("com.myco.user"))
>                                
> #set($userPrincipalName=$userPrincipal.getName())
>                                #if($userPrincipalName.indexOf("@") != -1)
>                                    
> #set($userPrincipalName=$userPrincipalName.substring(0,$userPrincipalName.indexOf("@"))) 
>
>                                #end
>                                <td height="82" class="Login">Welcome 
> ${userPrincipalName}!</td>
>                                
> $request.getSession().setAttribute("com.myco.user",$userPrincipalName)
>                            #end
>                            <!-- 10/06/2004 - temporarily remove logout 
> graphics and capability
>                            <td height="82" class="Login"><a 
> href='$response.encodeURL("${request.getContextPath()}/login/logout")' 
> class="LoginLink"><img src="content/layout/images/logout.jpg" 
> border="0"></a></td>
>                            -->
>                        #else
>                            
> #set($RETRYCOUNT='org.apache.jetspeed.login.retrycount')
>                            
> #set($DESTINATION='org.apache.jetspeed.login.destination')
>                            
> #set($USERNAME='org.apache.jetspeed.login.username')
>                            
> #set($PASSWORD='org.apache.jetspeed.login.password')
>                            
> #set($retryCount=$request.getSession().getAttribute($RETRYCOUNT))
>                            #if($retryCount > 0)
>                                <td height="82" 
> class="LoginError">Invalid username or password,<br>($retryCount 
> attempts), please try again:</td>
>                            #end
>                            <td height="82">
>                                <form method="POST" 
> action='$response.encodeURL("${request.getContextPath()}/login/proxy")' 
> style="display:inline">
>                                    <input type="hidden" 
> name="$DESTINATION" value="${request.getRequestURL()}">
>                                    <table cellpadding="0" 
> cellspacing="0" border="0">
>                                        <tr><td 
> class="Login">Username</td><td><input type="text" size="15" 
> name="$USERNAME" onkeypress='var 
> focus=false;if(window.event){focus=(window.event.keyCode==13);}else 
> if(event){focus=(event.which==13);}if(focus)document.forms[0].elements[2].focus();'></td></tr> 
>
>                                        <tr><td 
> class="Login">Password</td><td><input type="password" size="15" 
> name="$PASSWORD" onkeypress='var 
> submit=false;if(window.event){submit=(window.event.keyCode==13);}else 
> if(event){submit=(event.which==13);}if(submit)document.forms[0].submit();'></td></tr> 
>
>
>                                    </table>
>                                </form>
>                            </td>
>                            <td height="82" class="Login"><a 
> href='javascript:document.forms[0].submit();' class="LoginLink"><img 
> src="content/layout/images/login.jpg" border="0"></a></td>
>                        #end
>                    #end
>                    <td width="100%" height="82" align="center"><img 
> src="content/layout/images/logo.gif" border="0"></td>
>                </tr>
>            </table>
>        </td>
>        <td width="4" height="82"><img width="4" height="82" 
> src="content/layout/images/bannerright.jpg" border="0"></td>
>    </tr>
> </table>
>
> ...
>
>
>
> Shah Amit wrote:
>
>> Hi all,
>>
>> I need to put the login fields on the banner area which implies I 
>> have to put them in the decorator. Now I use the existing mechanism 
>> shipped with jetspeed without anychange, and till now I had the 
>> "login portlet" that ships with jetspeed as a place holder.
>>
>> In the login portlet, action for the html form is generated via c:url 
>> taglibrary so it takes care of encoding it. How can I do it in 
>> velocity :-( because the decorators are written in velocity.
>>
>> Any helps, guidelines...
>>
>> Thanks,
>> Amit
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>


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


Re: J2 - Login fields in Banner area

Posted by Shah Amit <am...@hotmail.com>.
Thanks a lot Randy. This definately helps!


----Original Message Follows----
From: Randy Watler <wa...@wispertel.net>
Reply-To: "Jetspeed Users List" <je...@portals.apache.org>
To: Jetspeed Users List <je...@portals.apache.org>
Subject: Re: J2 - Login fields in Banner area
Date: Thu, 23 Jun 2005 16:16:46 -0600

Amit,

Hope this helps:

Randy

...

<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr height="82">
        <td width="312" height="82"><img width="312" height="82" 
src="content/layout/images/bannerleft.jpg" border="0"></td>
        <td width="100%" height="82" 
background="content/layout/images/banner.jpg">
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr height="82">
                    #if($myPage.defaultSkin != "nologin")
                        #if($userPrincipal)
                            
#if(!$request.getSession().getAttribute("com.myco.user"))
                                
#set($userPrincipalName=$userPrincipal.getName())
                                #if($userPrincipalName.indexOf("@") != -1)
                                    
#set($userPrincipalName=$userPrincipalName.substring(0,$userPrincipalName.indexOf("@")))
                                #end
                                <td height="82" class="Login">Welcome 
${userPrincipalName}!</td>
                                
$request.getSession().setAttribute("com.myco.user",$userPrincipalName)
                            #end
                            <!-- 10/06/2004 - temporarily remove logout 
graphics and capability
                            <td height="82" class="Login"><a 
href='$response.encodeURL("${request.getContextPath()}/login/logout")' 
class="LoginLink"><img src="content/layout/images/logout.jpg" 
border="0"></a></td>
                            -->
                        #else
                            
#set($RETRYCOUNT='org.apache.jetspeed.login.retrycount')
                            
#set($DESTINATION='org.apache.jetspeed.login.destination')
                            
#set($USERNAME='org.apache.jetspeed.login.username')
                            
#set($PASSWORD='org.apache.jetspeed.login.password')
                            
#set($retryCount=$request.getSession().getAttribute($RETRYCOUNT))
                            #if($retryCount > 0)
                                <td height="82" class="LoginError">Invalid 
username or password,<br>($retryCount attempts), please try again:</td>
                            #end
                            <td height="82">
                                <form method="POST" 
action='$response.encodeURL("${request.getContextPath()}/login/proxy")' 
style="display:inline">
                                    <input type="hidden" name="$DESTINATION" 
value="${request.getRequestURL()}">
                                    <table cellpadding="0" cellspacing="0" 
border="0">
                                        <tr><td 
class="Login">Username</td><td><input type="text" size="15" name="$USERNAME" 
onkeypress='var 
focus=false;if(window.event){focus=(window.event.keyCode==13);}else 
if(event){focus=(event.which==13);}if(focus)document.forms[0].elements[2].focus();'></td></tr>
                                        <tr><td 
class="Login">Password</td><td><input type="password" size="15" 
name="$PASSWORD" onkeypress='var 
submit=false;if(window.event){submit=(window.event.keyCode==13);}else 
if(event){submit=(event.which==13);}if(submit)document.forms[0].submit();'></td></tr>

                                    </table>
                                </form>
                            </td>
                            <td height="82" class="Login"><a 
href='javascript:document.forms[0].submit();' class="LoginLink"><img 
src="content/layout/images/login.jpg" border="0"></a></td>
                        #end
                    #end
                    <td width="100%" height="82" align="center"><img 
src="content/layout/images/logo.gif" border="0"></td>
                </tr>
            </table>
        </td>
        <td width="4" height="82"><img width="4" height="82" 
src="content/layout/images/bannerright.jpg" border="0"></td>
    </tr>
</table>

...



Shah Amit wrote:

>Hi all,
>
>I need to put the login fields on the banner area which implies I have to 
>put them in the decorator. Now I use the existing mechanism shipped with 
>jetspeed without anychange, and till now I had the "login portlet" that 
>ships with jetspeed as a place holder.
>
>In the login portlet, action for the html form is generated via c:url 
>taglibrary so it takes care of encoding it. How can I do it in velocity :-( 
>because the decorators are written in velocity.
>
>Any helps, guidelines...
>
>Thanks,
>Amit
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>


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



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


Re: J2 - Login fields in Banner area

Posted by Randy Watler <wa...@wispertel.net>.
Amit,

Hope this helps:

Randy

...

<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr height="82">
        <td width="312" height="82"><img width="312" height="82" src="content/layout/images/bannerleft.jpg" border="0"></td>
        <td width="100%" height="82" background="content/layout/images/banner.jpg">
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr height="82">
                    #if($myPage.defaultSkin != "nologin")
                        #if($userPrincipal)
                            #if(!$request.getSession().getAttribute("com.myco.user"))
                                #set($userPrincipalName=$userPrincipal.getName())
                                #if($userPrincipalName.indexOf("@") != -1)
                                    #set($userPrincipalName=$userPrincipalName.substring(0,$userPrincipalName.indexOf("@")))
                                #end
                                <td height="82" class="Login">Welcome ${userPrincipalName}!</td>
                                $request.getSession().setAttribute("com.myco.user",$userPrincipalName)
                            #end
                            <!-- 10/06/2004 - temporarily remove logout graphics and capability
                            <td height="82" class="Login"><a href='$response.encodeURL("${request.getContextPath()}/login/logout")' class="LoginLink"><img src="content/layout/images/logout.jpg" border="0"></a></td>
                            -->
                        #else
                            #set($RETRYCOUNT='org.apache.jetspeed.login.retrycount')
                            #set($DESTINATION='org.apache.jetspeed.login.destination')
                            #set($USERNAME='org.apache.jetspeed.login.username')
                            #set($PASSWORD='org.apache.jetspeed.login.password')
                            #set($retryCount=$request.getSession().getAttribute($RETRYCOUNT))
                            #if($retryCount > 0)
                                <td height="82" class="LoginError">Invalid username or password,<br>($retryCount attempts), please try again:</td>
                            #end
                            <td height="82">
                                <form method="POST" action='$response.encodeURL("${request.getContextPath()}/login/proxy")' style="display:inline">
                                    <input type="hidden" name="$DESTINATION" value="${request.getRequestURL()}">
                                    <table cellpadding="0" cellspacing="0" border="0">
                                        <tr><td class="Login">Username</td><td><input type="text" size="15" name="$USERNAME" onkeypress='var focus=false;if(window.event){focus=(window.event.keyCode==13);}else if(event){focus=(event.which==13);}if(focus)document.forms[0].elements[2].focus();'></td></tr>
                                        <tr><td class="Login">Password</td><td><input type="password" size="15" name="$PASSWORD" onkeypress='var submit=false;if(window.event){submit=(window.event.keyCode==13);}else if(event){submit=(event.which==13);}if(submit)document.forms[0].submit();'></td></tr>

                                    </table>
                                </form>
                            </td>
                            <td height="82" class="Login"><a href='javascript:document.forms[0].submit();' class="LoginLink"><img src="content/layout/images/login.jpg" border="0"></a></td>
                        #end
                    #end
                    <td width="100%" height="82" align="center"><img src="content/layout/images/logo.gif" border="0"></td>
                </tr>
            </table>
        </td>
        <td width="4" height="82"><img width="4" height="82" src="content/layout/images/bannerright.jpg" border="0"></td>
    </tr>
</table>

...



Shah Amit wrote:

> Hi all,
>
> I need to put the login fields on the banner area which implies I have 
> to put them in the decorator. Now I use the existing mechanism shipped 
> with jetspeed without anychange, and till now I had the "login 
> portlet" that ships with jetspeed as a place holder.
>
> In the login portlet, action for the html form is generated via c:url 
> taglibrary so it takes care of encoding it. How can I do it in 
> velocity :-( because the decorators are written in velocity.
>
> Any helps, guidelines...
>
> Thanks,
> Amit
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>


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