Allows to configure customized link substitution behavior.
This handler is plugged into
CmsLinkManager#substituteLink(org.opencms.file.CmsObject,String,String,boolean),
which is the central method to calculate links for the use on web pages.
This method is also used by the <cms:link />
tag.
Moreover, this handler is plugged into
CmsLinkManager#getRootPath(CmsObject,String,String),
which basically is the revered method that gets a VFS root path from a link.
For the implementation, you must implement the methods in this interface so that:
String path; // assume we have a valid VFS resource root path
CmsObject cms; // assume we have a valid OpenCms user context
CmsLinkManager lm = OpenCms.getLinkManager();
String link = lm.substituteLinkForRootPath(cms, path);
String rootPath = lm.getRootPath(cms, link);
link.equals(rootPath); // this must be true!
Using this handler, you can completely customize the behavior of the link substitution.
The default implementation of this interface is
CmsDefaultLinkSubstitutionHandler.