Ignore:
Timestamp:
Mar 7, 2009, 4:32:03 AM (16 years ago)
Author:
gav
Message:

Add domains Entry, Task, Modification with task rewrites and associated Types/Status? etc.
Generate controllers and views.
Update Bootstrap.groovy and Person.groovy to suite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy

    r64 r66  
    8383        personInstance.addToAuthorities(Authority.get(1))
    8484        personInstance.addToAuthorities(Authority.get(2))
    85         personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims"))
     85        personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims"))
    8686
    8787        personInstance = new Person(loginName:"user",
     
    9292        BootStrapSaveAndTest(personInstance)
    9393        personInstance.addToAuthorities(Authority.get(2))
    94         personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
     94        personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
    9595
    9696        personInstance = new Person(loginName:"craig",
     
    101101        BootStrapSaveAndTest(personInstance)
    102102        personInstance.addToAuthorities(Authority.get(2))
    103         personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
     103        personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
    104104
    105105        personInstance = new Person(loginName:"joe",
     
    110110        BootStrapSaveAndTest(personInstance)
    111111        personInstance.addToAuthorities(Authority.get(2))
    112         personInstance.addToPersonGroups(PersonGroup.findByName("Mechanical"))
     112        personInstance.addToPersonGroups(PersonGroup.findByName("Mechanical"))
    113113
    114114        personInstance = new Person(loginName:"mann",
     
    119119        BootStrapSaveAndTest(personInstance)
    120120        personInstance.addToAuthorities(Authority.get(2))
    121         personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
    122                
     121        personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
     122
     123        //TaskStatus
     124        def taskStatusInstance
     125   
     126        taskStatusInstance = new TaskStatus(name:"Not Started")
     127        BootStrapSaveAndTest(taskStatusInstance)
     128
     129        taskStatusInstance = new TaskStatus(name:"In Progress")
     130        BootStrapSaveAndTest(taskStatusInstance)
     131
     132        taskStatusInstance = new TaskStatus(name:"Completed")
     133        BootStrapSaveAndTest(taskStatusInstance)
     134
    123135        //TaskGroup
    124 //         new TaskGroup(name:"Engineering",
    125 //                       description:"Engineering task group").save()
    126 //         new TaskGroup(name:"Production",
    127 //                       description:"Production task group").save()
    128 //         new TaskGroup(name:"NewProject(s)",
    129 //                       description:" ").save()
    130                      
    131        
     136        def taskGroupInstance
     137
     138        taskGroupInstance = new TaskGroup(name:"Engineering Activites",
     139                      description:"Engineering daily activities")
     140        BootStrapSaveAndTest(taskGroupInstance)
     141
     142        taskGroupInstance = new TaskGroup(name:"Production Activites",
     143                      description:"Production daily activities")
     144        BootStrapSaveAndTest(taskGroupInstance)
     145
     146        taskGroupInstance = new TaskGroup(name:"NewProject(s)",
     147                      description:" ")
     148        BootStrapSaveAndTest(taskGroupInstance)
     149
    132150        //Task
    133 //         new Task(taskGroup:TaskGroup.findByName("Engineering"),
    134 //                  leadPerson:Person.get(3),
    135 //                  name:"Check specific level sensor",
    136 //                  description:"Has been noted as problematic, try recallibrating",
    137 //                  scheduledDate: new Date(),
    138 //                  targetDate: new Date() ).save()
    139 //         new Task(taskGroup:TaskGroup.findByName("Production"),
    140 //                  leadPerson:Person.get(5),
    141 //                  name:"Production Report",
    142 //                  description:"Production report for specific production run or shift",
    143 //                  scheduledDate: new Date(),
    144 //                  targetDate: new Date() ).save()
    145 //         new Task(taskGroup:TaskGroup.findByName("NewProject(s)"),
    146 //                  leadPerson:Person.get(1),
    147 //                  name:"Make killer CMMS app",
    148 //                  description:"Use Grails and get a move on!",
    149 //                  scheduledDate: new Date(),
    150 //                  targetDate: new Date() ).save()
     151        def taskInstance
     152
     153        taskInstance = new Task(taskGroup:TaskGroup.findByName("Engineering Activites"),
     154                 taskStatus:TaskStatus.findByName("Not Started"),
     155                 leadPerson:Person.get(3),
     156                 description:"Check specific level sensor",
     157                 comment:"Has been noted as problematic, try recallibrating")
     158        BootStrapSaveAndTest(taskInstance)
     159        taskInstance.addToAssignedPersons(Person.get(1))
     160        taskInstance.addToAssignedPersons(Person.get(2))
     161
     162        taskInstance = new Task(taskGroup:TaskGroup.findByName("Production Activites"),
     163                 taskStatus:TaskStatus.findByName("Not Started"),
     164                 leadPerson:Person.get(5),
     165                 description:"Production Report",
     166                 comment:"Production report for specific production run or shift")
     167        BootStrapSaveAndTest(taskInstance)
     168
     169        taskInstance = new Task(taskGroup:TaskGroup.findByName("NewProject(s)"),
     170                 taskStatus:TaskStatus.findByName("Not Started"),
     171                 leadPerson:Person.get(1),
     172                 description:"Make killer CMMS app",
     173                 comment:"Use Grails and get a move on!")
     174        BootStrapSaveAndTest(taskInstance)
    151175
    152176        //EntryType
    153 //         new EntryType(name:"Fault").save()
    154 //         new EntryType(name:"WorkDone").save()
    155 //         new EntryType(name:"Production Report").save()
     177        def entryTypeInstance
     178
     179        entryTypeInstance = new EntryType(name:"Fault")
     180        BootStrapSaveAndTest(entryTypeInstance)
     181
     182        entryTypeInstance = new EntryType(name:"WorkDone")
     183        BootStrapSaveAndTest(entryTypeInstance)
     184
     185        entryTypeInstance = new EntryType(name:"Production Report")
     186        BootStrapSaveAndTest(entryTypeInstance)
     187
     188        entryTypeInstance = new EntryType(name:"Work Request")
     189        BootStrapSaveAndTest(entryTypeInstance)
    156190
    157191        //ModificationType
    158 //         new ModificationType(name:"Created").save()
    159 //         new ModificationType(name:"Completed").save()
    160 //         new ModificationType(name:"Closed").save()
    161 //         new ModificationType(name:"Altered").save()
    162 //         new ModificationType(name:"TargetDateModified").save()
    163 //         new ModificationType(name:"ScheduledDateModified").save()
    164 //         new ModificationType(name:"DescriptionModified").save()
    165 //         new ModificationType(name:"AssignedToModified").save()
    166 //         new ModificationType(name:"NameModified").save()
     192        def modificationTypeInstance
     193        modificationTypeInstance = new ModificationType(name:"Created").save()
     194        modificationTypeInstance = new ModificationType(name:"Completed").save()
     195        modificationTypeInstance = new ModificationType(name:"Closed").save()
     196        modificationTypeInstance = new ModificationType(name:"Altered").save()
     197        modificationTypeInstance = new ModificationType(name:"TargetDateModified").save()
     198        modificationTypeInstance = new ModificationType(name:"ScheduledDateModified").save()
     199        modificationTypeInstance = new ModificationType(name:"DescriptionModified").save()
     200        modificationTypeInstance = new ModificationType(name:"AssignedToModified").save()
     201        modificationTypeInstance = new ModificationType(name:"NameModified").save()
    167202       
    168203        if(BootStrapDemoDataSuccessful) {
Note: See TracChangeset for help on using the changeset viewer.