[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jetspeed-user
Subject:    Re: Programmatically Requesting a Jetspeed Page
From:       Raphaël_Luta <raphael () apache ! org>
Date:       2004-05-29 7:26:46
Message-ID: 8A6478AD-B141-11D8-98B1-003065A2559C () apache ! org
[Download RAW message or body]


Le 25 mai 04, à 15:55, Jason Shindler a écrit :

> Hello,
> I wish to email the contents of a page from inside of my Jetspeed
> portlet. The page requires authentication, so I'm passing the current
> session's JSESSIONID as a cookie so my program can be authenticated. 
> For
> some reason this is not working:
>
<snip code>
>
> The code requests the page, but returns a login screen instead of the
> page I want. I believe it is somehow ignoring the cookie, but can't put
> my finger on why. Any ideas?
>

I'm not sure exactly how you have constructed your email module but I 
would
strongly advise you *against* using sub-HTTP connections to generate 
your
mail messages.

Since you seem ti be able to rely on the user session, your code is 
probably
called during a user request, in which case Jetspeed will have populated
the RunData object with all the necessary context.

Then define a custom velocity template for your mail and in this 
template use
$jetspeed.getPane(pagename). It should work but you will want to save
the Profile stored in rundata before rendering the velocity template 
and restore
it after because $jetspeed.getPane() will set the page globally for the 
request.

Make sure to take a look at

src/java/org/apache/jetspeed/util/template/JetspeedTool.java
webapp/WEB-INF/templates/vm/screens/html/Home.vm

to have a better idea of what you can do with this JetspeedTool (viewed 
as
$jetspeed in Velocity templates)

--
Raphaël Luta - raphael@apache.org
Apache Jetspeed - Enterprise Portal in Java
http://portals.apache.org/


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic