info.magnolia.link
Class LinkTransformerManager

java.lang.Object
  extended by info.magnolia.link.LinkTransformerManager

public class LinkTransformerManager
extends Object

Single point of access for all Link Transformers.

Author:
had

Constructor Summary
LinkTransformerManager()
           
 
Method Summary
 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(Content 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkTransformerManager

public LinkTransformerManager()
Method Detail

getTransformers

public Map<String,LinkTransformer> getTransformers()

setTransformers

public void setTransformers(Map<String,LinkTransformer> transformers)

addTransformer

public void addTransformer(String key,
                           LinkTransformer transformer)

isAddContextPathToBrowserLinks

public boolean isAddContextPathToBrowserLinks()

setAddContextPathToBrowserLinks

public void setAddContextPathToBrowserLinks(boolean addContextPathToBrowserLinks)

isMakeBrowserLinksRelative

public boolean isMakeBrowserLinksRelative()

setMakeBrowserLinksRelative

public void setMakeBrowserLinksRelative(boolean makeBrowserLinksRelative)

getInstance

public static LinkTransformerManager getInstance()
Gets the current singleton instance.


getAbsoluteTransformer

public LinkTransformer getAbsoluteTransformer()
Gets registered absolute path transformer.


getEditorTransformer

public LinkTransformer getEditorTransformer()
Gets registered editor link transformer.


getRelativeTransformer

public LinkTransformer getRelativeTransformer()
Gets registered relative path transformer.


getCompleteURLTransformer

public LinkTransformer getCompleteURLTransformer()
Gets registered complete URL transformer.


getI18nTransformer

public LinkTransformer getI18nTransformer()
Gets registered complete URL transformer.


getAbsolute

public 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.


getAbsolute

public 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.


getRelative

public RelativePathTransformer getRelative(Content page)
Creates instance of Relative link transformer that will translate path to the provided Link relative to the content provided here. During the translation all valid URI2repository mappings and i18n will be applied.


getRelative

public RelativePathTransformer getRelative(String absolutePath)
Creates instance of Relative link transformer that will translate path to the provided Link relative to path provided here. During the translation all valid URI2repository mappings and i18n will be applied.


getCompleteUrl

public 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.


getEditorLink

public EditorLinkTransformer getEditorLink()
See Also:
EditorLinkTransformer

getBrowserLink

public 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.

Parameters:
currentPath - Path to make links relative to, if relative path translation is configured on the server.


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.