Upload framework - OpenLMIS/open-lmis GitHub Wiki

Upload Framework

Tool Used

SuperCSV

For uploading a CSV (Eg. Facilitis or Programs)

  • Create the Bean (Facility/Program) with appropriate type of fields and corresponding setters. Annontate the fields with @ImportField and supply rewuired attributes (mandatory, datatype and unique) This will do necessary validation and conversion of csv data while creating bean.
  • Parse the file (CsvParserService.parse()) and provide your csv file path and bean class. Provide it a handler to handle the records read.