Class DocumentPropertyCSVWriter
- java.lang.Object
-
- org.nuxeo.ecm.core.io.marshallers.csv.AbstractCSVWriter<Property>
-
- org.nuxeo.ecm.platform.csv.export.io.DocumentPropertyCSVWriter
-
- All Implemented Interfaces:
Marshaller<Property>
,Writer<Property>
@Setup(mode=SINGLETON, priority=2000) public class DocumentPropertyCSVWriter extends AbstractCSVWriter<Property>
- Since:
- 10.3
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
FORBIDDEN_CHARACTERS
static String
LANG_CTX_DATA
static String
LIST_DELIMITER
protected static Pattern
NEWLINE
static String
NEWLINE_REPLACEMENT_CTX_DATA
protected Function<String,String>
sanitizer
static String
UNKNOWN_TRANSLATED_VALUE_LABEL
-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.csv.AbstractCSVWriter
ctx, registry, schemaManager, TEXT_CSV, TEXT_CSV_TYPE
-
-
Constructor Summary
Constructors Constructor Description DocumentPropertyCSVWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
escapeInjectableValue(String value)
protected String
getTranslatedValue(Session session, String schema, String lang, String value)
static String
removeFirstForbiddenCharacter(String value)
Deprecated.since 2021.32 Use escapeInjectableValue instead to allow lighter data alterationprotected String
replaceNewline(String value)
protected String
sanitize(String value)
protected void
write(Property property, org.apache.commons.csv.CSVPrinter printer)
protected void
writeHeader(Property property, org.apache.commons.csv.CSVPrinter printer)
protected void
writeListProperty(Property property, org.apache.commons.csv.CSVPrinter printer)
protected void
writeListVocabularyProperty(String[] values, Directory vocabulary, org.apache.commons.csv.CSVPrinter printer)
protected void
writeScalarProperty(Property property, org.apache.commons.csv.CSVPrinter printer)
protected void
writeScalarVocabularyProperty(String value, Directory vocabulary, org.apache.commons.csv.CSVPrinter printer)
protected void
writeUnsupported(Type type, org.apache.commons.csv.CSVPrinter printer)
-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.csv.AbstractCSVWriter
accept, getCSVPrinter, printCalendar, write
-
-
-
-
Field Detail
-
LIST_DELIMITER
public static final String LIST_DELIMITER
- See Also:
- Constant Field Values
-
NEWLINE_REPLACEMENT_CTX_DATA
public static final String NEWLINE_REPLACEMENT_CTX_DATA
- Since:
- 11.5
- See Also:
- Constant Field Values
-
LANG_CTX_DATA
public static final String LANG_CTX_DATA
- See Also:
- Constant Field Values
-
UNKNOWN_TRANSLATED_VALUE_LABEL
public static final String UNKNOWN_TRANSLATED_VALUE_LABEL
- See Also:
- Constant Field Values
-
FORBIDDEN_CHARACTERS
public static final Pattern FORBIDDEN_CHARACTERS
- Since:
- 2021.10
-
NEWLINE
protected static final Pattern NEWLINE
-
-
Method Detail
-
write
protected void write(Property property, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Specified by:
write
in classAbstractCSVWriter<Property>
- Throws:
IOException
-
writeHeader
protected void writeHeader(Property property, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Specified by:
writeHeader
in classAbstractCSVWriter<Property>
- Throws:
IOException
-
writeScalarProperty
protected void writeScalarProperty(Property property, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Throws:
IOException
-
writeScalarVocabularyProperty
protected void writeScalarVocabularyProperty(String value, Directory vocabulary, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Throws:
IOException
-
writeListProperty
protected void writeListProperty(Property property, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Throws:
IOException
-
writeListVocabularyProperty
protected void writeListVocabularyProperty(String[] values, Directory vocabulary, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Throws:
IOException
-
getTranslatedValue
protected String getTranslatedValue(Session session, String schema, String lang, String value)
-
writeUnsupported
protected void writeUnsupported(Type type, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Throws:
IOException
-
removeFirstForbiddenCharacter
@Deprecated(since="2021.32") public static String removeFirstForbiddenCharacter(String value)
Deprecated.since 2021.32 Use escapeInjectableValue instead to allow lighter data alteration- Since:
- 2021.10
-
escapeInjectableValue
public static String escapeInjectableValue(String value)
- Since:
- 2021.32 See https://owasp.org/www-community/attacks/CSV_Injection
-
-