Changeset 87

Show
Ignore:
Timestamp:
25-01-11 16:30:47 (3 years ago)
Author:
work@…
Message:

- refactored the templateEditor and moved it into gdt
- gdt to 0.0.3

Location:
gdt/trunk
Files:
47 added
2 modified

Legend:

Unmodified
Added
Removed
  • gdt/trunk/GdtGrailsPlugin.groovy

    r86 r87  
    2121 
    2222class GdtGrailsPlugin { 
    23     def version                 = "0.0.2" 
     23    def version                 = "0.0.3" 
    2424    def grailsVersion   = "1.3.4 > *" 
    25 //    def dependsOn             = [ajaxflow: "0.1.18 > *"] 
    26     def dependsOn               = [:] 
     25    def dependsOn               = [ajaxflow: "0.1.18 > *"] 
     26//    def dependsOn             = [:] 
    2727    def pluginExcludes  = [ 
    2828            "grails-app/views/error.gsp" 
  • gdt/trunk/grails-app/domain/nl/grails/plugins/gdt/Template.groovy

    r82 r87  
    2020 */ 
    2121class Template extends Identity { 
     22        def gdtService 
    2223 
    2324        /** The name of the template */ 
     
    3536        Long owner_id 
    3637 
    37         static transients = [ "identifier", "iterator", "maximumIdentity", "owner" ] 
     38        static transients = [ "identifier", "iterator", "maximumIdentity", "owner", "gdtService" ] 
    3839 
    3940        /** The template fields which are the members of this template. This is a List to preserve the field order */ 
     
    227228         */ 
    228229        def numUses() { 
    229                 def grailsApplication = ApplicationHolder.application 
    230230                def elements = [] 
    231231 
    232                 // iterate through all domain classes 
    233                 grailsApplication.getArtefacts("Domain").each { 
    234                         def myInstance = it.clazz 
    235  
    236                         // is this domain class an extention of TemplateEntity, and does 
    237                         // the entity match? 
    238                         if (myInstance.properties.superclass.toString() =~ 'TemplateEntity' && myInstance.equals(this.entity)) { 
    239                                 // this domain class uses domain templates, check 
    240                                 // if this template is used by this domain class 
    241                                 elements = myInstance.findAllByTemplate( this ) 
     232                // iterate through domain classes that use the domain templates 
     233                gdtService.getTemplateEntities().each { 
     234                        if (it.instance.equals(this.entity)) { 
     235                                elements = it.instance.findAllByTemplate( this ) 
    242236                        } 
    243237                }