Class 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 Detail

      • DEFAULT_ROOT_PATH_CONTENT

        public static final String DEFAULT_ROOT_PATH_CONTENT
        Default content root path.
        See Also:
        Constant Field Values
      • DEFAULT_ROOT_PATH_MEDIA

        public static final String DEFAULT_ROOT_PATH_MEDIA
        Default media/asset root path.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LinkHandlerConfig

        public LinkHandlerConfig()
    • Method Detail

      • getLinkTypes

        @NotNull
        public @NotNull List<Class<? extends LinkType>> getLinkTypes()
        Returns:
        Supported link types
      • getMarkupBuilders

        @NotNull
        public @NotNull List<Class<? extends LinkMarkupBuilder>> getMarkupBuilders()
        Returns:
        Available link markup builders
      • getPreProcessors

        @NotNull
        public @NotNull List<Class<? extends LinkProcessor>> getPreProcessors()
        Returns:
        List of link metadata pre processors (optional). The processors are applied in list order.
      • getPostProcessors

        @NotNull
        public @NotNull List<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 by InternalLinkType, other LinkType 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 page
        linkTypeId - Link type ID
        Returns:
        Root path or null