Package de.xima.fc.logic.migrate
Class HtmlTextTemplateMigrationHelper
- java.lang.Object
-
- de.xima.fc.logic.migrate.HtmlTextTemplateMigrationHelper
-
public final class HtmlTextTemplateMigrationHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HtmlTextTemplateMigrationHelper.HtmlSourceRange
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>
readDefaultPre83CssRules()
Reads the default CSS rules from the classpath.static String
removeDefaultStylesFromHtml(String html, Set<String> defaultCssRules)
Parses the given HTML and inspects all inline styles.
-
-
-
Method Detail
-
readDefaultPre83CssRules
public static Set<String> readDefaultPre83CssRules() throws IOException
Reads the default CSS rules from the classpath. This is all the CSS that was contained in the system HTML text templates provided by the system before the form theme update.- Returns:
- A set of default CSS rules.
- Throws:
IOException
-
removeDefaultStylesFromHtml
public static String removeDefaultStylesFromHtml(String html, Set<String> defaultCssRules)
Parses the given HTML and inspects all inline styles. If all inline styles aredefault styles
, removes all inline styles and returns the HTML without those styles. Otherwise, if the HTML contains at least one inline style that does not solely consist of default styles, returns null.- Parameters:
html
- The HTML to inspect.- Returns:
- The HTML without default styles, or null if the HTML cannot be parsed or contains either not styles at all or non-default styles.
-
-