Class ImportProductServices


  • public class ImportProductServices
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
      static java.lang.String resource  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> productImportFromSpreadsheet​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      This method is responsible to import spreadsheet data into "Product" and "InventoryItem" entities into database.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Constructor Detail

      • ImportProductServices

        public ImportProductServices()
    • Method Detail

      • productImportFromSpreadsheet

        public static java.util.Map<java.lang.String,​java.lang.Object> productImportFromSpreadsheet​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
                                                                                                   throws java.io.IOException
        This method is responsible to import spreadsheet data into "Product" and "InventoryItem" entities into database. The method uses the ImportProductHelper class to perform its operation. The method uses "Apache POI" api for importing spreadsheet (xls files) data. Note : Create the spreadsheet directory in the ofbiz home folder and keep your xls files in this folder only.
        Parameters:
        dctx - the dispatch context
        context - the context
        Returns:
        the result of the service execution
        Throws:
        java.io.IOException