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 Details

    • FormResponseCsvExport

      public FormResponseCsvExport()
  • Method Details

    • 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