<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
because of need of site roots at third level folders like
"/sites/clientX/default/" instead of standard "/sites/default/", I
has modified <tt>CmsSiteManagerImpl.lookupSitesFolder(String
rootPath)</tt> to get an correct working <tt><cms:link></cms:link></tt>
function. <br>
<br>
Before my mod the "link" function produced URLs like
<a class="moz-txt-link-rfc2396E" href="http://mydomain.de/sites/clientX/default/de/index.html">"http://mydomain.de/sites/clientX/default/de/index.html"</a> because the
used <tt>lookupSitesFolder</tt> method doesn't find the siteRoot
"/sites/clientX". Now the <tt>lookupSitesFolder</tt> method look
also for "/sites/clientX/default" and the produced URLs shows like
<a class="moz-txt-link-rfc2396E" href="http://mydomain.de/de/index.html">"http://mydomain.de/de/index.html"</a> now ... Yes!<br>
<br>
Because I'd never using CVS I post my solution here (based on
OpenCMS 7.5.4). Eventually this helps everybody or would be
integrated in the current version:<br>
<br>
<tt> private CmsSite lookupSitesFolder(String rootPath) {<br>
<br>
int pos = rootPath.indexOf('/', SITES_FOLDER_POS);<br>
if (pos > 0) {<br>
// this assumes that the root path may likely start
with something like "/sites/default/" <br>
// just cut the first 2 directories from the root path
and do a direct lookup in the internal map<br>
CmsSite mySite =
(CmsSite)m_siteRootSites.get(rootPath.substring(0, pos));<br>
if (mySite != null) {<br>
return mySite;<br>
} else {<br>
// if no level 2 site was found, then check for
site at level 3 like "/sites/clientX/default/"<br>
int pos2 = rootPath.indexOf('/', pos + 1);<br>
if (pos2 > pos) {<br>
mySite =
(CmsSite)m_siteRootSites.get(rootPath.substring(0, pos2));<br>
}<br>
return mySite; <br>
}<br>
}<br>
return null;<br>
}<br>
</tt><br>
<br>
Kind regards<br>
Holger<br>
</body>
</html>