roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MK <mkod...@yahoo.com>
Subject Re: Passing variables via context, etc.?
Date Sat, 02 May 2009 09:40:55 GMT
I actually want the screen name of the logged in user.

I saw the example authorized user pluginmodel that comes with the source. I deployed it and
tried to use it but I don't seem to be able to access the variables. I tried the following
in the velocity templates for the frontpage and the jsp for adding entries:

debug full name $authenticated.user.fullName <br/>
debug screen name $authenticated.user.screenName <br/>


I also tried using the $user object:

debug full name $user.fullName <br/>
debug user name $user.userName <br/>

None of them worked. Can anybody point out what I am doing wrong? How can I access the user
model and the custom authenticated model setup with the plugin??

Cheers,
Manu



________________________________
From: Henning Brune <henning.brune@googlemail.com>
To: user@roller.apache.org
Sent: Friday, May 1, 2009 11:26:09 PM
Subject: Re: Passing variables via context, etc.?

Hello Manu,

>
>        1. How do I find a logged in user's screen name. I do not seem to
> find that information in the published models?


I you want to display the screenname of the creator of a blog entry use '
$entry.creator.screenName'

But you are right. In the the roller template guide:

http://apache.speedbone.de/roller/roller-4/v4.0.1/docs/roller-template-guide.pdf

the attribute screenName is not documented with the 'User' model.

>
>        2. How can I pass information to roller via the context? How do I
> access the request object in a velocity template and in a JSP file?Thanks in
> advance,


If you want to access the request e.g. to use request parameters you should
take a look at a previous thread startin here:

http://osdir.com/ml/user-roller.apache.org/2009-04/msg00005.html

It is (almost) not possible to make use of request parameters in roller
pages because of caching.

-Henning

>
> Manu
>
>
>
>




-- 
Dipl.-Inform. Henning Brune

http://ekvv.uni-bielefeld.de/pers_publ/publ/PersonDetail.jsp?personId=10185

Universit├Ąt Bielefeld
Projekt BIS
Postfach 10 01 31
D-33501 Bielefeld

Die neue Homepage des BIS Projektes:
http://www.uni-bielefeld.de/bis/



      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message