Class FormResponseCsvExport
java.lang.Object
fr.paris.lutece.plugins.forms.export.csv.FormResponseCsvExport
Class which contains all the data needed to build the CSV export
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendResponseToCsvDataLine(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)buildCsvColumnToExport(List<Question> listQuestions) Build the CSV string for column linebuildCsvDataToExport(FormResponse formResponse, String state) Build the CSV string for all data linesbuildMapQuestionDataToExport(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)
-
Constructor Details
-
FormResponseCsvExport
public FormResponseCsvExport()
-
-
Method Details
-
buildCsvColumnToExport
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
Build the CSV string for all data lines
-