Class HtmlTextTemplateMigrationHelper
java.lang.Object
de.xima.fc.logic.migrate.HtmlTextTemplateMigrationHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class -
Method Summary
Modifier and TypeMethodDescriptionReads the default CSS rules from the classpath.static StringremoveDefaultStylesFromHtml(String html, Set<String> defaultCssRules) Parses the given HTML and inspects all inline styles.
-
Method Details
-
readDefaultPre83CssRules
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
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.
-