Changeset 414


Ignore:
Timestamp:
Feb 24, 2010, 4:01:05 PM (15 years ago)
Author:
gav
Message:

Move CsvService to AssetCsvService in preparation for other CSV services.

Location:
trunk/grails-app
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/Config.groovy

    r412 r414  
    103103            warn "grails.app.service"
    104104            warn "grails.app.controller"
    105             info "grails.app.service.CsvService"
     105            info "grails.app.service.AssetCsvService"
    106106            break
    107107    }
  • trunk/grails-app/controllers/AssetDetailedController.groovy

    r403 r414  
    66class AssetDetailedController extends BaseController {
    77
    8     def csvService
     8    def assetCsvService
    99    def filterService
    1010    def exportService
     
    6161    */
    6262    def importAssetTreeSave = {
    63         def result = csvService.importAssetTree(request)
     63        def result = assetCsvService.importAssetTree(request)
    6464
    6565        if(!result.error)
     
    8080        response.contentType = ConfigurationHolder.config.grails.mime.types["csv"]
    8181        response.setHeader("Content-disposition", "attachment; filename=AssetTreeTemplate.csv")
    82         def s = csvService.buildAssetTreeTemplate()
     82        def s = assetCsvService.buildAssetTreeTemplate()
    8383        render s
    8484    }
     
    9090        response.contentType = ConfigurationHolder.config.grails.mime.types["csv"]
    9191        response.setHeader("Content-disposition", "attachment; filename=AssetTreeTestFile.csv")
    92         def s = csvService.buildAssetTreeTest()
     92        def s = assetCsvService.buildAssetTreeTest()
    9393        render s
    9494    }
     
    104104        response.contentType = ConfigurationHolder.config.grails.mime.types["csv"]
    105105        response.setHeader("Content-disposition", "attachment; filename=AssetTree.csv")
    106         def s = csvService.buildAssetTree(assetList)
     106        def s = assetCsvService.buildAssetTree(assetList)
    107107        render s
    108108    }
  • trunk/grails-app/i18n/messages.properties

    r405 r414  
    44asset.tree.import.success=Asset tree imported.
    55asset.tree.import.failure=Could not create asset tree from supplied file, failed on line {0}.
    6 asset.tree.import.file.over.max.size=Supplied file is greater than max size of {0} {1}.
    7 asset.tree.import.file.not.supplied=No file supplied.
    8 asset.tree.import.no.header=The supplied file does not have the correct header lines, please see the template file.
     6
     7inventory.import.success=Inventory imported.
     8inventory.import.failure=Could not create inventory from supplied file, failed on line {0}.
    99
    1010asset.copy.method.required=Please select a copy method for sub items.
     
    138138default.create.failure={0} could not be created.
    139139default.optimistic.locking.failure=Another user has updated this item while you were editing, please check the updated values.
     140default.file.over.max.size=Supplied file is greater than max size of {0} {1}.
     141default.file.not.supplied=No file supplied.
     142default.file.no.header=The supplied file does not have the correct header lines, please see the template file.
    140143
    141144default.doesnt.match.message=Property [{0}] of class [{1}] with value [{2}] does not match the required pattern [{3}]
  • trunk/grails-app/services/AssetCsvService.groovy

    r409 r414  
    77 * Requires the opencsv jar to be available which is included in the grails-export plugin.
    88 */
    9 class CsvService {
     9class AssetCsvService {
    1010
    1111    boolean transactional = false
     
    3636
    3737            if(!multiPartFile || multiPartFile.isEmpty())
    38                 return fail(code: "asset.tree.import.file.not.supplied")
     38                return fail(code: "default.file.not.supplied")
    3939
    4040            if (multiPartFile.getSize() > fileMaxSize)
    41                 return fail(code: "asset.tree.import.file.over.max.size", args: [fileMaxSize/kByteMultiplier, "kB"])
     41                return fail(code: "default.file.over.max.size", args: [fileMaxSize/kByteMultiplier, "kB"])
    4242
    4343            def columnIndex = 0
     
    5555                log.error "Required: " + templateHeaderLine1.toString()
    5656                log.error "Supplied: " + line.toString()
    57                 return fail(code: "asset.tree.import.no.header")
     57                return fail(code: "default.file.no.header")
    5858            }
    5959
     
    6767                log.error "Required: " + templateHeaderLine2.toString()
    6868                log.error "Supplied: " + line.toString()
    69                 return fail(code: "asset.tree.import.no.header")
     69                return fail(code: "default.file.no.header")
    7070            }
    7171
Note: See TracChangeset for help on using the changeset viewer.