Changeset 182


Ignore:
Timestamp:
Nov 10, 2010, 10:27:34 AM (6 years ago)
Author:
adem.bilican@…
Message:

correction for text input into importer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • grails-app/controllers/importer/MeasurementTypeImporterController.groovy

    r181 r182  
    5959                if( (tabbedTable.replaceAll("^\\s+", "").size() > 0) && (params['file'] == "null" ) ) {   
    6060                    flow.tab = tabbedTable
    61                     try {
    62                         this.parseData(ImporterService, flow.tab, flow)
    63                         flow.file = params['file']
    64                         success()
    65                     }
    66                     catch (Exception e) {
    67                         flash.errors = "Input Error : Please check your input data"
    68                         error()
    69                     }
     61                    this.parseData(ImporterService, flow.tab, flow)
     62                    flow.file = params['file']
     63                    success()
    7064                }
    7165                // there is a file
    7266                else if ((tabbedTable.replaceAll("^\\s+", "").size() == 0) && (params['file'] != "null" )) {
    7367                    try{
    74                         this.parseData(ImporterService, fileService.get(params['file']) ,flow,flash)
     68                        this.parseData(ImporterService, fileService.get(params['file']) ,flow)
    7569                        flow.file = params['file']
    7670                        success()
     
    130124     * parseData will parse the pasted tab-delimited data
    131125     */
    132     def parseData(ImporterService, tabDelimited, flow,flash){
     126    def parseData(ImporterService, tabDelimited, flow){
    133127        def headersList= []
    134128        def datamatrix = []
    135         def wb = getWorkBook(tabDelimited,flash)
     129        def wb = getWorkBook(tabDelimited)
    136130        // getHeader contains information about headers
    137131        for (header in ImporterService.getHeader(wb, 0)){
     
    157151     *
    158152     */
    159     private Workbook getWorkBook( tabbed ,flash) {
     153    private Workbook getWorkBook( tabbed ) {
    160154        def wb
    161155        if (tabbed instanceof File) {
    162               wb = WorkbookFactory.create(new FileInputStream(tabbed))
     156            wb = WorkbookFactory.create(new FileInputStream(tabbed))
    163157        }
    164158        else {
Note: See TracChangeset for help on using the changeset viewer.