public class LinkTransformerManager extends Object
Constructor and Description |
---|
LinkTransformerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addTransformer(String key,
LinkTransformer transformer) |
AbsolutePathTransformer |
getAbsolute()
Creates instance of absolute link transformer that will prepend the context path, will use URI2Repository mapping while constructing links and will localize the link if localization is set up.
|
AbsolutePathTransformer |
getAbsolute(boolean addContextPath)
Creates instance of absolute link transformer that will optionally prepend the context path, but will always use URI2Repository mapping while constructing links and will localize the link if localization is set up.
|
LinkTransformer |
getAbsoluteTransformer()
Gets registered absolute path transformer.
|
LinkTransformer |
getBrowserLink(String currentPath)
Creates instance of link transformer that will transform any provided links to either absolute or relative path based on the current server configuration.
|
CompleteUrlPathTransformer |
getCompleteUrl()
Creates instance of Complete URL link transformer that will create fully qualified and localized link to content denoted by Link provided to its transform method.
|
LinkTransformer |
getCompleteURLTransformer()
Gets registered complete URL transformer.
|
EditorLinkTransformer |
getEditorLink() |
LinkTransformer |
getEditorTransformer()
Gets registered editor link transformer.
|
LinkTransformer |
getI18nTransformer()
Gets registered complete URL transformer.
|
static LinkTransformerManager |
getInstance()
Gets the current singleton instance.
|
RelativePathTransformer |
getRelative(javax.jcr.Node page)
Creates instance of Relative link transformer that will translate path to the provided Link relative to the content provided here.
|
RelativePathTransformer |
getRelative(String absolutePath)
Creates instance of Relative link transformer that will translate path to the provided Link relative to path provided here.
|
LinkTransformer |
getRelativeTransformer()
Gets registered relative path transformer.
|
Map<String,LinkTransformer> |
getTransformers() |
boolean |
isAddContextPathToBrowserLinks() |
boolean |
isMakeBrowserLinksRelative() |
void |
setAddContextPathToBrowserLinks(boolean addContextPathToBrowserLinks) |
void |
setMakeBrowserLinksRelative(boolean makeBrowserLinksRelative) |
void |
setTransformers(Map<String,LinkTransformer> transformers) |
public Map<String,LinkTransformer> getTransformers()
public void setTransformers(Map<String,LinkTransformer> transformers)
public void addTransformer(String key, LinkTransformer transformer)
public boolean isAddContextPathToBrowserLinks()
public void setAddContextPathToBrowserLinks(boolean addContextPathToBrowserLinks)
public boolean isMakeBrowserLinksRelative()
public void setMakeBrowserLinksRelative(boolean makeBrowserLinksRelative)
public static LinkTransformerManager getInstance()
public LinkTransformer getAbsoluteTransformer()
public LinkTransformer getEditorTransformer()
public LinkTransformer getRelativeTransformer()
public LinkTransformer getCompleteURLTransformer()
public LinkTransformer getI18nTransformer()
public AbsolutePathTransformer getAbsolute()
public AbsolutePathTransformer getAbsolute(boolean addContextPath)
public RelativePathTransformer getRelative(javax.jcr.Node page)
public RelativePathTransformer getRelative(String absolutePath)
public CompleteUrlPathTransformer getCompleteUrl()
public EditorLinkTransformer getEditorLink()
EditorLinkTransformer
public LinkTransformer getBrowserLink(String currentPath)
currentPath
- Path to make links relative to, if relative path translation is configured on the server.Copyright © 2003–2019 Magnolia International Ltd.. All rights reserved.