Package org.jahia.services.render

Examples of org.jahia.services.render.URLGenerator


            logger.error("Error when getting site id", e);
        }

        // put live workspace url
        if (request.getAttribute("url") != null) {
            URLGenerator url = (URLGenerator) request.getAttribute("url");
            params.put(JahiaGWTParameters.BASE_URL, url.getContext() + url.getBase());
            params.put(JahiaGWTParameters.STUDIO_URL, url.getContext() + url.getStudio());
            addLanguageSwitcherLinks(renderContext, params, url);
        } else {
            params.put(JahiaGWTParameters.BASE_URL, request.getContextPath().equals("/") ? "" : request.getContextPath() + Render.getRenderServletPath() + "/" + params.get("workspace"+ "/" + locale.toString());
        }
View Full Code Here


import javax.jcr.RepositoryException;

public class SiteParameterAdder implements HtmlTagAttributeVisitor {

    public String visit(String value, RenderContext context, Resource resource) {
        URLGenerator urlGenerator = context.getURLGenerator();
        if (value != null && value.startsWith(urlGenerator.getContext() + urlGenerator.getBase())) {
                if (!value.startsWith(urlGenerator.getContext() + urlGenerator.getBase() + "/sites/") && !value.contains("jsite=")) {
                    String jsite = context.getRequest().getParameter("jsite");
                    if (jsite == null) {
                        jsite = (String) context.getMainResource().getModuleParams().get("jsite");
                    }
                    if (jsite == null) {
View Full Code Here

            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = new SearchCriteria();

            CommaSeparatedMultipleValue oneSite = new CommaSeparatedMultipleValue();
            oneSite.setValue(FIRST_TESTSITE_NAME);
View Full Code Here

            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = new SearchCriteria();

            CommaSeparatedMultipleValue oneSite = new CommaSeparatedMultipleValue();
            oneSite.setValue(FIRST_TESTSITE_NAME);
View Full Code Here

            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = new SearchCriteria();

            CommaSeparatedMultipleValue oneSite = new CommaSeparatedMultipleValue();
            oneSite.setValue(FIRST_TESTSITE_NAME);
View Full Code Here

            JCRNodeWrapper homeNode = session
                    .getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = new SearchCriteria();

            CommaSeparatedMultipleValue oneSite = new CommaSeparatedMultipleValue();
            oneSite.setValue(FIRST_TESTSITE_NAME);
View Full Code Here

            JCRNodeWrapper homeNode = session
                    .getNode(SECOND_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = new SearchCriteria();

            CommaSeparatedMultipleValue twoSites = new CommaSeparatedMultipleValue();
            twoSites.setValue(FIRST_TESTSITE_NAME + "," + SECOND_TESTSITE_NAME);
View Full Code Here

        chain.pushAttribute(request, "currentResource", resource);
        chain.pushAttribute(request, "currentUser", context.getMainResource().getNode().getSession().getUser());
        chain.pushAttribute(request, "currentAliasUser", context.getMainResource().getNode().getSession().getAliasedUser());
        if (!Resource.CONFIGURATION_INCLUDE.equals(resource.getContextConfiguration())) {
            chain.pushAttribute(request, "currentNode", node);
            chain.pushAttribute(request, "url", new URLGenerator(context, resource));
        }

        return null;
    }
View Full Code Here

            JCRSessionWrapper session = JCRSessionFactory.getInstance().getCurrentUserSession(null, Locale.ENGLISH);
            JCRNodeWrapper homeNode = session.getNode(FIRST_SITECONTENT_ROOT_NODE + "/home");
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            context.setMainResource(resource);
            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = createSearchCriteria();
            StopWatch stopWatch = new StopWatch("search");
            stopWatch.start("Starting 1000 searchs");
            for (int j = 0; j < 1000; j++) {
View Full Code Here

            }
           
            Resource resource = new Resource(homeNode, "html", null, Resource.CONFIGURATION_PAGE);
            renderCtx.setMainResource(resource);
            renderCtx.setSite(homeNode.getResolveSite());
            URLGenerator urlgenerator = new URLGenerator(renderCtx, resource);
            urls.add(urlgenerator.getServer() + urlgenerator.getContext()
                    + (Constants.LIVE_WORKSPACE.equals(workspace) ? urlgenerator.getLive() : urlgenerator.getEdit()));
        } catch (Exception e) {
            logger.error("Exception during test", e);
        }
        return urls;
    }
View Full Code Here

TOP

Related Classes of org.jahia.services.render.URLGenerator

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.