Ignore:
Timestamp:
Apr 14, 2011, 10:57:50 PM (13 years ago)
Author:
gav
Message:

Refactor assetTreeCompact to use includes and controller action instead of direct render call in gsp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/features/grailsUpgrade/grails-app/controllers/AssetDetailedController.groovy

    r749 r885  
    4242        def s = assetTreeService.buildAssetTree(params, session)
    4343        render s
     44    }
     45
     46    /**
     47    * Build and return the compact asset tree response.
     48    */
     49    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager', 'ROLE_AssetUser'])
     50    def assetTreeCompact = {
     51        def assetInstance = Asset.read(params.id)
     52        if(!assetInstance) {
     53            render g.message(code: 'default.not.found', args: ['Asset',params.id])
     54            return
     55        }
     56
     57        render(template:"/shared/assetTreeCompact", model:['assetInstance':assetInstance])
    4458    }
    4559
Note: See TracChangeset for help on using the changeset viewer.