try {
profile.setUniqueIdentifier(userId);
profile.setUserId(userId);
ArrayList roles = new ArrayList();
HashMap userAttributes = new HashMap();
PortalContainer container = PortalContainer.getInstance();
if (container == null) {
ConfigSingleton config = ConfigSingleton.getInstance();
SourceBean securityconfSB = (SourceBean) config
.getAttribute("SPAGOBI.SECURITY.PORTAL-SECURITY-CLASS.CONFIG");
String paramCont = "NAME_PORTAL_APPLICATION";
SecurityProviderUtilities.debug(this.getClass(), "<init(Principal)>", " Use param " + paramCont);
SourceBean paramContSB = (SourceBean) securityconfSB.getAttribute(paramCont);
SecurityProviderUtilities.debug(this.getClass(), "<init(Principal)>",
" Param context name Source Bean " + "retrived: " + paramContSB);
String nameCont = (String) paramContSB.getCharacters();
SecurityProviderUtilities.debug(this.getClass(), "<init(Principal)>", " Use context name " + nameCont);
RootContainer rootCont = RootContainer.getInstance();
SecurityProviderUtilities.debug(this.getClass(), "<init(Principal)>", " Root container retrived: "
+ rootCont);
container = rootCont.getPortalContainer(nameCont);
}
OrganizationService service = (OrganizationService) container
.getComponentInstanceOfType(OrganizationService.class);
// load user roles
Collection tmpRoles = service.getGroupHandler().findGroupsOfUser(userId);
GroupHandler groupHandler = service.getGroupHandler();