Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.util
Class LinkSubstitution  view LinkSubstitution download LinkSubstitution.java

java.lang.Object
  extended bycom.opencms.util.LinkSubstitution

public class LinkSubstitution
extends java.lang.Object

Version:
1.0

Field Summary
private static org.apache.oro.text.perl.Perl5Util c_perlUtil
          Reference to the CmsElementCache object containing locators for all URIs and elements in cache.
private static java.lang.String m_converterConfiguration
          String to configure the CmsHtmlConverter
 
Constructor Summary
LinkSubstitution()
           
 
Method Summary
static java.lang.String getLinkSubstitution(com.opencms.file.CmsObject cms, java.lang.String link)
          Replaces the link according to the rules and registers it to the requestcontex if we are in export modus.
static java.lang.String getRelativePath(java.lang.String baseFile, java.lang.String linkTarget)
          This methood calculates the relative path to a resource in OpenCms depending on the page where it is used.
 java.lang.String substituteContentBody(java.lang.String body, java.lang.String webappUrl, java.lang.String fileName)
           
 java.lang.String substituteEditorContent(com.opencms.file.CmsObject cms, java.lang.String content)
          Parses the html content for the editor.
 java.lang.String substituteEditorContent(com.opencms.file.CmsObject cms, java.lang.String content, java.lang.String path, java.lang.String relativeRoot)
          parses the html content from the editor.
 java.lang.String substituteEditorContentBody(com.opencms.file.CmsObject cms, java.lang.String body)
          Parses the content of the body tag of a html page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c_perlUtil

private static org.apache.oro.text.perl.Perl5Util c_perlUtil
Reference to the CmsElementCache object containing locators for all URIs and elements in cache.


m_converterConfiguration

private static java.lang.String m_converterConfiguration
String to configure the CmsHtmlConverter

Constructor Detail

LinkSubstitution

public LinkSubstitution()
Method Detail

substituteEditorContentBody

public java.lang.String substituteEditorContentBody(com.opencms.file.CmsObject cms,
                                                    java.lang.String body)
                                             throws com.opencms.core.CmsException
Parses the content of the body tag of a html page. It is the same as substituteEditorContent except that it expects only the part of the html page between the body tags.


substituteEditorContent

public java.lang.String substituteEditorContent(com.opencms.file.CmsObject cms,
                                                java.lang.String content)
                                         throws com.opencms.core.CmsException
Parses the html content for the editor. It replaces the links in This method is used for database imports of OpenCms versions < 5.0


substituteContentBody

public java.lang.String substituteContentBody(java.lang.String body,
                                              java.lang.String webappUrl,
                                              java.lang.String fileName)
                                       throws com.opencms.core.CmsException

substituteEditorContent

public java.lang.String substituteEditorContent(com.opencms.file.CmsObject cms,
                                                java.lang.String content,
                                                java.lang.String path,
                                                java.lang.String relativeRoot)
                                         throws com.opencms.core.CmsException
parses the html content from the editor. It replaces the links in path in opencms

getLinkSubstitution

public static java.lang.String getLinkSubstitution(com.opencms.file.CmsObject cms,
                                                   java.lang.String link)
Replaces the link according to the rules and registers it to the requestcontex if we are in export modus.


getRelativePath

public static java.lang.String getRelativePath(java.lang.String baseFile,
                                               java.lang.String linkTarget)
This methood calculates the relative path to a resource in OpenCms depending on the page where it is used. i.e.: baseFile = "/folder1/folder2/index.html" linkTarget= "/folder1/pics/pic.gif" returns: "../pics/pic.gif"