- Timestamp:
- Feb 24, 2010, 4:01:05 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r412 r414 103 103 warn "grails.app.service" 104 104 warn "grails.app.controller" 105 info "grails.app.service. CsvService"105 info "grails.app.service.AssetCsvService" 106 106 break 107 107 } -
trunk/grails-app/controllers/AssetDetailedController.groovy
r403 r414 6 6 class AssetDetailedController extends BaseController { 7 7 8 def csvService8 def assetCsvService 9 9 def filterService 10 10 def exportService … … 61 61 */ 62 62 def importAssetTreeSave = { 63 def result = csvService.importAssetTree(request)63 def result = assetCsvService.importAssetTree(request) 64 64 65 65 if(!result.error) … … 80 80 response.contentType = ConfigurationHolder.config.grails.mime.types["csv"] 81 81 response.setHeader("Content-disposition", "attachment; filename=AssetTreeTemplate.csv") 82 def s = csvService.buildAssetTreeTemplate()82 def s = assetCsvService.buildAssetTreeTemplate() 83 83 render s 84 84 } … … 90 90 response.contentType = ConfigurationHolder.config.grails.mime.types["csv"] 91 91 response.setHeader("Content-disposition", "attachment; filename=AssetTreeTestFile.csv") 92 def s = csvService.buildAssetTreeTest()92 def s = assetCsvService.buildAssetTreeTest() 93 93 render s 94 94 } … … 104 104 response.contentType = ConfigurationHolder.config.grails.mime.types["csv"] 105 105 response.setHeader("Content-disposition", "attachment; filename=AssetTree.csv") 106 def s = csvService.buildAssetTree(assetList)106 def s = assetCsvService.buildAssetTree(assetList) 107 107 render s 108 108 } -
trunk/grails-app/i18n/messages.properties
r405 r414 4 4 asset.tree.import.success=Asset tree imported. 5 5 asset.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 7 inventory.import.success=Inventory imported. 8 inventory.import.failure=Could not create inventory from supplied file, failed on line {0}. 9 9 10 10 asset.copy.method.required=Please select a copy method for sub items. … … 138 138 default.create.failure={0} could not be created. 139 139 default.optimistic.locking.failure=Another user has updated this item while you were editing, please check the updated values. 140 default.file.over.max.size=Supplied file is greater than max size of {0} {1}. 141 default.file.not.supplied=No file supplied. 142 default.file.no.header=The supplied file does not have the correct header lines, please see the template file. 140 143 141 144 default.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 7 7 * Requires the opencsv jar to be available which is included in the grails-export plugin. 8 8 */ 9 class CsvService {9 class AssetCsvService { 10 10 11 11 boolean transactional = false … … 36 36 37 37 if(!multiPartFile || multiPartFile.isEmpty()) 38 return fail(code: " asset.tree.import.file.not.supplied")38 return fail(code: "default.file.not.supplied") 39 39 40 40 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"]) 42 42 43 43 def columnIndex = 0 … … 55 55 log.error "Required: " + templateHeaderLine1.toString() 56 56 log.error "Supplied: " + line.toString() 57 return fail(code: " asset.tree.import.no.header")57 return fail(code: "default.file.no.header") 58 58 } 59 59 … … 67 67 log.error "Required: " + templateHeaderLine2.toString() 68 68 log.error "Supplied: " + line.toString() 69 return fail(code: " asset.tree.import.no.header")69 return fail(code: "default.file.no.header") 70 70 } 71 71
Note: See TracChangeset
for help on using the changeset viewer.