public interface RichTextHandler
RichText| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
TAG_PATTERN |
static java.lang.String |
URL_TAG_PREFIX |
static java.lang.String |
URL_TAG_SEPARATOR |
static java.lang.String |
URL_TAG_SUFFIX |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
applyPropertyMapping(org.cyclos.impl.contentmanagement.DataTranslationPropertyMapping propertyMapping,
java.lang.String value,
boolean fromClient)
Apply all property mapping definitions to the translated value according if the data is received or sent to the
client
|
void |
ensureRichTextNotLost(java.lang.String html)
Sanitizes the given text using the logged user's policy.
|
java.lang.String |
escapeTags(java.lang.String text)
Replaces all '<' by '< ', effectively invalidating all HTML tags
|
java.lang.String |
replaceTagsByUrls(java.lang.String html)
Replaces internal tags to URLs.
|
java.lang.String |
replaceTagsByUrls(java.lang.String html,
ConfigurationAccessor configuration)
Same as
replaceTagsByUrls(String) but using the root url and network of the specified accessor, |
java.lang.String |
replaceUrlsByTags(java.lang.String html)
Replaces URLs to to internal tags.
|
java.lang.String |
replaceUrlsByTags(java.lang.String html,
ConfigurationAccessor configuration)
Same as
replaceUrlsByTags(String) but using the root url and network of the specified user, |
java.lang.String |
sanitize(java.lang.String html)
Sanitizes the given HTML, removing blacklisted tags, correctly closing unclosed tags and removing leading /
trailing
whitespaces.
|
java.lang.String |
unescapeTags(java.lang.String text)
Replaces all '< ' by '<', reverting the result of
escapeTags(String) |
static final java.lang.String URL_TAG_PREFIX
static final java.lang.String URL_TAG_SEPARATOR
static final java.lang.String URL_TAG_SUFFIX
static final java.util.regex.Pattern TAG_PATTERN
java.lang.String applyPropertyMapping(org.cyclos.impl.contentmanagement.DataTranslationPropertyMapping propertyMapping,
java.lang.String value,
boolean fromClient)
void ensureRichTextNotLost(java.lang.String html)
throws ValidationException
ValidationExceptionjava.lang.String escapeTags(java.lang.String text)
java.lang.String replaceTagsByUrls(java.lang.String html)
replaceUrlsByTags(String)java.lang.String replaceTagsByUrls(java.lang.String html,
ConfigurationAccessor configuration)
replaceTagsByUrls(String) but using the root url and network of the specified accessor,configuration - If null or was obtained using SessionData.getConfiguration() then it resolve to the
loggued user.java.lang.String replaceUrlsByTags(java.lang.String html)
sanitize(String) is sufficient, but there might be
cases where an HTML sanitization is not needed, just the replacing of URL tags by full URLs.
The following tags are handled:
ConfigurationImageType.UserImage.UserCustomImage.AdImage.SystemCustomImage.java.lang.String replaceUrlsByTags(java.lang.String html,
ConfigurationAccessor configuration)
replaceUrlsByTags(String) but using the root url and network of the specified user,configuration - If null or was obtained using SessionData.getConfiguration() then it resolve to the
loggued user.java.lang.String sanitize(java.lang.String html)
java.lang.String unescapeTags(java.lang.String text)
escapeTags(String)