Package io.wcm.handler.link.spi
Class LinkHandlerConfig
java.lang.Object
io.wcm.handler.link.spi.LinkHandlerConfig
- All Implemented Interfaces:
io.wcm.sling.commons.caservice.ContextAwareService
@ConsumerType
public abstract class LinkHandlerConfig
extends Object
implements io.wcm.sling.commons.caservice.ContextAwareService
LinkHandlerConfig OSGi services provide application-specific configuration for link 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
FieldsModifier and TypeFieldDescriptionstatic final StringDefault content root path.static final StringDefault media/asset root path.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@Nullable StringgetLinkRootPath(@NotNull com.day.cq.wcm.api.Page page, @NotNull String linkTypeId) Get root path for picking links using path field widgets.Get supported link types.@NotNull List<Class<? extends LinkMarkupBuilder>> Get available markup builders.@NotNull List<Class<? extends LinkProcessor>> Get post processors.@NotNull List<Class<? extends LinkProcessor>> Get pre processors.booleanisRedirect(@NotNull com.day.cq.wcm.api.Page page) Detected if page contains redirect link informationbooleanisValidLinkTarget(@NotNull com.day.cq.wcm.api.Page page) Detected if page is acceptable as link target.
-
Field Details
-
DEFAULT_ROOT_PATH_CONTENT
Default content root path.- See Also:
-
DEFAULT_ROOT_PATH_MEDIA
Default media/asset root path.- See Also:
-
-
Constructor Details
-
LinkHandlerConfig
public LinkHandlerConfig()
-
-
Method Details
-
getLinkTypes
Get supported link types.- Returns:
- Supported link types
-
getMarkupBuilders
Get available markup builders.- Returns:
- Available link markup builders
-
getPreProcessors
Get pre processors.- Returns:
- List of link metadata pre processors (optional). The processors are applied in list order.
-
getPostProcessors
Get post processors.- Returns:
- List of link metadata post processors (optional). The processors are applied in list order.
-
isValidLinkTarget
public boolean isValidLinkTarget(@NotNull @NotNull com.day.cq.wcm.api.Page page) Detected if page is acceptable as link target. This is used byInternalLinkType, otherLinkTypeimplementations may implement other logic.- Parameters:
page- Page- Returns:
- true if Page is acceptable as link target.
-
isRedirect
public boolean isRedirect(@NotNull @NotNull com.day.cq.wcm.api.Page page) Detected if page contains redirect link information- Parameters:
page- Page- Returns:
- true if Page is a redirect page
-
getLinkRootPath
@Nullable public @Nullable String getLinkRootPath(@NotNull @NotNull com.day.cq.wcm.api.Page page, @NotNull @NotNull String linkTypeId) Get root path for picking links using path field widgets.- Parameters:
page- Context pagelinkTypeId- Link type ID- Returns:
- Root path or null
-