Interface ContentRewriter<T>
public interface ContentRewriter<T>
ContentRewriter to rewrite document content such as links.
- Version:
- $Id$
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
rewrite
(T content, Node contentNode, HstRequestContext requestContext) rewrite
(T content, Node contentNode, HstRequestContext requestContext, String targetMountAlias) Rewrites the content of the content node.rewrite
(T content, Node contentNode, HstRequestContext requestContext, Mount targetMount) Rewrites the content of the content node.rewrite
(T content, HstRequestContext requestContext) Rewrites thecontent
withHstRequestContext
.void
setCanonicalLinks
(boolean canonicalLinks) void
setFullyQualifiedLinks
(boolean fullyQualifiedLinks) Sets whether thisContentRewriter
should create fully qualified links (URLs) for internal links.void
setImageVariant
(ImageVariant imageVariant) Sets whether thisContentRewriter
should use an imageVariant.
-
Method Details
-
rewrite
Rewrites thecontent
withHstRequestContext
. Since there is nocontentNode
param as is forrewrite(Object, javax.jcr.Node, org.hippoecm.hst.core.request.HstRequestContext)
this method typically cannot translate internal links in thecontent
-
rewrite
- Parameters:
content
- content object. It can be type of String or whatever, depending on the implementation and the context.contentNode
- theNode
that contains thecontent
requestContext
- theHstRequestContext
- Returns:
- the rewritten content
T
-
rewrite
Rewrites the content of the content node.- Parameters:
content
-contentNode
-requestContext
-targetMountAlias
-
-
rewrite
Rewrites the content of the content node.- Parameters:
content
-contentNode
-requestContext
-targetMount
-
-
setFullyQualifiedLinks
void setFullyQualifiedLinks(boolean fullyQualifiedLinks) Sets whether thisContentRewriter
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
- whentrue
thisContentRewriter
will return canonical links for internal links
-
isCanonicalLinks
boolean isCanonicalLinks()- Returns:
true
when canonical links should be created for internal links
-
setImageVariant
Sets whether thisContentRewriter
should use an imageVariant.- Parameters:
imageVariant
-
-
getImageVariant
ImageVariant getImageVariant()- Returns:
- an ImageVariant when there was set one through
setImageVariant(ImageVariant)
ornull
when no image variant was set
-