Package com.jalios.jcms.wysiwyg
Class WysiwygUtils
- java.lang.Object
-
- com.jalios.jcms.wysiwyg.WysiwygUtils
-
public final class WysiwygUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()Returns the ObjectMapper.static java.lang.StringgetWysiwygMatchedLanguage(java.lang.String lang)Returns the WYSIWYG language from the JCMS language.static booleanisAutoConvertWiki2Wysiwyg(javax.servlet.http.HttpServletRequest request)Checks if the wiki fields must be converted automatically to wysiwyg fields.static voidwriteTinyMCELangFile(java.lang.String jcmsLang, java.util.Map<java.lang.String,java.lang.String> i18nMap, java.io.File outDirectory)Write a TinyMCE javascript language file, from the specified map of I18N properties.
-
-
-
Method Detail
-
writeTinyMCELangFile
public static void writeTinyMCELangFile(java.lang.String jcmsLang, java.util.Map<java.lang.String,java.lang.String> i18nMap, java.io.File outDirectory) throws java.io.IOExceptionWrite a TinyMCE javascript language file, from the specified map of I18N properties.- Parameters:
jcmsLang- the JCMS language code for which file is writteni18nMap- a map of I18N propertiesoutDirectory- the directory in which file must be writen- Throws:
java.io.IOException- if file could not be written
-
getWysiwygMatchedLanguage
public static java.lang.String getWysiwygMatchedLanguage(java.lang.String lang)
Returns the WYSIWYG language from the JCMS language. If the mapping is not found, it returns the JCMS language.- Parameters:
lang- JCMS language- Returns:
- WYSIWYG language
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Returns the ObjectMapper.- Returns:
ObjectMapper
-
isAutoConvertWiki2Wysiwyg
public static boolean isAutoConvertWiki2Wysiwyg(javax.servlet.http.HttpServletRequest request)
Checks if the wiki fields must be converted automatically to wysiwyg fields.The wiki fields are converted automatically to wysiwyg fields if the given request has the parameter
WysiwygConstants.AUTO_CONVERT_WIKI_2_WYSIWYGor the property 'wiki.auto-convert-to-wysiwyg' is true.- Parameters:
request- HttpServletRequest- Returns:
trueif the wiki fields are converted to wysiwyg fields,falseinstead
-
-