Class FormResponseCsvExport
- java.lang.Object
-
- fr.paris.lutece.plugins.forms.export.csv.FormResponseCsvExport
-
public class FormResponseCsvExport extends java.lang.ObjectClass which contains all the data needed to build the CSV export
-
-
Constructor Summary
Constructors Constructor Description FormResponseCsvExport()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendResponseToCsvDataLine(java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> mapQuestionData, java.util.ArrayList<java.lang.Integer> questionIterationKey, java.util.Map<java.util.ArrayList<java.lang.Integer>,Question> mapQuestionAndIterationColumn, java.lang.StringBuilder sbResponse)Append the response to the CSV data line (StringBuilder sbResponse)java.lang.StringbuildCsvColumnToExport(java.util.List<Question> listQuestions)Build the CSV string for column linejava.lang.StringbuildCsvDataToExport(FormResponse formResponse, java.lang.String state)Build the CSV string for all data linesjava.util.Map<java.lang.Integer,java.util.List<java.lang.String>>buildMapQuestionDataToExport(FormResponse formResponse, CSVDataLine csvDataLine)Build mapQuestionData (a map with the question id as key and a list of responses as value) for all data linesstatic java.util.List<FormResponse>getFormResponseFromItemList(java.util.List<FormResponseItem> formResponseItems)
-
-
-
Method Detail
-
buildCsvColumnToExport
public java.lang.String buildCsvColumnToExport(java.util.List<Question> listQuestions)
Build the CSV string for column line
-
getFormResponseFromItemList
public static java.util.List<FormResponse> getFormResponseFromItemList(java.util.List<FormResponseItem> formResponseItems)
-
buildMapQuestionDataToExport
public java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> buildMapQuestionDataToExport(FormResponse formResponse, CSVDataLine csvDataLine)
Build mapQuestionData (a map with the question id as key and a list of responses as value) for all data lines- Parameters:
formResponse-csvDataLine-- Returns:
- mapQuestionData
-
appendResponseToCsvDataLine
public void appendResponseToCsvDataLine(java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> mapQuestionData, java.util.ArrayList<java.lang.Integer> questionIterationKey, java.util.Map<java.util.ArrayList<java.lang.Integer>,Question> mapQuestionAndIterationColumn, java.lang.StringBuilder sbResponse)Append the response to the CSV data line (StringBuilder sbResponse)- Parameters:
mapQuestionData-questionIterationKey-mapQuestionAndIterationColumn-sbResponse-
-
buildCsvDataToExport
public java.lang.String buildCsvDataToExport(FormResponse formResponse, java.lang.String state)
Build the CSV string for all data lines
-
-