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 String
Default content root path.static final String
Default 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 String
getLinkRootPath
(@NotNull com.day.cq.wcm.api.Page page, @NotNull String linkTypeId) Get root path for picking links using path field widgets.@NotNull List<Class<? extends LinkMarkupBuilder>>
@NotNull List<Class<? extends LinkProcessor>>
@NotNull List<Class<? extends LinkProcessor>>
boolean
isRedirect
(@NotNull com.day.cq.wcm.api.Page page) Detected if page contains redirect link informationboolean
isValidLinkTarget
(@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
- Returns:
- Supported link types
-
getMarkupBuilders
- Returns:
- Available link markup builders
-
getPreProcessors
- Returns:
- List of link metadata pre processors (optional). The processors are applied in list order.
-
getPostProcessors
- 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
, otherLinkType
implementations 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
-