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

List:       jetspeed-user
Subject:    RE: How to get roles in vm?
From:       markus () familie-kuhrmann ! de
Date:       2004-09-17 11:58:54
Message-ID: 34357.80.85.196.92.1095422426.squirrel () www ! webmail-panel ! de
[Download RAW message or body]

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:devinder.sachdeva@db.com]
> 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: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.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