Hello,
I'm just trying to get the email address from a user in a Workflow
Action.
I have the userID (I extended the Workflow - AbstractAction-execute -
method a little bit so that I have the situation available), but for now
I don't see how to get the email address of the user.
For now, I try something like:
public class HelloWorld extends AbstractAction {
public void execute(Situation situation, WorkflowInstance instance)
throws WorkflowException {
System.out.println("HelloWorld: Hello World");
System.out.println("HelloWorld: Parameter: " + params);
System.out.println("HelloWorld: User: " +
((CMSSituation)situation).getUserId());
// now get the user's email address
try {
PublicationAccessControllerResolver pacr = new
PublicationAccessControllerResolver();
DefaultAccessController dac =
DefaultAccessController)(pacr.doResolveAccessController("/default/index.
html"));
AccreditableManager am =
(AccreditableManager)dac.getAccreditableManager();
UserManager um = am.getUserManager();
User u =
um.getUser(((CMSSituation)situation).getUserId());
System.out.println("HelloWorld: User - email: " +
u.getEmail());
} catch (Exception e){
System.out.println("Hello World: no email! ");
e.printStackTrace();
}
}
}
Unfortunately, I get an exception from
PublicationAccessControllerResolver, because this class cannot open the
logging (NullPointerException) in the method
doResolveAccessController().
Does anybody kow how to get the user's email?
Thank you in advance!
Johannes
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]