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 java.lang.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 inContextAwareService
to apply this configuration only for resources that match the relevant resource paths.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_ROOT_PATH_CONTENT
Default content root path.static java.lang.String
DEFAULT_ROOT_PATH_MEDIA
Default media/asset root path.
-
Constructor Summary
Constructors Constructor Description LinkHandlerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable java.lang.String
getLinkRootPath(@NotNull com.day.cq.wcm.api.Page page, @NotNull java.lang.String linkTypeId)
Get root path for picking links using path field widgets.@NotNull java.util.List<java.lang.Class<? extends LinkType>>
getLinkTypes()
@NotNull java.util.List<java.lang.Class<? extends LinkMarkupBuilder>>
getMarkupBuilders()
@NotNull java.util.List<java.lang.Class<? extends LinkProcessor>>
getPostProcessors()
@NotNull java.util.List<java.lang.Class<? extends LinkProcessor>>
getPreProcessors()
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 Detail
-
DEFAULT_ROOT_PATH_CONTENT
public static final java.lang.String DEFAULT_ROOT_PATH_CONTENT
Default content root path.- See Also:
- Constant Field Values
-
DEFAULT_ROOT_PATH_MEDIA
public static final java.lang.String DEFAULT_ROOT_PATH_MEDIA
Default media/asset root path.- See Also:
- Constant Field Values
-
-
Method Detail
-
getLinkTypes
@NotNull public @NotNull java.util.List<java.lang.Class<? extends LinkType>> getLinkTypes()
- Returns:
- Supported link types
-
getMarkupBuilders
@NotNull public @NotNull java.util.List<java.lang.Class<? extends LinkMarkupBuilder>> getMarkupBuilders()
- Returns:
- Available link markup builders
-
getPreProcessors
@NotNull public @NotNull java.util.List<java.lang.Class<? extends LinkProcessor>> getPreProcessors()
- Returns:
- List of link metadata pre processors (optional). The processors are applied in list order.
-
getPostProcessors
@NotNull public @NotNull java.util.List<java.lang.Class<? extends LinkProcessor>> 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 java.lang.String getLinkRootPath(@NotNull @NotNull com.day.cq.wcm.api.Page page, @NotNull @NotNull java.lang.String linkTypeId)
Get root path for picking links using path field widgets.- Parameters:
page
- Context pagelinkTypeId
- Link type ID- Returns:
- Root path or null
-
-