This question has been asked before and there is really no easy way to
include a portal as a fragment of the header or footer at the moment.

What you could do (in theory) is leave visible markup out of your
header.vm and create a nested layout structure in which the first
layout is a one column layout where the first row is the login portlet
that has been modified to include your header.  Then the second row is
a two or three-column layout with regular portlets.  Doesn't sound
very pretty though.

All that being said, if it is just the login you need in the header
(not other portlets) I'll describe a little trick that you can use.

First, put a form in the markup of your header.vm.  At a minumum, it
should contain:

<form name="loginForm" method="post" action="/jetspeed/login/proxy">
<input name="org.apache.jetspeed.login.username" type="text" size="15">
<input name="org.apache.jetspeed.login.password" type="password" size="15">
<input type="submit" value="Login">
</form>

Incorporate this and mark it up as you need in your header.vm.

This will work no problem provided the user provides a correct
username and password.

If they do not, you'll need to setup a page to redirect them to when
it fails.  So second, you'll need to create a portal psml page, say in
pages/login.psml that contains the actual login portlet.

And third and finally, you'll need to modify
org.apache.jetspeed.login.LoginErrorServlet and change:

if (destination == null)
           destination = request.getContextPath() + "/";

to

if (destination == null)
           destination = request.getContextPath() + "/login.psml";

Then, if the user uses an incorrect username/password combination,
they'll get redirected to /login.psml with the usual login failure
messages, etc.

This *should* work in theory.  I have only needed to do the first step
because of my situation.  In my situation, pretty much all portal
pages are protected from unlogged in users except to pages in
pages/_user/guest:

default-page.psml - this is the same as the login.psml that I describe above
forgot-password.psml - a publicly accessible forgot password page
containing a custom forgot password portlet.

We have a public corporate website which has in the header, the login
form described in step one.  If a user successfully authenticates
against it, they are immediately sent to pages/default-page.psml
(which is the portal splash page).  If the login is unsuccessful, they
are redirected to pages/_user/guest/default-page.psml because they are
the "guest" user.  Because of this, I didn't have to modify the
LoginErrorServlet, but the basic principal is the same.

In fact, if you wanted to avoid having to modify that servlet, I guess
you could use the same method as me, just put all your publicly
accessible pages under pages/_user/guest.

HTH,
aaron

On 5/31/06, gaurav goel <[EMAIL PROTECTED]> wrote:
Hi,
How can  a portlet be deployed on the portal header??I want to deploy a
login portlet on top of the page i.e on the portal header.How can this be
done?

--
Regards,
Gaurav Goel.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to