Package org.opencms.ugc
Class CmsUgcValueTransformerConfiguration
java.lang.Object
org.opencms.ugc.CmsUgcValueTransformerConfiguration
Wrapper for a value transformer configuration that is provided in content's schema file
in the parameters section as follows:
<parameters> <param name="ugc.values.transformer"> { "Paragraph/Text": { "transformer": "antisamy" }, "Title": { "transformer": "antisamy", "config": { "policy": "/system/modules/my.module/resources/ugc/antisamy-policy.xml" } }, "Author": { "transformer": "none" }, "Email": { "transformer": "escape" } } </param> </parameter>The configuration defines how values that are added via UGC at a certain path have to be transformed, primarily to not cause XSS or other issues.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The transformer for a single value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CmsUgcValueTransformerConfiguration
The default tranformer configuration. -
Constructor Summary
ConstructorsConstructorDescriptionWraps the provided transformer configuration -
Method Summary
Modifier and TypeMethodDescriptiongetTransformer
(String path) Returns the transformer for the provided XML path.
-
Field Details
-
DEFAULT
The default tranformer configuration.
-
-
Constructor Details
-
CmsUgcValueTransformerConfiguration
public CmsUgcValueTransformerConfiguration(String config) throws JSONException, IllegalArgumentException Wraps the provided transformer configuration- Parameters:
config
- the configuration to wrap- Throws:
JSONException
- thrown if the configuration is not a valid JSONIllegalArgumentException
- thrown if the configuration values are not as expected
-
-
Method Details
-
getTransformer
Returns the transformer for the provided XML path.- Parameters:
path
- the XML path to get the value transformer for.- Returns:
- the transformer for the provided XML path.
-