Class DocumentCsvImportService

java.lang.Object
su.onno.importer.DocumentCsvImportService

public class DocumentCsvImportService extends Object
Parses CSV files and applies rows to a document type through DocumentCommandService.
  • Constructor Details

  • Method Details

    • importDocuments

      public ImportResult importDocuments(DocumentDescriptor desc, byte[] csv, String charsetName, Map<String,String> mapping, DocumentImportMode mode, boolean dryRun, boolean postAfterImport, String groupBy, Principal principal)
      Imports documents using a field-to-header mapping, e.g. {"number":"Number"}.

      Header attributes use plain keys ("customer"); tabular-section lines use dotted keys ("lines.product"). When groupBy names a CSV column, consecutive or scattered rows that share its value collapse into one document — header fields come from the group's first row and every row contributes one line to each mapped tabular section. Without groupBy, each CSV row becomes its own document (with a single tabular line per section when tabular fields are mapped).