Package io.wcm.handler.url.spi
Class UrlHandlerConfig
java.lang.Object
io.wcm.handler.url.spi.UrlHandlerConfig
- All Implemented Interfaces:
io.wcm.sling.commons.caservice.ContextAwareService
@ConsumerType
public abstract class UrlHandlerConfig
extends Object
implements io.wcm.sling.commons.caservice.ContextAwareService
UrlHandlerConfig OSGi services provide application-specific configuration for URL handling.
Applications can set service properties or bundle headers as defined in ContextAwareService to apply this
configuration only for resources that match the relevant resource paths.-
Field Summary
Fields inherited from interface io.wcm.sling.commons.caservice.ContextAwareService
PROPERTY_ACCEPTS_CONTEXT_PATH_EMPTY, PROPERTY_CONTEXT_PATH_BLACKLIST_PATTERN, PROPERTY_CONTEXT_PATH_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull UrlModeBy default, vanity paths will not be taken into account when building URLs.@NotNull Collection<IntegratorMode> abstract intgetSiteRootLevel(@Nullable org.apache.sling.api.resource.Resource contextResource) Returns the absolute path level where the root page of the site is located.booleanBy default, URL handler users Sling Mapping to externalize all URLs, but removes and host name that may be configured in the Sling Mapping to prefer the host names defined in the URL handlerSiteConfig.booleanisIntegrator(@NotNull com.day.cq.wcm.api.Page page) Detects if page is a integrator page and contains application redirect link informationbooleanisSecure(@NotNull com.day.cq.wcm.api.Page page) Detects if a page has to be accessed in secure mode
-
Constructor Details
-
UrlHandlerConfig
public UrlHandlerConfig()
-
-
Method Details
-
getSiteRootLevel
public abstract int getSiteRootLevel(@Nullable @Nullable org.apache.sling.api.resource.Resource contextResource) Returns the absolute path level where the root page of the site is located.- Parameters:
contextResource- Context resource that is assumed to be inside the site context.- Returns:
- Root level or -1 if it could not be detected
-
isSecure
public boolean isSecure(@NotNull @NotNull com.day.cq.wcm.api.Page page) Detects if a page has to be accessed in secure mode- Parameters:
page- Page Page- Returns:
- true if secure mode is required
-
isIntegrator
public boolean isIntegrator(@NotNull @NotNull com.day.cq.wcm.api.Page page) Detects if page is a integrator page and contains application redirect link information- Parameters:
page- Page- Returns:
- true if Page is a integrator page
-
getDefaultUrlMode
- Returns:
- Default URL mode that is used if no URL mode is specified
-
getIntegratorModes
- Returns:
- Supported integrator modes
-
isHostProvidedBySlingMapping
public boolean isHostProvidedBySlingMapping()By default, URL handler users Sling Mapping to externalize all URLs, but removes and host name that may be configured in the Sling Mapping to prefer the host names defined in the URL handlerSiteConfig. By setting this flag to true, URL handler also uses the host names provided by Sling Mapping, and falls back to the default behavior if no are defined.- Returns:
- true if URL handler should also respect host names defined in Sling Mapping
-
getDefaultVanityMode
By default, vanity paths will not be taken into account when building URLs. Use the vanity mode to change this behaviour.- Returns:
- the vanity mode to use when building urls
-