Package org.exoplatform.agenda.util
Class AttendeesCsv
java.lang.Object
org.exoplatform.agenda.util.AttendeesCsv
Writes the participant list of an event as a CSV file (RFC 4180): UTF-8
with a byte order mark, so that a spreadsheet reads its accents, a comma
between cells and CRLF after each line, every cell quoted.
Names, space names and guest addresses are typed by users: a cell starting with a character a spreadsheet reads as the start of a formula gets a single quote before it, so that no cell of the file is ever evaluated.
-
Field Details
-
BYTE_ORDER_MARK
Starts the file, so that a spreadsheet reads it as UTF-8.- See Also:
-
LINE_SEPARATOR
Ends each line of the file.- See Also:
-
FILE_NAME_SUFFIX
Ends the name of the file, after the event's title.- See Also:
-
-
Method Details
-
write
- Parameters:
lines- the lines of the file, the header first, each a list of cells- Returns:
- the file's text, its byte order mark included
-
cell
- Parameters:
value- the text of a cell, null for an empty one- Returns:
- the cell as written in the file: neutralised when it would start a formula, then quoted, its quotes doubled
-
fileName
- Parameters:
exportDay- the day of the exporttitle- the event's title- Returns:
YYYYMMDD_<title>_participants list.csv, the title's characters a file name may not hold, and its control characters, replaced with an underscore
-