info.magnolia.link
Class LinkTransformerManager

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

public class LinkTransformerManager
extends java.lang.Object

Single point of access for all Link Transformers.

Author:
had

Constructor Summary
LinkTransformerManager()
           
 
Method Summary
 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 getBrowserLink(java.lang.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.
 EditorLinkTransformer getEditorLink()
           
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(java.lang.String absolutePath)
          Creates instance of Relative link transformer that will translate path to the provided Link relative to path provided here.
 boolean isAddContextPathToBrowserLinks()
           
 boolean isMakeBrowserLinksRelative()
           
 void setAddContextPathToBrowserLinks(boolean addContextPathToBrowserLinks)
           
 void setMakeBrowserLinksRelative(boolean makeBrowserLinksRelative)
           
 
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

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.


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(java.lang.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(java.lang.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-2011 Magnolia International Ltd.. All Rights Reserved.