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 PatternFORBIDDEN_CHARACTERSstatic StringLANG_CTX_DATAstatic StringLIST_DELIMITERprotected static PatternNEWLINEstatic StringNEWLINE_REPLACEMENT_CTX_DATAprotected Function<String,String>sanitizerstatic StringUNKNOWN_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 StringescapeInjectableValue(String value)protected StringgetTranslatedValue(Session session, String schema, String lang, String value)static StringremoveFirstForbiddenCharacter(String value)Deprecated.since 2021.32 Use escapeInjectableValue instead to allow lighter data alterationprotected StringreplaceNewline(String value)protected Stringsanitize(String value)protected voidwrite(Property property, org.apache.commons.csv.CSVPrinter printer)protected voidwriteHeader(Property property, org.apache.commons.csv.CSVPrinter printer)protected voidwriteListProperty(Property property, org.apache.commons.csv.CSVPrinter printer)protected voidwriteListVocabularyProperty(String[] values, Directory vocabulary, org.apache.commons.csv.CSVPrinter printer)protected voidwriteScalarProperty(Property property, org.apache.commons.csv.CSVPrinter printer)protected voidwriteScalarVocabularyProperty(String value, Directory vocabulary, org.apache.commons.csv.CSVPrinter printer)protected voidwriteUnsupported(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:
writein classAbstractCSVWriter<Property>- Throws:
IOException
-
writeHeader
protected void writeHeader(Property property, org.apache.commons.csv.CSVPrinter printer) throws IOException
- Specified by:
writeHeaderin 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
-
-