[opencms-dev] HTML import

Tosi, Joel JTosi at cme.com
Wed Dec 14 21:44:17 CET 2005


I believe I found the issue here.  In CmsHtmlImport.java, the
translateLink method has the following:

 

else if (link.length() >= m_inputDir.length() + 1) {
                // create a 'faked' link into the VFS. Original link was
                // directing to a missing page, so let the link so to
the
                // same page inside of OpenCms.
                String relativeFSName =
link.substring(m_inputDir.length() + 1);
                translatedLink = m_destinationDir + relativeFSName;
            }

 

 

So in my case, my link is /TY/department2958.html (length 23) and the
inputDir is /cme/isg/TY (length 10) which is the directory that the
import is coming from.

 

So the code enters this clause and the relativeFSName becomes

 

link.substring(11);

 

since link is /TY/department2958.html, I end up with a value of
'nt2958.html' for relativeFSName, so my link ends up broke.

 

I can code the fix, no big deal, but there has to be a reason why it was
coded this way to start with.  I just want to make sure I don't break
something else.  Any insight would be appreciated.

 

Thanks,

Joel

 

 

 

________________________________

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Tosi, Joel
Sent: Monday, December 12, 2005 2:07 PM
To: The OpenCms mailing list
Subject: [opencms-dev] HTML import

 

Has anyone else experienced any issues with the Extended HTML import
truncating absolute hrefs?  For example, if I have two links in an html
page /this/path/a.html, one link to /this/path/other.html and another
link to other.html, the first absolute link becomes er.html (literally
truncates all but last two letters before '.html') while the second link
stays fine.  This is in 6.0.2 

 

Thanks,

Joel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20051214/1c89963c/attachment.htm>


More information about the opencms-dev mailing list