You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Michael Wechner <mi...@wyona.org> on 2003/07/11 01:04:27 UTC

org.apache.lenya.cms.ac2.Identity

Hi

How can I get the username out of ac2.Identity?

Thanks

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: org.apache.lenya.cms.ac2.Identity

Posted by Michael Wechner <mi...@wyona.org>.
Andreas Hartmann wrote:
> Michael Wechner wrote:
> 
>> How can I get the username out of ac2.Identity?
> 
> 
> At the moment:
> 
> Identifiable identifiables[] = identity.getIdentifiables();
> User user = null;
> int i = 0;
> while (user == null && i < identifiables.length()) {
>     if (identifiables[i] instanceof User) {
>         user = (User) identifiables[i];
>     }
> }
> 
> if (user != null) {
>     String id = user.getId();
>     ...
> }
> 
> But we can add hasUser() and getUser() methods to Identity.

Thanks very much. I implemented getUser() into Identity.

Michael

> 
> Andreas
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-dev-help@cocoon.apache.org
> 
> 


-- 
Michael Wechner
Wyona Ltd.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: org.apache.lenya.cms.ac2.Identity

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:

> How can I get the username out of ac2.Identity?

At the moment:

Identifiable identifiables[] = identity.getIdentifiables();
User user = null;
int i = 0;
while (user == null && i < identifiables.length()) {
     if (identifiables[i] instanceof User) {
         user = (User) identifiables[i];
     }
}

if (user != null) {
     String id = user.getId();
     ...
}

But we can add hasUser() and getUser() methods to Identity.

Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org