Ignore:
Timestamp:
May 27, 2010, 9:24:43 PM (14 years ago)
Author:
gav
Message:

Add InventoryItemService savePicture(), part 2.
Add some more comments, another error code and ensure the inputStream gets closed.
Add gnuMims logo as an example picture to the demo inventory items.

File:
1 edited

Legend:

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

    r534 r549  
    1313    def dateUtilService
    1414    def appConfigService
     15    def inventoryItemService
    1516    def assignedGroupService
    1617    def assignedPersonService
     18
     19    def grailsApplication
    1720
    1821/*******************************************
     
    12031206        def inventoryItemInstance
    12041207
     1208        def pictureResource = grailsApplication.mainContext.getResource('images/logo.png')
     1209
    12051210        //InventoryItem #1
    12061211        inventoryItemInstance = new InventoryItem(inventoryGroup: InventoryGroup.get(1),
     
    12131218                                                                                    reorderPoint: 0)
    12141219        saveAndTest(inventoryItemInstance)
     1220        inventoryItemService.savePicture(inventoryItemInstance, pictureResource)
    12151221
    12161222        //InventoryItem #2
     
    12251231                                                                                    reorderPoint: 0)
    12261232        saveAndTest(inventoryItemInstance)
     1233        inventoryItemService.savePicture(inventoryItemInstance, pictureResource)
    12271234
    12281235        //InventoryItem #3
     
    12361243                                                                                    reorderPoint: 2)
    12371244        saveAndTest(inventoryItemInstance)
     1245        inventoryItemService.savePicture(inventoryItemInstance, pictureResource)
    12381246
    12391247        //InventoryItem #4
     
    12471255                                                                                    reorderPoint: 0)
    12481256        saveAndTest(inventoryItemInstance)
     1257        inventoryItemService.savePicture(inventoryItemInstance, pictureResource)
    12491258
    12501259        //InventoryItem #5
     
    12581267                                                                                    reorderPoint: 2)
    12591268        saveAndTest(inventoryItemInstance)
     1269        inventoryItemService.savePicture(inventoryItemInstance, pictureResource)
    12601270    }
    12611271
Note: See TracChangeset for help on using the changeset viewer.