Interface ContentRewriter<T>


public interface ContentRewriter<T>
ContentRewriter to rewrite document content such as links.
Version:
$Id$
  • Method Details

    • rewrite

      T rewrite(T content, HstRequestContext requestContext)
      Rewrites the content with HstRequestContext. Since there is no contentNode param as is for rewrite(Object, javax.jcr.Node, org.hippoecm.hst.core.request.HstRequestContext) this method typically cannot translate internal links in the content
    • rewrite

      T rewrite(T content, Node contentNode, HstRequestContext requestContext)
      Rewrites the content for Node contentNode.
      Parameters:
      content - content object. It can be type of String or whatever, depending on the implementation and the context.
      contentNode - the Node that contains the content
      requestContext - the HstRequestContext
      Returns:
      the rewritten content T
    • rewrite

      T rewrite(T content, Node contentNode, HstRequestContext requestContext, String targetMountAlias)
      Rewrites the content of the content node.
      Parameters:
      content -
      contentNode -
      requestContext -
      targetMountAlias -
    • rewrite

      T rewrite(T content, Node contentNode, HstRequestContext requestContext, Mount targetMount)
      Rewrites the content of the content node.
      Parameters:
      content -
      contentNode -
      requestContext -
      targetMount -
    • setFullyQualifiedLinks

      void setFullyQualifiedLinks(boolean fullyQualifiedLinks)
      Sets whether this ContentRewriter should create fully qualified links (URLs) for internal links.
      Parameters:
      fullyQualifiedLinks -
    • isFullyQualifiedLinks

      boolean isFullyQualifiedLinks()
      Returns:
      true when fully qualified links (URLs) should be created
    • setCanonicalLinks

      void setCanonicalLinks(boolean canonicalLinks)
      Parameters:
      canonicalLinks - when true this ContentRewriter will return canonical links for internal links
    • isCanonicalLinks

      boolean isCanonicalLinks()
      Returns:
      true when canonical links should be created for internal links
    • setImageVariant

      void setImageVariant(ImageVariant imageVariant)
      Sets whether this ContentRewriter should use an imageVariant.
      Parameters:
      imageVariant -
    • getImageVariant

      ImageVariant getImageVariant()
      Returns:
      an ImageVariant when there was set one through setImageVariant(ImageVariant) or null when no image variant was set