@Override
public boolean execute(ControllerContext context) throws Exception {
String requestSiteName = context.getParameter(PortalRequestHandler.REQUEST_SITE_NAME);
String requestPath = context.getParameter(PortalRequestHandler.REQUEST_PATH);
SiteKey siteKey = SiteKey.portal(requestSiteName);
String uri = requestPath;
// Resolve the user node if node path is indicated
if (!requestPath.equals("")) {
UserPortalConfig cfg = userPortalService.getUserPortalConfig(requestSiteName, context.getRequest().getRemoteUser(),
userPortalContext);
if (cfg != null) {
UserPortal userPortal = cfg.getUserPortal();
UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder().withAuthMode(
UserNodeFilterConfig.AUTH_READ);
UserNode userNode = userPortal.resolvePath(builder.build(), requestPath);
if (userNode != null) {
siteKey = userNode.getNavigation().getKey();
uri = userNode.getURI();
}
}
}
//
PortalURLContext urlContext = new PortalURLContext(context, siteKey);
NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);
url.setResource(new NavigationResource(siteKey.getType(), siteKey.getName(), uri));
url.setMimeType(MimeType.PLAIN);
HttpServletRequest request = context.getRequest();
Enumeration paraNames = request.getParameterNames();
while (paraNames.hasMoreElements()) {