Package org.exoplatform.web.url.navigation

Examples of org.exoplatform.web.url.navigation.NodeURL


                setRedirect(origin, redirect, context.getRequest(), context.getResponse(), context);

                // create the new redirect url
                SiteKey siteKey = new SiteKey(SiteType.PORTAL, redirect.getRedirect());
                PortalURLContext urlContext = new PortalURLContext(context, siteKey);
                NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);

                if (redirectLocation.startsWith("/")) {
                    redirectLocation = redirectLocation.substring(1);
                }

                String s = url.setResource(new NavigationResource(SiteType.PORTAL, redirect.getRedirect(), redirectLocation))
                        .toString();

                HttpServletResponse response = context.getResponse();
                HttpServletRequest request = context.getRequest();
View Full Code Here


        RedirectCookieService redirectCookieService = (RedirectCookieService) container
                .getComponentInstanceOfType(RedirectCookieService.class);

        // Determine the URL for the site so we can use this for the cookie path
        PortalURLContext urlContext = new PortalURLContext(context, SiteKey.portal(origin.getName()));
        NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);
        String path = url.setResource(new NavigationResource(SiteType.PORTAL, origin.getName(), "")).toString();
        // We have to check for the '/' at the end of the path since the portal could be accessed under /portal/classic or
        // /portal/classic/
        // Removing the tailing slash means both urls will see the cookie.
        if (path.endsWith("/")) {
            path = path.substring(0, path.length() - 1);
        }

        Cookie redirectCookie = redirectCookieService.createCookie(origin.getName(), redirect, path);
        response.addCookie(redirectCookie);

        // In order to make sure we don't create an infinite redirect loop, we should update the cookie for the redirect site to
        // specify that site is the prefered site and no redirect should be performed
        if (redirect.getType() != RedirectType.NOREDIRECT && redirect.getRedirect() != null) {
            // Determine the URL for the redirect site so we can use this for the cookie path
            String redirectPath = url.setResource(new NavigationResource(SiteType.PORTAL, redirect.getRedirect(), ""))
                    .toString();
            // We have to check for the '/' at the end of the path since the portal could be accessed under /portal/classic or
            // /portal/classic/
            // Removing the tailing slash means both urls will see the cookie.
            if (redirectPath.endsWith("/")) {
View Full Code Here

                setRedirect(origin, redirect, context.getRequest(), context.getResponse(), context);

                // create the new redirect url
                SiteKey siteKey = new SiteKey(SiteType.PORTAL, redirect.getRedirect());
                PortalURLContext urlContext = new PortalURLContext(context, siteKey);
                NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);
                String s = url.setResource(new NavigationResource(SiteType.PORTAL, redirect.getRedirect(), redirectLocation))
                        .toString();

                HttpServletResponse response = context.getResponse();
                HttpServletRequest request = context.getRequest();
View Full Code Here

            if (selectedNode != null) {
                nextNode = selectedNode;
            }

            PortalRequestContext prContext = Util.getPortalRequestContext();
            NodeURL nodeURL = prContext.createURL(NodeURL.TYPE).setNode(nextNode);
            context.sendRedirect(nodeURL.toString());
        }
View Full Code Here

                    node = createdNode;
                }
            }

            PortalRequestContext prContext = Util.getPortalRequestContext();
            NodeURL nodeURL = prContext.createURL(NodeURL.TYPE).setNode(node);
            context.sendRedirect(nodeURL.toString());
        }
View Full Code Here

                if (renamedNode != null) {
                    node = renamedNode;
                }
            }
            PortalRequestContext prContext = Util.getPortalRequestContext();
            NodeURL nodeURL = prContext.createURL(NodeURL.TYPE).setNode(node);
            context.sendRedirect(nodeURL.toString());
        }
View Full Code Here

TOP

Related Classes of org.exoplatform.web.url.navigation.NodeURL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.