Ignore:
Timestamp:
Jan 14, 2010, 10:51:03 PM (14 years ago)
Author:
gav
Message:

Refactor classes for asset tree refinement.
Regenerate views and controllers to suite.

Location:
trunk/grails-app/domain
Files:
4 added
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/Asset.groovy

    r180 r268  
    11class Asset {
    22
    3     SystemSection systemSection
    4     AssetType assetType
     3    Section section
    54
    65    String name
    76    String description = ""
    8     String costCode = ""
    97    boolean isActive = true
    108
    11     static hasMany = [maintenanceActions: MaintenanceAction,
     9    static hasMany = [assetSubItems: AssetSubItem,
     10                                    maintenanceActions: MaintenanceAction,
    1211                                    assetExtendedAttributes: AssetExtendedAttribute]
    1312
    14     static belongsTo = [SystemSection, AssetType]
     13    static belongsTo = [Section]
    1514
    1615    static constraints = {
    17         name(unique:true, blank:false)
     16        name(maxSize:50, unique:true, blank:false)
     17        description(maxSize:100)
     18        isActive()
     19        section()
    1820    }
    1921
  • trunk/grails-app/domain/AssetExtendedAttribute.groovy

    r124 r268  
    11class AssetExtendedAttribute {
    22
     3    ExtendedAttributeType extendedAttributeType
    34    Asset asset
    4     AssetExtendedAttributeType assetExtendedAttributeType
    55
    66    String value
     
    1111    static belongsTo = [Asset]
    1212
    13 //     static constraints = {
    14 //
    15 //     }
     13    static constraints = {
     14        value(maxSize:100)
     15        isActive()
     16    }
    1617
    1718    String toString() {
    18         "${assetExtendedAttributeType.name}: ${this.value}"
     19        "${extendedAttributeType.name}: ${this.value}"
    1920    }
    2021}
  • trunk/grails-app/domain/AssetSubItem.groovy

    r267 r268  
    1 class AssetType {
     1class AssetSubItem {
     2
     3    Asset asset
     4    AssetSubItem parentItem
    25
    36    String name
    47    String description = ""
    5     String costCode = ""
    68    boolean isActive = true
    79
    8     static hasMany = [assets: Asset,
    9                                     assemblies: Assembly,
    10                                     maintenanceActions: MaintenanceAction]
     10    static hasMany = [subItems: AssetSubItem,
     11                                maintenanceActions: MaintenanceAction,
     12                                assetSubItemExtendedAttributes: AssetSubItemExtendedAttribute]
    1113
    12 //     static belongsTo = []
     14    static belongsTo = [Asset, AssetSubItem]
    1315
    14 //     static constraints = {
    15 //
    16 //     }
     16    static constraints = {
     17        name(maxSize:50, blank:false)
     18        description(maxSize:100)
     19        isActive()
     20        asset(nullable:true)
     21        parentItem(nullable:true)
     22    }
    1723
    1824    String toString() {
  • trunk/grails-app/domain/Department.groovy

    r164 r268  
    33    String name
    44    String description = ""
    5     String costCode = ""
    65    boolean isActive = true
    76
    8     static hasMany = [systemSections: SystemSection, persons: Person]
     7    static hasMany = [sections: Section,
     8                                departmentExtendedAttributes: DepartmentExtendedAttribute,
     9                                persons: Person]
    910
    1011//     static belongsTo = []
    1112
    1213    static constraints = {
    13         name()
    14         description()
    15         costCode()
     14        name(maxSize:50, unique:true, blank:false)
     15        description(maxSize:100)
    1616        isActive()
    1717    }
  • trunk/grails-app/domain/ExtendedAttributeType.groovy

    r267 r268  
    1 class AssetExtendedAttributeType {
     1class ExtendedAttributeType {
    22
    33    String name
     
    55    boolean isActive = true
    66
    7     static hasMany = [assetExtendedAttributes: AssetExtendedAttribute]
     7//     static hasMany = []
    88
    99//     static belongsTo = []
    1010
    11 //     static constraints = {
    12 //
    13 //     }
     11    static constraints = {
     12        name(maxSize:50,unique:true,blank:false)
     13        description(maxSize:100)
     14        isActive()
     15    }
    1416
    1517    String toString() {
  • trunk/grails-app/domain/MaintenanceAction.groovy

    r146 r268  
    33    TaskProcedure taskProcedure
    44    MaintenancePolicy maintenancePolicy
    5     SystemSection systemSection
     5    Section section
    66    Asset asset
    7     AssetType assetType
    8     Assembly assembly
    9     SubAssembly subAssembly
    10     ComponentItem componentItem
     7    AssetSubItem assetSubItem
    118
    129    String description
     
    2017
    2118    static constraints = {
     19        section(nullable:true)
     20        asset(nullable:true)
     21        assetSubItem(nullable:true)
    2222        maintenancePolicy(nullable:true)
    23         systemSection(nullable:true)
    24         asset(nullable:true)
    25         assetType(nullable:true)
    26         assembly(nullable:true)
    27         subAssembly(nullable:true)
    28         componentItem(nullable:true)
    2923        procedureStepNumber(nullable:true)
     24        description()
     25        reasoning()
     26        isActive()
    3027    }
    3128
  • trunk/grails-app/domain/MaintenancePolicy.groovy

    r122 r268  
    55    boolean isActive = true
    66
    7     static hasMany = [maintenanceActions: MaintenanceAction]
     7//     static hasMany = [maintenanceActions: MaintenanceAction]
    88
    99//     static belongsTo = []
    1010
    11 //     static constraints = {
    12 //     }
     11    static constraints = {
     12        name(maxSize:50, unique:true, blank:false)
     13        description(maxSize:100)
     14        isActive()
     15    }
    1316
    1417    String toString() {
  • trunk/grails-app/domain/Section.groovy

    r262 r268  
    1 class SystemSection {
     1class Section {
    22
    33    Site site
     
    66    String name
    77    String description = ""
    8     String costCode = ""
    98    boolean isActive = true
    109
    11     static hasMany = [assets: Asset, maintenanceActions: MaintenanceAction]
     10    static hasMany = [assets: Asset,
     11                                maintenanceActions: MaintenanceAction,
     12                                sectionExtendedAttributes: SectionExtendedAttribute]
    1213
    1314    static belongsTo = [Site]
    1415
    15 //     static constraints = {
    16 //
    17 //     }
     16    static constraints = {
     17        name(maxSize:50, unique:true, blank:false)
     18        description(maxSize:100)
     19        isActive()
     20    }
    1821
    1922    String toString() {
  • trunk/grails-app/domain/Site.groovy

    r163 r268  
    33    String name
    44    String description = ""
    5     String costCode = ""
    65    Boolean isActive = true
    76
    8     static hasMany = [inventoryStores: InventoryStore, systemSections: SystemSection]
     7//     static hasMany = [inventoryStores: InventoryStore, systemSections: SystemSection]
     8    static hasMany = [sections: Section,
     9                                siteExtendedAttributes: SiteExtendedAttribute]
    910
    1011//     static belongsTo = []
    1112
    1213    static constraints = {
    13         name(maxSize:50,unique:true,blank:false)
     14        name(maxSize:50, unique:true, blank:false)
    1415        description(maxSize:100)
     16        isActive()
    1517    }
    1618
Note: See TracChangeset for help on using the changeset viewer.