hi,

i had the same problem. my solution was to update the following class

JetspeedVelocityPage

in the package

package org.apache.jetspeed.modules.pages;

in this class you can put the logic in the context, like i did so:

/* put the external information into the context */
String username = data.getUser().getUserName();
try {
  context.put("external", new Boolean(new
CommonLogic().isExternalUser().toString()));
} catch (Exception e) { e.printStackTrace();
}

after this, you can go to the top.vm and get the output.

kind regards,
markus

> Hi Devinder,
> Thank you, but I cant have an action class as I am doing some
> customizations
> on the top.vm which is used by Jetspeed to render the header. So this is
> not
> portlet specific and this appears even when there are no portlets for the
> user.
>
> Can we specify action classes for this too? If not, is there some way to
> get
> the roles directly in the vm?
> $data in that vm gets me the JetspeedRunData. Is there some way to get the
> roles from that?
>
>
> Regards,
> Anoop
>
> -----Original Message-----
> From: Devinder Sachdeva [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 14, 2004 6:52 PM
> To: Jetspeed Users List
> Subject: Re: How to get roles in vm?
>
>
> Get role name in Action class
> and store the role in context and use this context object  in VM
>
>
>
> The followings code may be useful
>
>
>      JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
> String role =link.getRoleName();
>     context.put(ROLE,role);
>
>
> Cheers
> Devinder
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to