Ignore:
Timestamp:
Mar 2, 2010, 9:12:24 AM (10 years ago)
Author:
gav
Message:

Add a logFileLink to the import error messages.
Small adjustment to asset import redirect.

File:
1 edited

Legend:

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

    r414 r421  
    1010
    1111    boolean transactional = false
     12
     13    def g = new org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib()
    1214
    1315    /**
     
    2224            def kByteMultiplier = 1000
    2325            def fileMaxSize = 500 * kByteMultiplier
     26            def logFileLink = g.link(controller: "appCore", action: "appLog") {"log"}
    2427
    2528            def multiPartFile = request.getFile('file')
     
    155158                    if(!siteInstance.save()) {
    156159                        log.error "Failed to create site on line: " + column.name + "(" + lineNumber + ")"
    157                         return fail(code: "asset.tree.import.failure", args: [lineNumber])
     160                        return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink])
    158161                    }
    159162                }
     
    174177                    if(!departmentInstance.save()) {
    175178                        log.error "Failed to create department on line: " + column.name + "(" + lineNumber + ")"
    176                         return fail(code: "asset.tree.import.failure", args: [lineNumber])
     179                        return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink])
    177180                    }
    178181                }
     
    194197                    if(!sectionInstance.save()) {
    195198                        log.error "Failed to create section on line: " + column.name + "(" + lineNumber + ")"
    196                         return fail(code: "asset.tree.import.failure", args: [lineNumber])
     199                        return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink])
    197200                    }
    198201                }
     
    213216                    if(!assetInstance.save()) {
    214217                        log.error "Failed to create asset on line: " + column.name + "(" + lineNumber + ")"
    215                         return fail(code: "asset.tree.import.failure", args: [lineNumber])
     218                        return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink])
    216219                    }
    217220                }
     
    231234                    if(!assetInstance.save()) {
    232235                        log.error "Failed to create assetSubItem on line: " + column.name + "(" + lineNumber + ")"
    233                         return fail(code: "asset.tree.import.failure", args: [lineNumber])
     236                        return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink])
    234237                    }
    235238                }
     
    250253                        if(!assetSubItemInstance.save()) {
    251254                            log.error "Failed to create assetSubItem on line: " + column.name + "(" + lineNumber + ")"
    252                             return fail(code: "asset.tree.import.failure", args: [lineNumber])
     255                            return fail(code: "asset.tree.import.failure", args: [lineNumber, logFileLink])
    253256                        }
    254257                    }
Note: See TracChangeset for help on using the changeset viewer.