Package com.liferay.portal.url.builder
Interface AbsolutePortalURLBuilder
@ProviderType
public interface AbsolutePortalURLBuilder
Provides builders for constructing absolute URLs pointing to portal
resources.
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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionforBrowserModule(String browserModulePath) Returns a URL builder for AMD JavaScript files.forBundleScript(org.osgi.framework.Bundle bundle, String relativeURL) Returns a URL builder for bundle JavaScript files.forBundleStylesheet(org.osgi.framework.Bundle bundle, String relativeURL) Deprecated.Returns a URL builder for JavaScript combo servlet requests.forESModule(String webContextName, String esModulePath) Returns a URL builder for an ECMAScript module.forPortalImage(String relativeURL) Returns a URL builder for portal images.forPortalMainResource(String relativeURL) Returns a URL builder for portal's main resources.forPortletDependency(com.liferay.portal.kernel.model.portlet.PortletDependency portletDependency, String cssURN, String javaScriptURN) Returns a URL builder for portlet dependency resources.forServlet(String requestURL) Returns a URL builder for requests to dynamic content returned by servlets.forWebContextScript(String webContextName, String scriptPath) Returns a URL builder for a JavaScript file using the new caching architecture based on hashed file names.forWebContextStylesheet(String webContextName, String stylesheetPath) Returns a URL builder for a CSS stylesheet using the new caching architecture based on hashed file names.
-
Method Details
-
forBrowserModule
Returns a URL builder for AMD JavaScript files.- Parameters:
browserModulePath- the browser module path (e.g. /o/js/resolved-module/... or a legacy config generator module path too)- Returns:
- a URL builder for AMD JavaScript files
-
forBundleScript
BundleScriptAbsolutePortalURLBuilder forBundleScript(org.osgi.framework.Bundle bundle, String relativeURL) Returns a URL builder for bundle JavaScript files.- Parameters:
bundle- the bundle that contains the resourcerelativeURL- the JavaScript file relative URL- Returns:
- a URL builder for module scripts
-
forBundleStylesheet
@Deprecated BundleStylesheetAbsolutePortalURLBuilder forBundleStylesheet(org.osgi.framework.Bundle bundle, String relativeURL) Deprecated.As of Cavanaugh (7.4.x), useforWebContextStylesheet(String, String)insteadReturns a URL builder for a CSS stylesheet using the old caching architecture based on request parameters.- Parameters:
bundle- the bundle that contains the resourcerelativeURL- the stylesheets relative URL- Returns:
- a URL builder for module stylesheets
-
forComboRequest
ComboRequestAbsolutePortalURLBuilder forComboRequest()Returns a URL builder for JavaScript combo servlet requests.- Returns:
- a URL builder for combo servlet requests
-
forESModule
Returns a URL builder for an ECMAScript module.- Parameters:
webContextName- the web context where the module lives (e.g. "frontend-js-web")esModulePath- the module path (e.g. "/js/index.js")- Returns:
- a URL builder for ESM scripts
-
forPortalImage
Returns a URL builder for portal images. Image resources live incom.liferay.portal.kernel.util.Portal#PATH_IMAGE.- Parameters:
relativeURL- the image's relative URL- Returns:
- a URL builder for portal images
-
forPortalMainResource
Returns a URL builder for portal's main resources. Main resources live incom.liferay.portal.kernel.util.Portal#PATH_MAIN.- Parameters:
relativeURL- the resource's relative URL- Returns:
- a URL builder for portal's main resources
-
forPortletDependency
PortletDependencyAbsolutePortalURLBuilder forPortletDependency(com.liferay.portal.kernel.model.portlet.PortletDependency portletDependency, String cssURN, String javaScriptURN) Returns a URL builder for portlet dependency resources. Portlet dependency resources live in the portal's root path.- Parameters:
portletDependency- the portlet dependency resourcecssURN- the URN for CSS portlet dependency resourcesjavaScriptURN- the URN for JavaScript portlet dependency resources- Returns:
- a URL builder for portlet dependency resources
-
forServlet
Returns a URL builder for requests to dynamic content returned by servlets.- Parameters:
requestURL- the API's request URL- Returns:
- a URL builder for API requests
-
forWebContextScript
WebContextScriptAbsolutePortalURLBuilder forWebContextScript(String webContextName, String scriptPath) Returns a URL builder for a JavaScript file using the new caching architecture based on hashed file names.- Parameters:
webContextName- the web context where the module lives (e.g. "frontend-js-web")scriptPath- the script path (e.g. "/js/main.js")- Returns:
- a URL builder
-
forWebContextStylesheet
WebContextStylesheetAbsolutePortalURLBuilder forWebContextStylesheet(String webContextName, String stylesheetPath) Returns a URL builder for a CSS stylesheet using the new caching architecture based on hashed file names.- Parameters:
webContextName- the web context where the module lives (e.g. "frontend-js-web")stylesheetPath- the stylesheet path (e.g. "/clay_admin.css")- Returns:
- a URL builder
-
forWebContextStylesheet(String, String)instead