Interface LinkManager
This interface offers a flexible way, based on the builder pattern, to compute links.
This is a Sling model that can be injected into other models using the
@Self annotation.
It can be adapted from a SlingHttpServletRequest.
It can be used as follows:
Link link = linkManager.get(page).build();
Link link = linkManager.get(page)
.withLinkTarget(...)
.withLinkAttribute(...)
.build();
-
Method Summary
Modifier and TypeMethodDescription@NotNull LinkBuilderReturns a link builder where the link points to an asset.@NotNull LinkBuilderReturns a link builder where the link points to a page.@NotNull LinkBuilderReturns a link builder where the link points to an URL.@NotNull LinkBuilderReturns a link builder where the link is defined by the resource properties.
-
Method Details
-
get
Returns a link builder where the link is defined by the resource properties.- Parameters:
resource- Resource to read the link properties from.- Returns:
LinkBuilder
-
get
Returns a link builder where the link points to a page.- Parameters:
page- Target page of the link.- Returns:
LinkBuilder
-
get
Returns a link builder where the link points to an asset.- Parameters:
asset- Target asset of the link.- Returns:
LinkBuilder
-
get
Returns a link builder where the link points to an URL.- Parameters:
url- URL string of the link.- Returns:
LinkBuilder
-