org.opencms.staticexport
Class CmsAdvancedLinkSubstitutionHandler

java.lang.Object
  extended by org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler
      extended by org.opencms.staticexport.CmsAdvancedLinkSubstitutionHandler
All Implemented Interfaces:
I_CmsLinkSubstitutionHandler

public class CmsAdvancedLinkSubstitutionHandler
extends CmsDefaultLinkSubstitutionHandler

Advanced link substitution behavior.

You can define additional paths that are always used as external links, even if they point to the same configured site than the OpenCms itself.

Since:
7.5.0
Version:
$Revision: 1.4 $
Author:
Michael Emmerich
See Also:
for the method where this handler is used.

Constructor Summary
CmsAdvancedLinkSubstitutionHandler()
           
 
Method Summary
 java.lang.String getRootPath(CmsObject cms, java.lang.String targetUri, java.lang.String basePath)
          Returns the resource root path in the OpenCms VFS for the given target URI link, or null in case the link points to an external site.
 
Methods inherited from class org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler
getLink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsAdvancedLinkSubstitutionHandler

public CmsAdvancedLinkSubstitutionHandler()
Method Detail

getRootPath

public java.lang.String getRootPath(CmsObject cms,
                                    java.lang.String targetUri,
                                    java.lang.String basePath)
Description copied from interface: I_CmsLinkSubstitutionHandler
Returns the resource root path in the OpenCms VFS for the given target URI link, or null in case the link points to an external site.

The default implementation applies the following transformations to the link:

Please note the above text describes the default behavior as implemented by CmsDefaultLinkSubstitutionHandler, which can be fully customized using this handler interface.

Specified by:
getRootPath in interface I_CmsLinkSubstitutionHandler
Overrides:
getRootPath in class CmsDefaultLinkSubstitutionHandler
Parameters:
cms - the current users OpenCms context
targetUri - the target URI link
basePath - path to use as base in case the target URI is relative (can be null)
Returns:
the resource root path in the OpenCms VFS for the given target URI link, or null in case the link points to an external site
See Also:
I_CmsLinkSubstitutionHandler.getRootPath(org.opencms.file.CmsObject, java.lang.String, java.lang.String)