Class CmsHtmlImportConverter
- java.lang.Object
-
- org.opencms.workplace.tools.database.CmsHtmlImportConverter
-
public class CmsHtmlImportConverter extends java.lang.Object
This class implements Html-converting routines based on tidy to modify the Html code of the imported Html pages.- Since:
- 6.0.0
-
-
Constructor Summary
Constructors Constructor Description CmsHtmlImportConverter(CmsHtmlImport htmlImport, boolean xmlMode)
Default constructor, creates a new HtmlConverter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convertHTML(java.io.Reader input, java.io.Writer output, java.lang.String startPattern, java.lang.String endPattern, java.util.Hashtable properties)
Transforms HTML code into user defined output.java.lang.String
convertHTML(java.lang.String filename, java.lang.String inString, java.lang.String startPattern, java.lang.String endPattern, java.util.Hashtable properties)
Transforms HTML code into user defined output.static java.lang.String
extractHtml(java.lang.String content, java.lang.String startpoint, java.lang.String endpoint)
Extracts the content of a HTML page.
-
-
-
Constructor Detail
-
CmsHtmlImportConverter
public CmsHtmlImportConverter(CmsHtmlImport htmlImport, boolean xmlMode)
Default constructor, creates a new HtmlConverter.- Parameters:
htmlImport
- reference to the htmlimportxmlMode
- switch for setting the import to HTML or XML mode
-
-
Method Detail
-
extractHtml
public static java.lang.String extractHtml(java.lang.String content, java.lang.String startpoint, java.lang.String endpoint)
Extracts the content of a HTML page.This method should be pretty robust and work even if the input HTML does not contains the specified matchers.
- Parameters:
content
- the content to extract the body fromstartpoint
- the point where matching startsendpoint
- the point where matching ends- Returns:
- the extracted body tag content
-
convertHTML
public void convertHTML(java.io.Reader input, java.io.Writer output, java.lang.String startPattern, java.lang.String endPattern, java.util.Hashtable properties)
Transforms HTML code into user defined output.- Parameters:
input
- Reader with HTML codeoutput
- Writer with transformed codestartPattern
- the start pattern definition for content extractingendPattern
- the end pattern definition for content extractingproperties
- the file properties
-
convertHTML
public java.lang.String convertHTML(java.lang.String filename, java.lang.String inString, java.lang.String startPattern, java.lang.String endPattern, java.util.Hashtable properties)
Transforms HTML code into user defined output.- Parameters:
filename
- the absolute path in the real filesystem of the file to convertinString
- String with HTML codestartPattern
- the start pattern definition for content extractingendPattern
- the end pattern definition for content extractingproperties
- the file properties- Returns:
- String with transformed code
-
-