EventContext and EventROContext let you access the current event object. You can do so in either of the following ways, as illustrated in the following code for an event listener:
int before(EventContext eCtx) { if(eCtx.getEventName().equals(ImEventName.CREATEUSEREVENT)) CreateUserEvent evt = (CreateUserEvent); . . . // Event listener processing continues. }
Note: For a list of event name constants, see IMEventName in the Javadoc Reference.
int before(EventContext eCtx) { CreateUserEvent evt = (CreateUserEvent)eCtx.getEvent(); User user = evt.getUser(); user.setAttribute("CreateTime",new Date().toString()); }
Copyright © 2013 CA.
All rights reserved.
|
|