Changeset 122 for trunk/grails-app/conf


Ignore:
Timestamp:
May 1, 2009, 3:27:41 PM (16 years ago)
Author:
gav
Message:

Run generate-all on all controllers and views except Person and Authority.
Extensive work on Asset domain and application now compiles and runs well.
Update BootStrap? to suite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r120 r122  
    3333        println "BootStrapping demo data..."
    3434
    35 /*******************
    36 START OF TASK
    37 
    38 *******************/
     35/***********************
     36START 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/*********************
     91START OF PERSON
     92*********************/
    3993
    4094//TypeOfPersonGroup
     
    154208        personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
    155209
     210/*********************
     211START OF TASK
     212*********************/
     213
    156214//TaskGroup
    157215        def taskGroupInstance
     
    351409        BootStrapSaveAndTest(assignedPersonInstance)
    352410
    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/*************************
    354421START 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**************************/
    366423
    367424//InventoryStore
     
    382439        storeLocation = new StoreLocation(inventoryStore: InventoryStore.get(1), bin: "C55")
    383440        BootStrapSaveAndTest(storeLocation)
    384 
    385 //UnitOfMeasure
    386         def unitOfMeasureInstance
    387 
    388         //UnitOfMeasure #1
    389         unitOfMeasureInstance = new UnitOfMeasure(name: "each")
    390         BootStrapSaveAndTest(unitOfMeasureInstance)
    391 
    392         //UnitOfMeasure #2
    393         unitOfMeasureInstance = new UnitOfMeasure(name: "meter(s)")
    394         BootStrapSaveAndTest(unitOfMeasureInstance)
    395 
    396         //UnitOfMeasure #3
    397         unitOfMeasureInstance = new UnitOfMeasure(name: "box(es)")
    398         BootStrapSaveAndTest(unitOfMeasureInstance)
    399 
    400         //UnitOfMeasure #4
    401         unitOfMeasureInstance = new UnitOfMeasure(name: "litre(s)")
    402         BootStrapSaveAndTest(unitOfMeasureInstance)
    403 
    404         //UnitOfMeasure #5
    405         unitOfMeasureInstance = new UnitOfMeasure(name: "kilogram(s)")
    406         BootStrapSaveAndTest(unitOfMeasureInstance)
    407441
    408442//InventoryGroup
     
    518552/*******************
    519553START OF ASSET
    520 
    521554*******************/
    522 
    523 //Frequency
    524         def frequencyInstance
    525 
    526         //Frequency #1
    527         frequencyInstance = new Frequency(frequency: "Day(s)")
    528         BootStrapSaveAndTest(frequencyInstance)
    529 
    530         //Frequency #2
    531         frequencyInstance = new Frequency(frequency: "Week(s)")
    532         BootStrapSaveAndTest(frequencyInstance)
    533 
    534         //Frequency #3
    535         frequencyInstance = new Frequency(frequency: "Month(s)")
    536         BootStrapSaveAndTest(frequencyInstance)
    537 
    538         //Frequency #4
    539         frequencyInstance = new Frequency(frequency: "Year(s)")
    540         BootStrapSaveAndTest(frequencyInstance)
    541555
    542556//LifePlan
    543557        def lifeplanInstance
    544558
    545         lifeplanInstance = new LifePlan(name: "Initial Plan",
    546                                                                 timeInHours: 1,
    547                                                                 maintenanceAction: "Visual inspection")
     559        lifeplanInstance = new LifePlan(name: "Initial Plan")
    548560        BootStrapSaveAndTest(lifeplanInstance)
    549561
    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                                                                                                   
    556585//SystemSection
    557586    def systemSectionInstance
    558587
    559588    systemSectionInstance = new SystemSection(name: "Press Section",
    560                                                                                    lifeplan: LifePlan.get(1))
     589                                                                                   site: Site.get(1))
    561590    BootStrapSaveAndTest(systemSectionInstance)
    562591
    563592//AssetType
    564593        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")
    568597        BootStrapSaveAndTest(assetTypeInstance)
    569598
    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")
    573601        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)
    574617   
    575618//Assembly
    576619        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")
    579623        BootStrapSaveAndTest(assemblyInstance)
    580    
     624//        assemblyInstance.addToMaintenanceActions(MaintenanceAction.get(1))
     625       
     626        //Assembly #2
    581627        assemblyInstance = new Assembly(name: "Print Couple",
    582628                        lifeplan: LifePlan.get(1))
     
    585631//SubAssembly
    586632        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")
    589636        BootStrapSaveAndTest(subAssemblyInstance)
     637 
     638         //SubAssembly #2
     639        subAssemblyInstance = new SubAssembly(name: "Form Roller")
     640        BootStrapSaveAndTest(subAssemblyInstance)
     641
     642//ComponentItem
     643        def componentItemInstance
    590644   
    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)
    606652
    607653
     
    611657        //Asset #1
    612658        assetInstance = new Asset(name: "Print Unit 23",
    613                                                         lifeplan: LifePlan.get(1),
    614659                                                        assetType: AssetType.get(1),
    615                                                         riskPriorityNumber: 1)
     660                                                        systemSection: SystemSection.get(1))
    616661        BootStrapSaveAndTest(assetInstance)
    617662
Note: See TracChangeset for help on using the changeset viewer.