Ignore:
Timestamp:
Oct 6, 2010, 4:23:46 AM (14 years ago)
Author:
gav
Message:

Add admin feature to create recommended extended attributes for assets and level 1 assetSubItems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AppCoreController.groovy

    r687 r688  
    99
    1010    def authService
     11    def assetService
    1112    def appConfigService
    1213    def createDataService
    1314    def searchableService
     15    def assetSubItemService
    1416    def createBulkDataService
    1517
     
    269271    }
    270272
     273    /**
     274    * Allow admin to create recommended extended attributes for assets.
     275    */
     276    @Secured(['ROLE_AppAdmin'])
     277    def createRecommendedAssetExtendedAttributes = {
     278        def result = assetService.createRecommendedExtendedAttributes()
     279        if(!result.error) {
     280            flash.message = g.message(code:"default.create.success", args:["Extended attributes created", ''])
     281            redirect(action: appAdmin)
     282            return
     283        }
     284
     285        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
     286        redirect(action: appAdmin)
     287    }
     288
     289    /**
     290    * Allow admin to create recommended extended attributes for level 1 assetSubItems.
     291    */
     292    @Secured(['ROLE_AppAdmin'])
     293    def createRecommendedAssetSubItemExtendedAttributes = {
     294        def result = assetSubItemService.createRecommendedExtendedAttributes()
     295        if(!result.error) {
     296            flash.message = g.message(code:"default.create.success", args:["Extended attributes created", ''])
     297            redirect(action: appAdmin)
     298            return
     299        }
     300
     301        flash.errorMessage = g.message(code: result.error.code, args: result.error.args)
     302        redirect(action: appAdmin)
     303    }
     304
    271305} // end of class.
Note: See TracChangeset for help on using the changeset viewer.