PageNodeEvent<UIPortalApplication> pageNodeEvent = (PageNodeEvent<UIPortalApplication>) event;
String nodePath = pageNodeEvent.getTargetNodeUri();
UserNode targetNode = null;
SiteKey siteKey = pageNodeEvent.getSiteKey();
if (siteKey != null) {
if (pcontext.getRemoteUser() == null
&& (siteKey.getType().equals(SiteType.GROUP) || siteKey.getType().equals(SiteType.USER))) {
NavigationService service = uiPortalApp.getApplicationComponent(NavigationService.class);
NavigationContext navContext = service.loadNavigation(siteKey);
if (navContext != null) {
uiPortalApp.setLastRequestNavData(null);
pcontext.requestAuthenticationLogin();
return;
}
}
UserNavigation navigation = userPortal.getNavigation(siteKey);
if (navigation != null) {
targetNode = userPortal.resolvePath(navigation, builder.build(), nodePath);
if (targetNode == null) {
// If unauthenticated users have no permission on PORTAL node and URL is valid, they will be required to
// login
if (pcontext.getRemoteUser() == null && siteKey.getType().equals(SiteType.PORTAL)) {
targetNode = userPortal.resolvePath(navigation, null, nodePath);
if (targetNode != null) {
uiPortalApp.setLastRequestNavData(null);
pcontext.requestAuthenticationLogin();
return;