Ignore:
Timestamp:
Feb 8, 2011, 11:00:27 PM (13 years ago)
Author:
gav
Message:

Svn merge -r752:r797 branches/features/taskProcedureRework into trunk/.

Location:
trunk/grails-app/domain
Files:
2 edited
1 copied

Legend:

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

    r268 r798  
    88
    99    String description
    10     String reasoning = ""
     10    String pageRef = ""
    1111    Integer procedureStepNumber
    12     boolean isActive = true
     12
     13    Boolean toBeDeleted
     14    Boolean isNew
     15    static transients = [ 'toBeDeleted', 'isNew' ]
    1316
    1417//     static hasMany = []
    1518
    16 //     static belongsTo = []
     19    static belongsTo = [TaskProcedure]
    1720
    1821    static constraints = {
     
    2225        maintenancePolicy(nullable:true)
    2326        procedureStepNumber(nullable:true)
    24         description()
    25         reasoning()
    26         isActive()
     27        description(blank:false,maxSize:100)
     28        pageRef(maxSize:100)
    2729    }
    2830
  • trunk/grails-app/domain/TaskProcedure.groovy

    r131 r798  
     1import org.apache.commons.collections.list.LazyList
     2import org.apache.commons.collections.FactoryUtils
     3
    14class TaskProcedure {
    25
    3     String name
    4     String description = ""
    5     Boolean isActive = true
     6    Task linkedTask
     7    Person createdBy
     8    Person lastUpdatedBy
     9    Date dateCreated = new Date() // autoTimestamp
     10    Date lastUpdated = new Date() // autoTimestamp
    611
    7     static hasMany = [tasks: Task, maintenanceActions: MaintenanceAction]
     12    def getDescription() { linkedTask.description }
     13    def getAsset() { linkedTask.primaryAsset }
     14
     15    List maintenanceActions = new ArrayList()
     16    List documentReferences = new ArrayList()
     17
     18    static hasMany = [tasks: Task,
     19                                    maintenanceActions: MaintenanceAction,
     20                                    documentReferences: DocumentReference]
     21
     22    def getMaintenanceActionLazyList() {
     23        return LazyList.decorate(maintenanceActions, FactoryUtils.instantiateFactory(MaintenanceAction.class))
     24    }
     25
     26    def getDocumentReferenceLazyList() {
     27        return LazyList.decorate(documentReferences, FactoryUtils.instantiateFactory(DocumentReference.class))
     28    }
     29
     30    static mappedBy = [tasks:"taskProcedure"]
     31
     32    static mapping = {
     33        maintenanceActions cascade:"all-delete-orphan"
     34        documentReferences cascade:"all-delete-orphan"
     35    }
    836
    937//     static belongsTo = []
    1038
    1139    static constraints = {
    12         name(maxSize:75,unique:true,blank:false)
    13         description(maxSize:100)
    1440    }
    1541
    1642    String toString() {
    17         "${this.name}"
     43        "${this.id}"
    1844    }
    1945}
Note: See TracChangeset for help on using the changeset viewer.