public HstLinkImpl(String path, HstSite hstSite, boolean containerResource) { this.path = PathUtils.normalizePath(path); this.hstSite = hstSite; this.containerResource = containerResource; }
public void setPageNotFoundPath(String pageNotFoundPath){ this.pageNotFoundPath = PathUtils.normalizePath(pageNotFoundPath); }
public void setBinariesPrefix(String binariesPrefix){ this.binariesPrefix = PathUtils.normalizePath(binariesPrefix); }
public void setPath(String path) { this.path = PathUtils.normalizePath(path); }
public void setBinariesPrefix(String binariesPrefix){ this.binariesPrefix = PathUtils.normalizePath(binariesPrefix); }
public void setPageNotFoundPath(String pageNotFoundPath){ this.pageNotFoundPath = PathUtils.normalizePath(pageNotFoundPath); }
public void setPath(String path) { this.path = PathUtils.normalizePath(path); }
public static String getResourcePath(HttpServletRequest request, String contentPath) { String relPath = getResourceRelPath(request); StringBuilder resourcePathBuilder = new StringBuilder(); if (contentPath != null && !"".equals(contentPath)) { resourcePathBuilder.append('/').append(PathUtils.normalizePath(contentPath)); } if (relPath != null) { resourcePathBuilder.append('/').append(PathUtils.normalizePath(relPath)); } return resourcePathBuilder.toString(); }
/** * @param request * @return the jcr path relative to the root (not starting with / thus) */ public String getSiteContentBasePath(HstRequest request){ return PathUtils.normalizePath(getHstSite(request).getContentPath()); }
public HstLink create(String path, HstSite hstSite, boolean containerResource) { return postProcess(new HstLinkImpl(PathUtils.normalizePath(path), hstSite, containerResource)); }
public HstLink create(String path, HstSite hstSite) { return postProcess(new HstLinkImpl(PathUtils.normalizePath(path), hstSite)); }
public HstLink create(final String path, final Mount mount) { final String normalizedPath = PathUtils.normalizePath(path); HstLink hstLink = null; if (normalizedPath.startsWith(BINARIES_START_PATH)) { String nodePath = normalizedPath.substring(BINARIES_START_PATH.length() -1); if (isBinaryLocation(nodePath)) { hstLink = createHstLinkForBinaryLocation(nodePath, mount); } } if (hstLink == null) { hstLink = new HstLinkImpl(normalizedPath, mount); } return postProcess(hstLink); }
public HstLink create(String path, Mount mount, boolean containerResource) { final String normalizedPath = PathUtils.normalizePath(path); HstLink hstLink = null; if (normalizedPath.startsWith(BINARIES_START_PATH)) { String nodePath = normalizedPath.substring(BINARIES_START_PATH.length() -1); if (isBinaryLocation(nodePath)) { hstLink = createHstLinkForBinaryLocation(nodePath, mount); } } if (hstLink == null) { hstLink = new HstLinkImpl(normalizedPath, mount, containerResource); } return postProcess(hstLink); }
public Node getScope(final HttpServletRequest request) throws RepositoryException { HstRequestContext requestContext = getRequestContext(request); Mount siteMount = requestContext.getResolvedMount().getMount(); if (siteMount == null) { log.error("Couldn't find site mount for rest service"); return null; } String contentPath = siteMount.getContentPath(); if (contentPath != null) { return requestContext.getSession().getRootNode().getNode(PathUtils.normalizePath(contentPath)); } return null; }
private void add2LocationMap(HstSiteMapItem siteMapItem) { String normPath = PathUtils.normalizePath(siteMapItem.getRelativeContentPath()); if( !(normPath == null || "".equals(normPath))) { this.addSiteMapItem(normPath, siteMapItem); } for(HstSiteMapItem child : siteMapItem.getChildren()) { add2LocationMap(child); } }
private void add2LocationMap(final HstSiteMapItem siteMapItem) { final String normPath = PathUtils.normalizePath(siteMapItem.getRelativeContentPath()); if (siteMapItem.isExcludedForLinkRewriting()){ log.debug("'{}' will not be used for link rewriting as it is marked deleted or is configured to be " + "excluded for link rewriting.", siteMapItem); return; } if (StringUtils.isNotEmpty(normPath)) { log.debug("Adding to location map path '{}' for sitemap item '{}'", normPath, siteMapItem.getQualifiedId()); addSiteMapItem(normPath, siteMapItem); } for(HstSiteMapItem child : siteMapItem.getChildren()) { add2LocationMap(child); } }
private HippoBean getBeanForResolvedSiteMapItem(ResolvedSiteMapItem resolvedSiteMapItem) { String base = getSiteContentBasePath(); String relPath = PathUtils.normalizePath(resolvedSiteMapItem.getRelativeContentPath()); if (relPath == null) { log.debug("Cannot return a content bean for relative path null for resolvedSitemapItem belonging to '{}'. Return null", resolvedSiteMapItem.getHstSiteMapItem().getId()); return null; } return getHippoBean(base, relPath); }
@Override public String getSiteContentBasePath() { checkStateValidity(); checkMatchingPhaseFinished("getSiteContentBasePath"); return PathUtils.normalizePath(getResolvedMount().getMount().getContentPath()); }
/** * @see {@link #getFacetNavigationBean(String, String, String)} with <code>absBasePath</code> as "/"+ requestContext.getSiteContentBasePath() and * <code>relPath </code> as requestContext.getResolvedSiteMapItem().getRelativeContentPath() */ public static HippoFacetNavigationBean getFacetNavigationBean(String query) throws HstComponentException { final HstRequestContext requestContext = RequestContextProvider.get(); if (requestContext == null) { throw new HstComponentException("Cannot call #getFacetNavigationBean without HstRequestContext"); } ResolvedSiteMapItem resolvedSiteMapItem = requestContext.getResolvedSiteMapItem(); String relPath = PathUtils.normalizePath(resolvedSiteMapItem.getRelativeContentPath()); return getFacetNavigationBean(relPath, query); }
public HstContainerURL createURL(HstContainerURL baseContainerURL, String pathInfo) { HstContainerURLImpl url = new HstContainerURLImpl(); url.setContextPath(baseContainerURL.getContextPath()); url.setHostName(baseContainerURL.getHostName()); url.setPortNumber(baseContainerURL.getPortNumber()); pathInfo = PathUtils.normalizePath(pathInfo); if (pathInfo != null) { pathInfo = "/" + pathInfo; } url.setRequestPath(baseContainerURL.getResolvedMountPath()+pathInfo); url.setCharacterEncoding(baseContainerURL.getCharacterEncoding()); url.setResolvedMountPath(baseContainerURL.getResolvedMountPath()); url.setPathInfo(pathInfo); return url; }