public class URLResolver extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
URLResolver(String url,
RenderContext context,
net.sf.ehcache.Ehcache nodePathCache,
net.sf.ehcache.Ehcache siteInfoCache)
Initializes an instance of this class.
|
protected |
URLResolver(String urlPathInfo,
String serverName,
javax.servlet.http.HttpServletRequest request,
net.sf.ehcache.Ehcache nodePathCache,
net.sf.ehcache.Ehcache siteInfoCache) |
protected |
URLResolver(String pathInfo,
String serverName,
String workspace,
javax.servlet.http.HttpServletRequest request,
net.sf.ehcache.Ehcache nodePathCache,
net.sf.ehcache.Ehcache siteInfoCache)
Initializes an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
Locale |
getLocale()
Gets the locale of the request resolved by the URL
|
JCRNodeWrapper |
getNode()
Creates a node from the path in the URL.
|
String |
getPath()
Gets the content node path of the request resolved by the URL
|
String |
getRedirectUrl()
If value is not null, then URL resolving encountered that the URL has
permanently been changed and thus a server-side redirect to the new
location should be triggered.
|
Resource |
getResource()
Creates a resource from the path in the URL.
|
Resource |
getResource(String path) |
String |
getServletPart() |
SiteInfo |
getSiteInfo() |
String |
getSiteKey()
Gets the site-key of the request resolved by the URL
|
String |
getSiteKeyByServerName() |
String |
getUrlPathInfo()
Gets the pathInfo of the given URL (@link javax.servlet.http.HttpServletRequest.getPathInfo())
|
String |
getVanityUrl() |
Date |
getVersionDate() |
String |
getVersionLabel() |
String |
getWorkspace()
Gets the workspace of the request resolved by the URL
|
boolean |
isMappable()
Checks whether the URL points to a Jahia content object, which can be mapped to vanity URLs.
|
boolean |
isMapped()
Checks whether the URL points to a Jahia content object, which can be mapped to vanity
URLs.
|
protected JCRNodeWrapper |
resolveNode(String workspace,
Locale locale,
String path)
Creates a node from the specified path.
|
protected Resource |
resolveResource(String workspace,
Locale locale,
String path)
Creates a resource from the specified path.
|
protected boolean |
resolveUrlMapping(String serverName,
javax.servlet.http.HttpServletRequest request) |
void |
setRedirectUrl(String redirectUrl)
Set the URL location for a redirection suggestion.
|
void |
setRenderContext(RenderContext renderContext) |
void |
setSiteKey(String siteKey)
Sets the site-key resolved for the current URL
|
void |
setVanityUrl(String vanityUrl) |
void |
setVersionDate(Date versionDate) |
void |
setVersionLabel(String versionLabel) |
protected Locale |
verifyLanguage(String lang) |
protected String |
verifyWorkspace(String workspace) |
protected URLResolver(String urlPathInfo, String serverName, javax.servlet.http.HttpServletRequest request, net.sf.ehcache.Ehcache nodePathCache, net.sf.ehcache.Ehcache siteInfoCache)
protected URLResolver(String pathInfo, String serverName, String workspace, javax.servlet.http.HttpServletRequest request, net.sf.ehcache.Ehcache nodePathCache, net.sf.ehcache.Ehcache siteInfoCache)
pathInfo - the path info (usually obtained with @link javax.servlet.http.HttpServletRequest.getPathInfo())serverName - the server name (usually obtained with @link javax.servlet.http.HttpServletRequest.getServerName())request - the current HTTP servlet request objectprotected URLResolver(String url, RenderContext context, net.sf.ehcache.Ehcache nodePathCache, net.sf.ehcache.Ehcache siteInfoCache)
url - URL in HTML links of outgoing requestscontext - The current request in order to obtain the context pathpublic void setRenderContext(RenderContext renderContext)
protected boolean resolveUrlMapping(String serverName, javax.servlet.http.HttpServletRequest request)
public String getUrlPathInfo()
public String getServletPart()
public String getWorkspace()
public Locale getLocale()
public String getPath()
public JCRNodeWrapper getNode() throws javax.jcr.RepositoryException
javax.jcr.PathNotFoundException - if the resource cannot be resolvedjavax.jcr.RepositoryException - in case of JCR-related errorspublic Resource getResource() throws javax.jcr.RepositoryException
javax.jcr.PathNotFoundException - if the resource cannot be resolvedjavax.jcr.RepositoryException - in case of JCR-related errorspublic Resource getResource(String path) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected JCRNodeWrapper resolveNode(String workspace, Locale locale, String path) throws javax.jcr.RepositoryException
workspace - The workspace where to get the nodelocale - current localepath - The path of the node, in the specified workspacejavax.jcr.PathNotFoundException - if the resource cannot be resolvedjavax.jcr.RepositoryException - in case of JCR-related errorsprotected Resource resolveResource(String workspace, Locale locale, String path) throws javax.jcr.RepositoryException
workspace - The workspace where to get the nodelocale - current localepath - The path of the node, in the specified workspacejavax.jcr.PathNotFoundException - if the resource cannot be resolvedjavax.jcr.RepositoryException - in case of JCR-related errorspublic boolean isMappable()
public boolean isMapped()
public String getSiteKey()
public void setSiteKey(String siteKey)
siteKey - the site-key resolved for the current URLpublic String getSiteKeyByServerName()
public String getRedirectUrl()
public void setRedirectUrl(String redirectUrl)
redirectUrl - suggested vanity URL to redirect topublic String getVanityUrl()
public void setVanityUrl(String vanityUrl)
public void setVersionDate(Date versionDate)
public void setVersionLabel(String versionLabel)
public Date getVersionDate()
public String getVersionLabel()
public SiteInfo getSiteInfo()
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.