info.magnolia.link
Class AbsolutePathTransformer

java.lang.Object
  extended by info.magnolia.link.AbsolutePathTransformer
All Implemented Interfaces:
LinkTransformer
Direct Known Subclasses:
CompleteUrlPathTransformer, RelativePathTransformer

public class AbsolutePathTransformer
extends Object
implements LinkTransformer

Creates links with the absolute path. Alternatively can prefix links with the webapp context path as well. Transformer is also capable of applying URI2Repository mapping and i18n (mapping links to different path based on the current locale value). See AbstractI18nContentSupport for details.

Version:
$Id:$
Author:
had

Constructor Summary
AbsolutePathTransformer(boolean addContextPath, boolean useURI2RepositoryMapping, boolean useI18N)
          Creates new transformer.
 
Method Summary
protected  URI2RepositoryManager getURI2RepositoryManager()
           
 String getURISuffix(Link uuidLink)
          Gets reminder of the URI after the path (i.e.
 boolean isAddContextPath()
           
 boolean isUseI18N()
           
 boolean isUseURI2RepositoryMapping()
           
protected  String prefixLink(String linkStr)
           
 void setAddContextPath(boolean addContextPath)
           
 void setUseI18N(boolean useI18N)
           
 void setUseURI2RepositoryMapping(boolean useURI2RepositoryMapping)
           
 String transform(Link uuidLink)
          Transforms Link into desired output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsolutePathTransformer

public AbsolutePathTransformer(boolean addContextPath,
                               boolean useURI2RepositoryMapping,
                               boolean useI18N)
Creates new transformer.

Parameters:
addContextPath - Flag to specify whether or not to prepend context path to created links.
useURI2RepositoryMapping - Flag specifying whether or not to apply any URI2Repository mapping.
useI18N - Flag specifying whether or not to translate link path based on current locale value.
Method Detail

transform

public String transform(Link uuidLink)
Transforms Link into desired output.

Specified by:
transform in interface LinkTransformer
Parameters:
uuidLink - Link to repository content be transformed.
Returns:
Transformed link.

getURI2RepositoryManager

protected URI2RepositoryManager getURI2RepositoryManager()

prefixLink

protected String prefixLink(String linkStr)

getURISuffix

public String getURISuffix(Link uuidLink)
Gets reminder of the URI after the path (i.e. anchor and parameters).


isAddContextPath

public boolean isAddContextPath()

setAddContextPath

public void setAddContextPath(boolean addContextPath)

isUseI18N

public boolean isUseI18N()

setUseI18N

public void setUseI18N(boolean useI18N)

isUseURI2RepositoryMapping

public boolean isUseURI2RepositoryMapping()

setUseURI2RepositoryMapping

public void setUseURI2RepositoryMapping(boolean useURI2RepositoryMapping)


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