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 Gary Tang <ga...@gmail.com> on 2006/01/12 05:06:59 UTC

Can I put a portlet into top.vm or bottom.vm in JetSpeed 2?

Hello:

Can I put a portlet into the page layout, like top.vm or bottom.vm in
JetSpeed2? I want to put a login portlet into the the header part.

Any answer would be appreciated!

Thanks in advance!

Gary Tang

Re: Can I put a portlet into top.vm or bottom.vm in JetSpeed 2?

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

Here is the critical stuff that would need to be added to header.vm:

<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr height="82">
        <td width="320" height="82"><img width="320" height="82" src="content/layout-xxx/images/bannerleft.jpg" border="0"></td>
        <td width="100%" height="82" background="content/layout-xxx/images/banner.jpg">
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr height="82">
                    #if($myPage.defaultSkin != "nologin")                   
                        #if($userPrincipal)
                            #if(!$requestContext.getSessionAttribute("com.xxx.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>
                                $requestContext.setSessionAttribute("com.xxx.user",$userPrincipalName)
                            #end
                            <!-- 10/06/2004 - temporarily remove logout graphics and capability
                            <td height="82" class="Login"><a href='$response.encodeURL("${servletRequest.getContextPath()}/login/logout")' class="LoginLink"><img src="content/layout-xxx/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=$servletRequest.getSession().getAttribute($RETRYCOUNT))
                            #if($retryCount > 0) 
                                <td height="82" class="LoginError">Invalid username or password,<br>please try again:</td>
                            #end
                            <td height="82">
                                <form method="POST" action='$response.encodeURL("${servletRequest.getContextPath()}/login/proxy")' style="display:inline">
                                    <input type="hidden" name="$DESTINATION" value="${servletRequest.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-xxx/images/login.jpg" border="0"></a></td>
                        #end
                    #end
                    #set($logoName = $myPage.defaultSkin)
                    <td width="100%" height="82" align="center"><img src="content/layout-xxx/images/logo-${logoName}.gif" border="0"></td>
                </tr>
            </table>
        </td>
        <td width="4" height="82"><img width="4" height="82" src="content/layout-xxx/images/bannerright.jpg" border="0"></td>
    </tr>
</table>

This works in M3... contact me again in a few days if you do not get it
ported to 2.0+. BTW, there are other tricks in here as well :-).

Randy

On Thu, 2006-01-12 at 08:06 -0500, Gary Tang wrote:
> Randy:
> 
> Thank you for your quick response!
> I can not find the example. Could you please send me a copy or point me to
> the right url?
> 
> Thank you very much!
> 
> Gary Tang
> 
> On 1/12/06, Randy Watler <wa...@wispertel.net> wrote:
> >
> > Gary,
> >
> > This is possible, but non-trivial. I believe it would require a custom
> > layout template and/or layout portlet.
> >
> > We include a login form in the header.vm and go that route.
> >
> > There is an example in the archives of this list that I have sent out.
> > Let me know if you cannot locate it. I will be porting to 2.0 decorators
> > in the next few days and can copy code here if you are still stuck.
> >
> > HTH,
> >
> > Randy
> >
> > On Wed, 2006-01-11 at 23:06 -0500, Gary Tang wrote:
> > > Hello:
> > >
> > > Can I put a portlet into the page layout, like top.vm or bottom.vm in
> > > JetSpeed2? I want to put a login portlet into the the header part.
> > >
> > > Any answer would be appreciated!
> > >
> > > Thanks in advance!
> > >
> > > Gary Tang
> >
> >
> > ---------------------------------------------------------------------
> > 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: Can I put a portlet into top.vm or bottom.vm in JetSpeed 2?

Posted by Gary Tang <ga...@gmail.com>.
Randy:

Thank you for your quick response!
I can not find the example. Could you please send me a copy or point me to
the right url?

Thank you very much!

Gary Tang

On 1/12/06, Randy Watler <wa...@wispertel.net> wrote:
>
> Gary,
>
> This is possible, but non-trivial. I believe it would require a custom
> layout template and/or layout portlet.
>
> We include a login form in the header.vm and go that route.
>
> There is an example in the archives of this list that I have sent out.
> Let me know if you cannot locate it. I will be porting to 2.0 decorators
> in the next few days and can copy code here if you are still stuck.
>
> HTH,
>
> Randy
>
> On Wed, 2006-01-11 at 23:06 -0500, Gary Tang wrote:
> > Hello:
> >
> > Can I put a portlet into the page layout, like top.vm or bottom.vm in
> > JetSpeed2? I want to put a login portlet into the the header part.
> >
> > Any answer would be appreciated!
> >
> > Thanks in advance!
> >
> > Gary Tang
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Can I put a portlet into top.vm or bottom.vm in JetSpeed 2?

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

This is possible, but non-trivial. I believe it would require a custom
layout template and/or layout portlet.

We include a login form in the header.vm and go that route.

There is an example in the archives of this list that I have sent out.
Let me know if you cannot locate it. I will be porting to 2.0 decorators
in the next few days and can copy code here if you are still stuck.

HTH,

Randy

On Wed, 2006-01-11 at 23:06 -0500, Gary Tang wrote:
> Hello:
> 
> Can I put a portlet into the page layout, like top.vm or bottom.vm in
> JetSpeed2? I want to put a login portlet into the the header part.
> 
> Any answer would be appreciated!
> 
> Thanks in advance!
> 
> Gary Tang


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