Changeset 118
- Timestamp:
- Apr 17, 2009, 12:17:55 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 62 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r117 r118 32 32 { 33 33 println "BootStrapping demo data..." 34 34 35 /******************* 36 START OF TASK 37 38 *******************/ 39 35 40 //TypeOfPersonGroup 36 41 def personGroupTypeInstance … … 346 351 BootStrapSaveAndTest(assignedPersonInstance) 347 352 353 /******************* 354 START OF INVENTORY 355 356 *******************/ 357 348 358 //Site 349 359 def siteInstance … … 354 364 siteInstance = new Site(name: "Jasper Street Depot") 355 365 BootStrapSaveAndTest(siteInstance) 356 357 //Asset358 def assetInstance359 360 assetInstance = new Asset(name: "RockCrusher1")361 BootStrapSaveAndTest(assetInstance)362 363 366 364 367 //InventoryStore … … 513 516 BootStrapSaveAndTest(storedItemInstance) 514 517 518 /******************* 519 START OF ASSET 520 521 *******************/ 522 523 //Frequency 524 def frequencyInstance 525 526 //Frequency #1 527 frequencyInstance = new Frequency(frequency: "Daily") 528 BootStrapSaveAndTest(frequencyInstance) 529 530 //Frequency #2 531 frequencyInstance = new Frequency(frequency: "Monthly") 532 BootStrapSaveAndTest(frequencyInstance) 533 534 //Frequency #3 535 frequencyInstance = new Frequency(frequency: "Quarterly") 536 BootStrapSaveAndTest(frequencyInstance) 537 538 //Frequency #4 539 frequencyInstance = new Frequency(frequency: "Annually") 540 BootStrapSaveAndTest(frequencyInstance) 541 542 //LifePlan 543 def lifeplanInstance 544 545 lifeplanInstance = new LifePlan(name: "Initial Plan", 546 timeInHours: 1, 547 maintenanceAction: "Visual inspection") 548 BootStrapSaveAndTest(lifeplanInstance) 549 550 //Form 551 def formInstance 552 553 formInstance = new Form(name: "Form 1") 554 BootStrapSaveAndTest(formInstance) 555 556 //SystemSection 557 def systemSectionInstance 558 559 systemSectionInstance = new SystemSection(name: "Press Section", 560 lifeplan: LifePlan.get(1)) 561 BootStrapSaveAndTest(systemSectionInstance) 562 563 //AssetType 564 def assetTypeInstance 565 assetTypeInstance = new AssetType(name: "Folder", 566 lifeplan: LifePlan.get(1), 567 systemSection: SystemSection.get(1)) 568 BootStrapSaveAndTest(assetTypeInstance) 569 570 assetTypeInstance = new AssetType(name: "Print Unit", 571 lifeplan: LifePlan.get(1), 572 systemSection: SystemSection.get(1)) 573 BootStrapSaveAndTest(assetTypeInstance) 574 575 //Assembly 576 def assemblyInstance 577 assemblyInstance = new Assembly(name: "Delivery Belts", 578 lifeplan: LifePlan.get(1)) 579 BootStrapSaveAndTest(assemblyInstance) 580 581 assemblyInstance = new Assembly(name: "Print Couple", 582 lifeplan: LifePlan.get(1)) 583 BootStrapSaveAndTest(assemblyInstance) 584 585 //SubAssembly 586 def subAssemblyInstance 587 subAssemblyInstance = new SubAssembly(name: "Centre Belt", 588 lifeplan: LifePlan.get(1)) 589 BootStrapSaveAndTest(subAssemblyInstance) 590 591 subAssemblyInstance = new SubAssembly(name: "Form Roller", 592 lifeplan: LifePlan.get(1)) 593 BootStrapSaveAndTest(subAssemblyInstance) 594 595 //ComponentItem 596 def componentItemInstance 597 componentItemInstance = new ComponentItem(name: "Centre Pulley", 598 fmeaNumber: 1, 599 lifeplan: LifePlan.get(1)) 600 BootStrapSaveAndTest(componentItemInstance) 601 602 componentItemInstance = new ComponentItem(name: "Bearing", 603 fmeaNumber: 1, 604 lifeplan: LifePlan.get(1)) 605 BootStrapSaveAndTest(componentItemInstance) 606 607 608 //Asset 609 def assetInstance 610 611 //Asset #1 612 assetInstance = new Asset(name: "Print Unit 23", 613 lifeplan: LifePlan.get(1), 614 assetType: AssetType.get(1), 615 riskPriorityNumber: 1) 616 BootStrapSaveAndTest(assetInstance) 617 515 618 //Finally did it all work. 516 619 if(BootStrapDemoDataSuccessful) { -
trunk/grails-app/domain/Asset.groovy
r116 r118 1 1 class Asset { 2 LifePlan lifeplan 3 AssetType assetType 2 4 String name 3 5 String description = "" 6 String locationLongText = "" 7 Integer riskPriorityNumber 8 String modelNumber = "" 9 String serialNumber = "" 10 Integer purchaseCost = 0 11 Date manufacturedDate = new Date() 12 4 13 boolean isActive = true 5 14 … … 9 18 // 10 19 // static constraints = { 11 //12 20 // } 13 21
Note: See TracChangeset
for help on using the changeset viewer.