Changeset 506 for trunk/grails-app/services
- Timestamp:
- Apr 23, 2010, 12:29:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/CreateDataService.groovy
r447 r506 46 46 47 47 if(appConfigService.exists("baseDataCreated")) { 48 log. error "Base data has already been created, will NOT recreate."48 log.info "Base data previously created." 49 49 return false 50 50 } 51 51 52 log.info "Creating base data. .."52 log.info "Creating base data." 53 53 54 54 // Person and Utils 55 55 createBaseAuthorities() 56 createBasePersonGroupTypes() 56 57 createBasePersonGroups() 57 58 createBaseDefinitions() … … 211 212 } 212 213 214 void createBasePersonGroupTypes() { 215 216 //PersonGroupType. 217 def personGroupTypeInstance 218 personGroupTypeInstance = new PersonGroupType(name:"Team") 219 saveAndTest(personGroupTypeInstance) 220 personGroupTypeInstance = new PersonGroupType(name:"Contractor") 221 saveAndTest(personGroupTypeInstance) 222 personGroupTypeInstance = new PersonGroupType(name:"Project Team") 223 saveAndTest(personGroupTypeInstance) 224 } 225 213 226 void createBasePersonGroups() { 214 //TypeOfPersonGroup215 def personGroupTypeInstance216 personGroupTypeInstance = new PersonGroupType(name:"Team")217 saveAndTest(personGroupTypeInstance)218 personGroupTypeInstance = new PersonGroupType(name:"Contractor")219 saveAndTest(personGroupTypeInstance)220 personGroupTypeInstance = new PersonGroupType(name:"ProjectTeam")221 saveAndTest(personGroupTypeInstance)222 227 223 228 //PersonGroup 224 229 def personGroupInstance 225 226 name:"Electrical")230 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1), 231 name:"Electrical - General") 227 232 saveAndTest(personGroupInstance) 228 229 name:"Mechanical")233 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1), 234 name:"Mechanical - General") 230 235 saveAndTest(personGroupInstance) 231 232 name:"Production")236 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(1), 237 name:"Production") 233 238 saveAndTest(personGroupInstance) 234 235 name:"Kewl AirCon Guys")239 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(2), 240 name:"AirCon Contractor") 236 241 saveAndTest(personGroupInstance) 237 238 name:"gnuMims")242 personGroupInstance = new PersonGroup(personGroupType:PersonGroupType.get(3), 243 name:"gnuMims") 239 244 saveAndTest(personGroupInstance) 240 245 }
Note: See TracChangeset
for help on using the changeset viewer.