Package org.exoplatform.web.url.navigation

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


        //
        PortalURLContext urlContext = new PortalURLContext(context, siteKey);
        NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);

        url.setResource(new NavigationResource(siteKey.getType(), siteKey.getName(), uri));

        if (URLWriter.isUrlEncoded()) {
            url.setMimeType(MimeType.XHTML);
        } else {
            url.setMimeType(MimeType.PLAIN);
View Full Code Here


        this.nodePath_ = requestPath;
        this.requestLocale = requestLocale;

        //
        NodeURL url = createURL(NodeURL.TYPE);
        url.setResource(new NavigationResource(siteKey, ""));
        portalURI = url.toString();

        //
        urlBuilder = new PortalURLBuilder(this, createURL(ComponentURL.TYPE));
    }
View Full Code Here

    private void logout(WebuiRequestContext context) throws Exception {
        LogoutControl.wantLogout();
        PortalRequestContext prContext = (PortalRequestContext) context;
        NodeURL createURL = prContext.createURL(NodeURL.TYPE);
        createURL.setResource(new NavigationResource(SiteType.PORTAL, prContext.getPortalOwner(), null));
        prContext.sendRedirect(createURL.toString());
    }
View Full Code Here

    }

    public String getBaseURL() throws UnsupportedEncodingException {
        PortalRequestContext pcontext = Util.getPortalRequestContext();
        NodeURL nodeURL = pcontext.createURL(NodeURL.TYPE,
                new NavigationResource(pcontext.getSiteKey(), pcontext.getNodePath()));
        if (URLWriter.isUrlEncoded()) {
            nodeURL.setMimeType(MimeType.XHTML);
        } else {
            nodeURL.setMimeType(MimeType.PLAIN);
        }
View Full Code Here

        ResourceURL rsURL = res.createResourceURL();
        rsURL.setResourceID(node.getURI());
        json.put("getNodeURL", rsURL.toString());

        if (node.getPageRef() != null) {
            NavigationResource resource = new NavigationResource(node);
            NodeURL url = Util.getPortalRequestContext().createURL(NodeURL.TYPE, resource);
            url.setAjax(isUseAjax());
            json.put("actionLink", url.toString());
        }
View Full Code Here

        ResourceURL rsURL = res.createResourceURL();
        rsURL.setResourceID(nodeId);
        json.put("getNodeURL", rsURL.toString());

        if (node.getPageRef() != null) {
            NavigationResource resource = new NavigationResource(node);
            NodeURL url = Util.getPortalRequestContext().createURL(NodeURL.TYPE, resource);
            url.setAjax(isUseAjax());
            json.put("actionLink", url.toString());
        }
View Full Code Here

                .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

                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

                .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

                // 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

TOP

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

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.