Class 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 in ContextAwareService 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.
      • Fields inherited from interface io.wcm.sling.commons.caservice.ContextAwareService

        PROPERTY_ACCEPTS_CONTEXT_PATH_EMPTY, PROPERTY_CONTEXT_PATH_BLACKLIST_PATTERN, PROPERTY_CONTEXT_PATH_PATTERN
    • 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 information
      boolean isValidLinkTarget​(@NotNull com.day.cq.wcm.api.Page page)
      Detected if page is acceptable as link target.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • LinkHandlerConfig

        public LinkHandlerConfig()
    • 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 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 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 page
        linkTypeId - Link type ID
        Returns:
        Root path or null