Class FormResponseCsvExport
- java.lang.Object
-
- fr.paris.lutece.plugins.forms.export.csv.FormResponseCsvExport
-
public class FormResponseCsvExport extends Object
Class 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(Map<Integer,List<String>> mapQuestionData, ArrayList<Integer> questionIterationKey, Map<ArrayList<Integer>,Question> mapQuestionAndIterationColumn, StringBuilder sbResponse)Append the response to the CSV data line (StringBuilder sbResponse)StringbuildCsvColumnToExport(List<Question> listQuestions)Build the CSV string for column lineStringbuildCsvDataToExport(FormResponse formResponse, String state)Build the CSV string for all data linesMap<Integer,List<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 List<FormResponse>getFormResponseFromItemList(List<FormResponseItem> formResponseItems)
-
-
-
Method Detail
-
buildCsvColumnToExport
public String buildCsvColumnToExport(List<Question> listQuestions)
Build the CSV string for column line
-
getFormResponseFromItemList
public static List<FormResponse> getFormResponseFromItemList(List<FormResponseItem> formResponseItems)
-
buildMapQuestionDataToExport
public Map<Integer,List<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(Map<Integer,List<String>> mapQuestionData, ArrayList<Integer> questionIterationKey, Map<ArrayList<Integer>,Question> mapQuestionAndIterationColumn, StringBuilder sbResponse)
Append the response to the CSV data line (StringBuilder sbResponse)- Parameters:
mapQuestionData-questionIterationKey-mapQuestionAndIterationColumn-sbResponse-
-
buildCsvDataToExport
public String buildCsvDataToExport(FormResponse formResponse, String state)
Build the CSV string for all data lines
-
-