String portalName = null;
String remoteUser = getRemoteUser();
SiteType siteType = getSiteType();
ExoContainer appContainer = getApplication().getApplicationServiceContainer();
UserPortalConfigService service_ = (UserPortalConfigService) appContainer
.getComponentInstanceOfType(UserPortalConfigService.class);
if (SiteType.PORTAL == siteType) {
portalName = getSiteName();
}
HttpSession session = request_.getSession();
if (portalName == null) {
if (session != null) {
portalName = (String) session.getAttribute(LAST_PORTAL_NAME);
}
}
if (portalName == null) {
portalName = service_.getDefaultPortal();
}
try {
userPortalConfig = service_.getUserPortalConfig(portalName, remoteUser,
PortalRequestContext.USER_PORTAL_CONTEXT);
if (userPortalConfig != null) {
session.setAttribute(LAST_PORTAL_NAME, portalName);
}
} catch (Exception e) {