{
UIPortal uiPortal = event.getSource();
RemindPasswordTokenService tokenService = uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
String tokenId = event.getRequestContext().getRequestParameter("tokenId");
GateInToken token = tokenService.getToken(tokenId);
if (token == null)
{
WebuiRequestContext requestContext = event.getRequestContext();
requestContext.getUIApplication().addMessage(
new ApplicationMessage("UIForgetPassword.msg.expration", null));
requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
return;
}
UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
// get user
User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());
UIResetPassword uiReset = uiMaskWS.createUIComponent(UIResetPassword.class, null, null);
uiReset.setUser(user);
uiReset.setTokenId(tokenId);
uiMaskWS.setUIComponent(uiReset);