*/
private static Log log = ExoLogger.getLogger("core.security.SetCurrentIdentityFilter");
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException
{
ConversationState state = ConversationState.getCurrent();
try
{
if (state != null)
{
if (log.isDebugEnabled())
log.debug("Conversation State found, save user profile to Conversation State.");
if (state.getAttribute(USER_PROFILE) == null)
{
OrganizationService orgService =
(OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
begin(orgService);
User user = orgService.getUserHandler().findUserByName(state.getIdentity().getUserId());
end(orgService);
state.setAttribute(USER_PROFILE, user);
}
}
chain.doFilter(request, response);