public interface AbsolutePortalURLBuilder
Each for[Resource]
method returns a URL builder for the named
resource. Algorithms may differ between builders. In general, the builders
construct URLs that honor existing proxy paths unless a CDN host is being
used.
BuildableAbsolutePortalURLBuilder
Modifier and Type | Method and Description |
---|---|
ImageAbsolutePortalURLBuilder |
forImage(java.lang.String relativeURL)
Returns a URL builder for Portal images.
|
MainAbsolutePortalURLBuilder |
forMain(java.lang.String relativeURL)
Returns a URL builder for Portal's main resources.
|
ModuleAbsolutePortalURLBuilder |
forModule(org.osgi.framework.Bundle bundle,
java.lang.String relativeURL)
Returns a URL builder for module resources.
|
PortletDependencyAbsolutePortalURLBuilder |
forPortletDependency(com.liferay.portal.kernel.model.portlet.PortletDependency portletDependency,
java.lang.String cssURN,
java.lang.String javaScriptURN)
Returns a URL builder for portlet dependency resources.
|
ResourceAbsolutePortalURLBuilder |
forResource(java.lang.String relativeURL)
Returns a URL builder for arbitrary resources.
|
WhiteboardAbsolutePortalURLBuilder |
forWhiteboard(java.lang.String servletPattern)
Returns a URL builder for OSGi whiteboard servlet instances.
|
AbsolutePortalURLBuilder |
ignoreCDNHost()
Returns a version of this URL builder that ignores the CDN part.
|
AbsolutePortalURLBuilder |
ignorePathProxy()
Returns a version of this URL builder that ignores the path proxy part.
|
ImageAbsolutePortalURLBuilder forImage(java.lang.String relativeURL)
com.liferay.portal.kernel.util.Portal#PATH_IMAGE
.
Image resources are retrieved from a CDN host if present or from Portal otherwise.
relativeURL
- the image's relative URLMainAbsolutePortalURLBuilder forMain(java.lang.String relativeURL)
com.liferay.portal.kernel.util.Portal#PATH_MAIN
.
Main resources are always retrieved from the Portal, even if a CDN host is present.
relativeURL
- the resource's relative URLModuleAbsolutePortalURLBuilder forModule(org.osgi.framework.Bundle bundle, java.lang.String relativeURL)
com.liferay.portal.kernel.util.Portal#PATH_MODULE
+ the bundle's
web context path.
Module resources are retrieved from a CDN host if present or from the Portal otherwise.
bundle
- the bundle that contains the resourcerelativeURL
- the resource's relative URLPortletDependencyAbsolutePortalURLBuilder forPortletDependency(com.liferay.portal.kernel.model.portlet.PortletDependency portletDependency, java.lang.String cssURN, java.lang.String javaScriptURN)
Portlet dependency resources are retrieved from a configured CSS URN or
JS URN if present. (See
com.liferay.portal.kernel.util.PropsKeys#PORTLET_DEPENDENCY_CSS_URN
and PropsKeys#PORTLET_DEPENDENCY_JAVASCRIPT_URN
).
If neither are present, the resource is retrieved from a CDN host if present, or Portal otherwise.
portletDependency
- the portlet dependency resourcecssURN
- the URN for CSS portlet dependency resourcesjavaScriptURN
- the URN for JavaScript portlet dependency resourcesResourceAbsolutePortalURLBuilder forResource(java.lang.String relativeURL)
/
if Portal installed as the
root web app, or /some-other-path
based on its context). See
com.liferay.portal.spring.context.PortalContextLoaderListener#getPortalServletContextPath(
)
for more details.
Warning: Only use this method if none of the other methods meet your needs. Otherwise, you may end up hard coding configurable paths.
Arbitrary resources are retrieved from a CDN host if present or from the Portal otherwise.
relativeURL
- the resource's relative URLWhiteboardAbsolutePortalURLBuilder forWhiteboard(java.lang.String servletPattern)
servletPattern
- the value of the osgi.http.whiteboard.servlet.pattern
propertyAbsolutePortalURLBuilder ignoreCDNHost()
com.liferay.portal.kernel.util.Portal#getCDNHost(
javax.servlet.http.HttpServletRequest)
for details.AbsolutePortalURLBuilder ignorePathProxy()
com.liferay.portal.kernel.util.Portal#getPathProxy()
for
details.