Package io.wcm.handler.url
Interface UrlMode
-
@ProviderType public interface UrlModeAn UrlMode define the externalization logic for URLs depending on context-specific configuration parameters defined inSiteConfig.If you want to implement your own UrlMode you can create a singleton class extending this interface. See
UrlModesclass as an example.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull StringgetId()@Nullable StringgetLinkUrlPrefix(@NotNull org.apache.sling.api.adapter.Adaptable adaptable, @NotNull Set<String> runModes, @Nullable com.day.cq.wcm.api.Page currentPage, @Nullable com.day.cq.wcm.api.Page targetPage)Get prefix (scheme, hostname and context path or integrator placeholder) for externalizing a content page link URL.@Nullable StringgetResourceUrlPrefix(@NotNull org.apache.sling.api.adapter.Adaptable adaptable, @NotNull Set<String> runModes, @Nullable com.day.cq.wcm.api.Page currentPage, @Nullable org.apache.sling.api.resource.Resource targetResource)Get prefix (scheme, hostname and context path or integrator placeholder) for externalizing a resource URL.
-
-
-
Method Detail
-
getId
@NotNull @NotNull String getId()
- Returns:
- Id uniquely identifying the URL mode
-
getLinkUrlPrefix
@Nullable @Nullable String getLinkUrlPrefix(@NotNull @NotNull org.apache.sling.api.adapter.Adaptable adaptable, @NotNull @NotNull Set<String> runModes, @Nullable @Nullable com.day.cq.wcm.api.Page currentPage, @Nullable @Nullable com.day.cq.wcm.api.Page targetPage)
Get prefix (scheme, hostname and context path or integrator placeholder) for externalizing a content page link URL.- Parameters:
adaptable- Either request or resource which can be adapted to model implementations likeUrlHandlerConfigrunModes- Current sling run modescurrentPage- Current page (is null if not executed in request context)targetPage- Target page to which internal link points to.- Returns:
- Prefix or null
-
getResourceUrlPrefix
@Nullable @Nullable String getResourceUrlPrefix(@NotNull @NotNull org.apache.sling.api.adapter.Adaptable adaptable, @NotNull @NotNull Set<String> runModes, @Nullable @Nullable com.day.cq.wcm.api.Page currentPage, @Nullable @Nullable org.apache.sling.api.resource.Resource targetResource)
Get prefix (scheme, hostname and context path or integrator placeholder) for externalizing a resource URL.- Parameters:
adaptable- Either request or resource which can be adapted to model implementations likeUrlHandlerConfigrunModes- Current sling run modescurrentPage- Current page (is null if not executed in request context)targetResource- Target resource to which the resource link points to (may be null if it could not be resolved)- Returns:
- Prefix or null
-
-