public interface WysiwygPolicyFilter extends PolicyFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
afterClean(java.lang.String unsafeStr,
java.lang.String safeStr,
java.util.Map<java.lang.String,java.lang.Object> contextMap)
This method is called after cleaning process of a HTML input received from the user.
|
java.lang.String |
afterRendering(java.lang.String text,
java.util.Locale userLocale)
This method is called after wysiwyg rendering
|
void |
beforeClean(java.lang.String unsafeStr,
java.util.Map<java.lang.String,java.lang.Object> contextMap)
This method is called before cleaning process of a HTML input received from the user.
|
java.lang.String |
beforeRendering(java.lang.String text,
java.util.Locale userLocale)
This method is called before wysiwyg rendering
|
void |
checkGlobalWysiwygCSS(java.util.Set globalStyle,
Workspace workspace)
This method is a hook called by Workspace to manage wysiwyg
css global style to display.
|
void |
checkLocalWysiwygCSS(java.util.Set localStyle,
java.lang.String globalStyle,
Workspace workspace)
This method is a hook called by Workspace to manage wysiwyg
css local style to display.
|
void |
checkWysiwygCSSFile(java.util.Set cssFileSet)
This method is a hook called by Workspace to manage wysiwyg css
files to parse and to display in wysiwyg css bar.
|
init
static final java.lang.String REVISION
void checkWysiwygCSSFile(java.util.Set cssFileSet)
cssFileSet
- the path of CSSFile to work withWorkspace.getGlobalWYSIWYGStyle()
void checkGlobalWysiwygCSS(java.util.Set globalStyle, Workspace workspace)
globalStyle
- Set of global styleworkspace
- the current WorkspaceWorkspace.getGlobalWYSIWYGStyle()
void checkLocalWysiwygCSS(java.util.Set localStyle, java.lang.String globalStyle, Workspace workspace)
localStyle
- Set of local styleglobalStyle
- the chosen global styleworkspace
- the current WorkspaceWorkspace.getLocalWYSIWYGStyle(String)
void beforeClean(java.lang.String unsafeStr, java.util.Map<java.lang.String,java.lang.Object> contextMap)
In current implementation, the following informations can be retrieved or modified from the context map :
Data data = (Data) contextMap.get(WysiwygManager.CLEANHTML_CTXT_DATA)
String fieldName = (String) contextMap.get(WysiwygManager.CLEANHTML_CTXT_FIELDNAME)
Whitelist whitelist = (org.jsoup.safety.Whitelist) contextMap.get(WysiwygManager.CLEANHTML_CTXT_WHITELIST)
null
to cancel the cleaning process (ie HTML parsing and cleaning), in such case,
method afterClean(String, String, Map)
will still be invoked.
unsafeStr
- the input received from the usercontextMap
- the map providing information on cleaning context, NEVER nulljava.lang.String afterClean(java.lang.String unsafeStr, java.lang.String safeStr, java.util.Map<java.lang.String,java.lang.Object> contextMap)
In current implementation, the following informations can be retrieved or modified from the context map :
Data data = (Data) contextMap.get(WysiwygManager.CLEANHTML_CTXT_DATA);
String fieldName = (String) contextMap.get(WysiwygManager.CLEANHTML_CTXT_FIELDNAME);
Whitelist whitelist = (org.jsoup.safety.Whitelist) contextMap.get(WysiwygManager.CLEANHTML_CTXT_WHITELIST);
Document dirtyDoc = (org.jsoup.nodes.Document) contextMap.get(WysiwygManager.CLEANHTML_CTXT_DIRTYDOC);
Document cleanDoc = (org.jsoup.nodes.Document) contextMap.get(WysiwygManager.CLEANHTML_CTXT_CLEANDOC);
unsafeStr
- the input received from the usersafeStr
- the input cleaned by JCMS (unless it was cancelled in beforeClean(String, Map)
)contextMap
- the map providing information on cleaning context, NEVER nulljava.lang.String beforeRendering(java.lang.String text, java.util.Locale userLocale)
text
- the text to be rendered.userLocale
- an optionnal Locale
of the user for which the text will be generatedjava.lang.String afterRendering(java.lang.String text, java.util.Locale userLocale)
text
- the text after the rendering.userLocale
- an optionnal Locale
of the user for which the text will be generatedCopyright © 2001-2016 Jalios SA. All Rights Reserved.