Interface ContentRewriter<T>
-
public interface ContentRewriter<T>
ContentRewriter to rewrite document content such as links.- Version:
- $Id$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ImageVariant
getImageVariant()
boolean
isCanonicalLinks()
boolean
isFullyQualifiedLinks()
T
rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext)
Rewrites thecontent
forNode
contentNode
.T
rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext, String targetMountAlias)
Rewrites the content of the content node.T
rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext, Mount targetMount)
Rewrites the content of the content node.T
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 Detail
-
rewrite
T rewrite(T content, HstRequestContext requestContext)
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
T rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext)
Rewrites thecontent
forNode
contentNode
.- 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
T rewrite(T content, javax.jcr.Node contentNode, HstRequestContext requestContext, String targetMountAlias)
Rewrites the content of the content node.- Parameters:
content
-contentNode
-requestContext
-targetMountAlias
-
-
rewrite
T rewrite(T content, javax.jcr.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 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
void setImageVariant(ImageVariant imageVariant)
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
-
-