Changeset 122 for trunk/grails-app/conf
- Timestamp:
- May 1, 2009, 3:27:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r120 r122 33 33 println "BootStrapping demo data..." 34 34 35 /******************* 36 START OF TASK 37 38 *******************/ 35 /*********************** 36 START OF UTILITIES 37 ***********************/ 38 39 //Site 40 def siteInstance 41 42 siteInstance = new Site(name: "Creek Mill") 43 BootStrapSaveAndTest(siteInstance) 44 45 siteInstance = new Site(name: "Jasper Street Depot") 46 BootStrapSaveAndTest(siteInstance) 47 48 //UnitOfMeasure 49 def unitOfMeasureInstance 50 51 //UnitOfMeasure #1 52 unitOfMeasureInstance = new UnitOfMeasure(name: "each") 53 BootStrapSaveAndTest(unitOfMeasureInstance) 54 55 //UnitOfMeasure #2 56 unitOfMeasureInstance = new UnitOfMeasure(name: "meter(s)") 57 BootStrapSaveAndTest(unitOfMeasureInstance) 58 59 //UnitOfMeasure #3 60 unitOfMeasureInstance = new UnitOfMeasure(name: "box(es)") 61 BootStrapSaveAndTest(unitOfMeasureInstance) 62 63 //UnitOfMeasure #4 64 unitOfMeasureInstance = new UnitOfMeasure(name: "litre(s)") 65 BootStrapSaveAndTest(unitOfMeasureInstance) 66 67 //UnitOfMeasure #5 68 unitOfMeasureInstance = new UnitOfMeasure(name: "kilogram(s)") 69 BootStrapSaveAndTest(unitOfMeasureInstance) 70 71 //Period 72 def periodInstance 73 74 //Period #1 75 periodInstance = new Period(period: "Day(s)") 76 BootStrapSaveAndTest(periodInstance) 77 78 //Period #2 79 periodInstance = new Period(period: "Week(s)") 80 BootStrapSaveAndTest(periodInstance) 81 82 //Period #3 83 periodInstance = new Period(period: "Month(s)") 84 BootStrapSaveAndTest(periodInstance) 85 86 //Period #4 87 periodInstance = new Period(period: "Year(s)") 88 BootStrapSaveAndTest(periodInstance) 89 90 /********************* 91 START OF PERSON 92 *********************/ 39 93 40 94 //TypeOfPersonGroup … … 154 208 personInstance.addToPersonGroups(PersonGroup.findByName("Production")) 155 209 210 /********************* 211 START OF TASK 212 *********************/ 213 156 214 //TaskGroup 157 215 def taskGroupInstance … … 351 409 BootStrapSaveAndTest(assignedPersonInstance) 352 410 353 /******************* 411 //RecurringSchedule 412 def recurringScheduleInstance 413 414 //RecurringSchedule #1 415 recurringScheduleInstance = new RecurringSchedule(recurEvery: 1, 416 period: Period.get(1), 417 task: Task.get(1)) 418 BootStrapSaveAndTest(recurringScheduleInstance) 419 420 /************************* 354 421 START OF INVENTORY 355 356 *******************/ 357 358 //Site 359 def siteInstance 360 361 siteInstance = new Site(name: "Creek Mill") 362 BootStrapSaveAndTest(siteInstance) 363 364 siteInstance = new Site(name: "Jasper Street Depot") 365 BootStrapSaveAndTest(siteInstance) 422 **************************/ 366 423 367 424 //InventoryStore … … 382 439 storeLocation = new StoreLocation(inventoryStore: InventoryStore.get(1), bin: "C55") 383 440 BootStrapSaveAndTest(storeLocation) 384 385 //UnitOfMeasure386 def unitOfMeasureInstance387 388 //UnitOfMeasure #1389 unitOfMeasureInstance = new UnitOfMeasure(name: "each")390 BootStrapSaveAndTest(unitOfMeasureInstance)391 392 //UnitOfMeasure #2393 unitOfMeasureInstance = new UnitOfMeasure(name: "meter(s)")394 BootStrapSaveAndTest(unitOfMeasureInstance)395 396 //UnitOfMeasure #3397 unitOfMeasureInstance = new UnitOfMeasure(name: "box(es)")398 BootStrapSaveAndTest(unitOfMeasureInstance)399 400 //UnitOfMeasure #4401 unitOfMeasureInstance = new UnitOfMeasure(name: "litre(s)")402 BootStrapSaveAndTest(unitOfMeasureInstance)403 404 //UnitOfMeasure #5405 unitOfMeasureInstance = new UnitOfMeasure(name: "kilogram(s)")406 BootStrapSaveAndTest(unitOfMeasureInstance)407 441 408 442 //InventoryGroup … … 518 552 /******************* 519 553 START OF ASSET 520 521 554 *******************/ 522 523 //Frequency524 def frequencyInstance525 526 //Frequency #1527 frequencyInstance = new Frequency(frequency: "Day(s)")528 BootStrapSaveAndTest(frequencyInstance)529 530 //Frequency #2531 frequencyInstance = new Frequency(frequency: "Week(s)")532 BootStrapSaveAndTest(frequencyInstance)533 534 //Frequency #3535 frequencyInstance = new Frequency(frequency: "Month(s)")536 BootStrapSaveAndTest(frequencyInstance)537 538 //Frequency #4539 frequencyInstance = new Frequency(frequency: "Year(s)")540 BootStrapSaveAndTest(frequencyInstance)541 555 542 556 //LifePlan 543 557 def lifeplanInstance 544 558 545 lifeplanInstance = new LifePlan(name: "Initial Plan", 546 timeInHours: 1, 547 maintenanceAction: "Visual inspection") 559 lifeplanInstance = new LifePlan(name: "Initial Plan") 548 560 BootStrapSaveAndTest(lifeplanInstance) 549 561 550 //Form 551 def formInstance 552 553 formInstance = new Form(name: "Form 1") 554 BootStrapSaveAndTest(formInstance) 555 562 //MaintenancePolicy 563 def maintenancePolicyInstance 564 565 //MaintenancePolicy #1 566 maintenancePolicyInstance = new MaintenancePolicy(name: "Fixed Time") 567 BootStrapSaveAndTest(maintenancePolicyInstance) 568 569 //PlannedMaintenance 570 def plannedMaintenanceInstance 571 572 //PM #1 573 plannedMaintenanceInstance = new PlannedMaintenance(name: "PM1", 574 recurringSchedule: RecurringSchedule.get(1)) 575 BootStrapSaveAndTest(plannedMaintenanceInstance) 576 577 //MaintenanceAction 578 def maintenanceActionInstance 579 580 maintenanceActionInstance = new MaintenanceAction(description: "Do this", 581 maintenancePolicy: MaintenancePolicy.get(1), 582 plannedMaintenance: PlannedMaintenance.get(1)) 583 BootStrapSaveAndTest(maintenanceActionInstance) 584 556 585 //SystemSection 557 586 def systemSectionInstance 558 587 559 588 systemSectionInstance = new SystemSection(name: "Press Section", 560 lifeplan: LifePlan.get(1))589 site: Site.get(1)) 561 590 BootStrapSaveAndTest(systemSectionInstance) 562 591 563 592 //AssetType 564 593 def assetTypeInstance 565 assetTypeInstance = new AssetType(name: "Folder", 566 lifeplan: LifePlan.get(1),567 systemSection: SystemSection.get(1))594 595 //AssetType #1 596 assetTypeInstance = new AssetType(name: "Folder") 568 597 BootStrapSaveAndTest(assetTypeInstance) 569 598 570 assetTypeInstance = new AssetType(name: "Print Unit", 571 lifeplan: LifePlan.get(1), 572 systemSection: SystemSection.get(1)) 599 //AssetType #2 600 assetTypeInstance = new AssetType(name: "Print Unit") 573 601 BootStrapSaveAndTest(assetTypeInstance) 602 603 //AssetExtendedAttributeType 604 def assetExtendedAttributeInstanceType 605 606 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Model Number") 607 BootStrapSaveAndTest(assetExtendedAttributeInstanceType) 608 609 //AssetExtendedAttribute 610 def assetExtendedAttributeInstance 611 612 //AssetExtendedAttribute #1 613 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "mark 2", 614 assetType: AssetType.get(1), 615 assetExtendedAttributeType: AssetExtendedAttributeType.get(1)) 616 BootStrapSaveAndTest(assetExtendedAttributeInstance) 574 617 575 618 //Assembly 576 619 def assemblyInstance 577 assemblyInstance = new Assembly(name: "Delivery Belts", 578 lifeplan: LifePlan.get(1)) 620 621 //Assembly #1 622 assemblyInstance = new Assembly(name: "Delivery Belts") 579 623 BootStrapSaveAndTest(assemblyInstance) 580 624 // assemblyInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 625 626 //Assembly #2 581 627 assemblyInstance = new Assembly(name: "Print Couple", 582 628 lifeplan: LifePlan.get(1)) … … 585 631 //SubAssembly 586 632 def subAssemblyInstance 587 subAssemblyInstance = new SubAssembly(name: "Centre Belt", 588 lifeplan: LifePlan.get(1)) 633 634 //SubAssembly #1 635 subAssemblyInstance = new SubAssembly(name: "Centre Belt") 589 636 BootStrapSaveAndTest(subAssemblyInstance) 637 638 //SubAssembly #2 639 subAssemblyInstance = new SubAssembly(name: "Form Roller") 640 BootStrapSaveAndTest(subAssemblyInstance) 641 642 //ComponentItem 643 def componentItemInstance 590 644 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) 645 //ComponentItem #1 646 componentItemInstance = new ComponentItem(name: "Centre Pulley") 647 BootStrapSaveAndTest(componentItemInstance) 648 649 //ComponentItem #2 650 componentItemInstance = new ComponentItem(name: "Bearing") 651 BootStrapSaveAndTest(componentItemInstance) 606 652 607 653 … … 611 657 //Asset #1 612 658 assetInstance = new Asset(name: "Print Unit 23", 613 lifeplan: LifePlan.get(1),614 659 assetType: AssetType.get(1), 615 riskPriorityNumber: 1)660 systemSection: SystemSection.get(1)) 616 661 BootStrapSaveAndTest(assetInstance) 617 662
Note: See TracChangeset
for help on using the changeset viewer.