Ignore:
Timestamp:
Nov 25, 2010, 10:51:14 AM (9 years ago)
Author:
gav
Message:

Imrovements to InventoryCsvService.
Update inventory import function, turn off searchable index mirroring during import and manually test as per ticket #79.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/InventoryCsvService.groovy

    r720 r721  
    1313
    1414    def dateUtilService
     15    def createDataService
    1516
    1617    def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib()
     
    3738            CSVReader reader = new CSVReader(sr)
    3839
     40            // Turn off index mirroring.
     41            createDataService.stopSearchableIndex()
     42
    3943            def fail = { Map m ->
    4044                status.setRollbackOnly()
     45                createDataService.startSearchableIndex() // Start mirroring again and rebuild index.
    4146                reader.close()
    4247                result.error = [ code: m.code, args: m.args ]
     
    5257            def line = []
    5358            def lineNumber = 0
    54             def maxNumberOfColumns = 20
     59            def maxNumberOfColumns = 19
    5560            def inventoryParams = [:]
    5661            def inventoryProperties = ["name", "description", "comment", "unitsInStock", "reorderPoint", "reorderQuantity",
     
    351356            // Success.
    352357            log.info "End of file."
     358            createDataService.startSearchableIndex() // Start mirroring again and rebuild index.
    353359            reader.close()
    354360            return result
     
    409415                                        "123", "Multi Supplier@Local",
    410416                                        "Multi Distributors1@OEM; Multi Distributors2@Local",
    411                                         "2204E-2RS", ""
     417                                        ""
    412418                                        ] as String[])
    413419
     
    422428                                        "456KL", "Multi Supplier",
    423429                                        "Multi Distributors1; Multi Distributors2",
    424                                         "", ""
     430                                        ""
    425431                                        ] as String[])
    426432
     
    688694            "Estimated Unit Price", "Currency", "Enable Reorder", "Location*", "Store*", "Site*", "Group*", "Type*",
    689695            "Supplier's Part Number", "Preferred Supplier", "Alternate Suppliers",
    690             "Alternate Item", "Spare For"]
     696            "Spare For"]
    691697    }
    692698
Note: See TracChangeset for help on using the changeset viewer.