mposolda/gatein-impersonation — pull request #1 by ozoli (2012-08-28 11:43:38+00:00)
Title: Re-impersonate orginally logged in user

Hi Marek,
I tidied up the code a little; renamed JSP and LoginPortlet class, also reordered some pom XMLs. Once you had the wrong logger class referenced easy mistake when coding fast :)
The code trys to put the user id and the user state on the http session to it can be re-enabled when the impersonated user is logged out.
The admin user is restored but the UI state not completely. I see the following error in the logs.
Maybe you can see from the diffs my mistake.
Cheers
Oliver

11:55:41,976 ERROR [PortletApplicationController] Error while rendering the porlet
org.exoplatform.groovyscript.TemplateRuntimeException: Groovy template exception at DataText[pos=Position[col=1,line=14],data=	fullName = encoder.encode(uicomponent.getUser().getFullName());] for template app:/groovy/admintoolbar/webui/component/UIUserInfoPortlet.gtmpl
at org.exoplatform.groovyscript.GroovyScript.buildRuntimeException(GroovyScript.java:178)
at org.exoplatform.groovyscript.GroovyScript.render(GroovyScript.java:121)
at org.exoplatform.groovyscript.GroovyTemplate.render(GroovyTemplate.java:118)

....

Caused by: java.lang.NullPointerException: Cannot invoke method getFullName() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)