Package org.opencms.ugc
Class CmsUgcValueTranformHandler
java.lang.Object
org.opencms.ugc.CmsUgcValueTranformHandler
The class transforms the values that should be written to an XML content via UGC according to a
 content type specific value transformation configuration.
 By default all values are xml escaped to void XSS issues when content that is created via UGC is
 rendered on a webpage without any extra caution.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final CmsUgcValueTranformHandlerThe default value transformer.
- 
Constructor SummaryConstructorsConstructorDescriptionCmsUgcValueTranformHandler(CmsObject cms, CmsResource resource) Creates the value transformer instance for the provided resource.
- 
Method SummaryModifier and TypeMethodDescriptiontransformValue(String path, String value) The method applies the configured value transformer to the given value.
- 
Field Details- 
DEFAULTThe default value transformer.
 
- 
- 
Constructor Details- 
CmsUgcValueTranformHandlerpublic CmsUgcValueTranformHandler(CmsObject cms, CmsResource resource) throws CmsXmlException, CmsException, IllegalArgumentException, JSONException Creates the value transformer instance for the provided resource.- Parameters:
- cms- the context
- resource- the resource of the XML content to get the mapping security for
- Throws:
- CmsXmlException- thrown if the content can't be unmarshalled
- CmsException- thrown if the content can't be read
- IllegalArgumentException- thrown if the value transformer configuration contains invalid transformers.
- JSONException- thrown if the value transformer configuration is no valid JSON.
 
 
- 
- 
Method Details- 
transformValueThe method applies the configured value transformer to the given value.- Parameters:
- path- the XML path to store the value
- value- the value to transform
- Returns:
- the transformed value
 
 
-