Index: trunk/grails-app/conf/BootStrap.groovy
===================================================================
--- trunk/grails-app/conf/BootStrap.groovy	(revision 120)
+++ trunk/grails-app/conf/BootStrap.groovy	(revision 122)
@@ -33,8 +33,62 @@
         println "BootStrapping demo data..."
 
-/*******************
-START OF TASK
-
-*******************/
+/***********************
+START OF UTILITIES
+***********************/
+
+//Site
+        def siteInstance
+
+        siteInstance = new Site(name: "Creek Mill")
+        BootStrapSaveAndTest(siteInstance)
+
+        siteInstance = new Site(name: "Jasper Street Depot")
+        BootStrapSaveAndTest(siteInstance)
+
+//UnitOfMeasure
+        def unitOfMeasureInstance
+
+        //UnitOfMeasure #1
+        unitOfMeasureInstance = new UnitOfMeasure(name: "each")
+        BootStrapSaveAndTest(unitOfMeasureInstance)
+
+        //UnitOfMeasure #2
+        unitOfMeasureInstance = new UnitOfMeasure(name: "meter(s)")
+        BootStrapSaveAndTest(unitOfMeasureInstance)
+
+        //UnitOfMeasure #3
+        unitOfMeasureInstance = new UnitOfMeasure(name: "box(es)")
+        BootStrapSaveAndTest(unitOfMeasureInstance)
+
+        //UnitOfMeasure #4
+        unitOfMeasureInstance = new UnitOfMeasure(name: "litre(s)")
+        BootStrapSaveAndTest(unitOfMeasureInstance)
+
+        //UnitOfMeasure #5
+        unitOfMeasureInstance = new UnitOfMeasure(name: "kilogram(s)")
+        BootStrapSaveAndTest(unitOfMeasureInstance)
+
+//Period
+        def periodInstance
+
+        //Period #1
+        periodInstance = new Period(period: "Day(s)")
+        BootStrapSaveAndTest(periodInstance)
+
+        //Period #2
+        periodInstance = new Period(period: "Week(s)")
+        BootStrapSaveAndTest(periodInstance)
+
+        //Period #3
+        periodInstance = new Period(period: "Month(s)")
+        BootStrapSaveAndTest(periodInstance)
+
+        //Period #4
+        periodInstance = new Period(period: "Year(s)")
+        BootStrapSaveAndTest(periodInstance)
+
+/*********************
+START OF PERSON
+*********************/
 
 //TypeOfPersonGroup
@@ -154,4 +208,8 @@
         personInstance.addToPersonGroups(PersonGroup.findByName("Production"))
 
+/*********************
+START OF TASK
+*********************/
+
 //TaskGroup
         def taskGroupInstance
@@ -351,17 +409,16 @@
         BootStrapSaveAndTest(assignedPersonInstance)
 
-/*******************
+//RecurringSchedule
+        def recurringScheduleInstance
+
+        //RecurringSchedule #1
+        recurringScheduleInstance = new RecurringSchedule(recurEvery: 1,
+                                                                                                    period: Period.get(1),
+                                                                                                    task: Task.get(1))
+        BootStrapSaveAndTest(recurringScheduleInstance)
+
+/*************************
 START OF INVENTORY
-
-*******************/
-
-//Site
-        def siteInstance
-
-        siteInstance = new Site(name: "Creek Mill")
-        BootStrapSaveAndTest(siteInstance)
-
-        siteInstance = new Site(name: "Jasper Street Depot")
-        BootStrapSaveAndTest(siteInstance)
+**************************/
 
 //InventoryStore
@@ -382,27 +439,4 @@
         storeLocation = new StoreLocation(inventoryStore: InventoryStore.get(1), bin: "C55")
         BootStrapSaveAndTest(storeLocation)
-
-//UnitOfMeasure
-        def unitOfMeasureInstance
-
-        //UnitOfMeasure #1
-        unitOfMeasureInstance = new UnitOfMeasure(name: "each")
-        BootStrapSaveAndTest(unitOfMeasureInstance)
-
-        //UnitOfMeasure #2
-        unitOfMeasureInstance = new UnitOfMeasure(name: "meter(s)")
-        BootStrapSaveAndTest(unitOfMeasureInstance)
-
-        //UnitOfMeasure #3
-        unitOfMeasureInstance = new UnitOfMeasure(name: "box(es)")
-        BootStrapSaveAndTest(unitOfMeasureInstance)
-
-        //UnitOfMeasure #4
-        unitOfMeasureInstance = new UnitOfMeasure(name: "litre(s)")
-        BootStrapSaveAndTest(unitOfMeasureInstance)
-
-        //UnitOfMeasure #5
-        unitOfMeasureInstance = new UnitOfMeasure(name: "kilogram(s)")
-        BootStrapSaveAndTest(unitOfMeasureInstance)
 
 //InventoryGroup
@@ -518,65 +552,77 @@
 /*******************
 START OF ASSET
-
 *******************/
-
-//Frequency
-        def frequencyInstance
-
-        //Frequency #1
-        frequencyInstance = new Frequency(frequency: "Day(s)")
-        BootStrapSaveAndTest(frequencyInstance)
-
-        //Frequency #2
-        frequencyInstance = new Frequency(frequency: "Week(s)")
-        BootStrapSaveAndTest(frequencyInstance)
-
-        //Frequency #3
-        frequencyInstance = new Frequency(frequency: "Month(s)")
-        BootStrapSaveAndTest(frequencyInstance)
-
-        //Frequency #4
-        frequencyInstance = new Frequency(frequency: "Year(s)")
-        BootStrapSaveAndTest(frequencyInstance)
 
 //LifePlan
         def lifeplanInstance
 
-        lifeplanInstance = new LifePlan(name: "Initial Plan",
-                                                                timeInHours: 1,
-                                                                maintenanceAction: "Visual inspection")
+        lifeplanInstance = new LifePlan(name: "Initial Plan")
         BootStrapSaveAndTest(lifeplanInstance)
 
-//Form
-        def formInstance
-
-        formInstance = new Form(name: "Form 1")
-        BootStrapSaveAndTest(formInstance)
-
+//MaintenancePolicy
+        def maintenancePolicyInstance 
+
+        //MaintenancePolicy #1
+        maintenancePolicyInstance = new MaintenancePolicy(name: "Fixed Time")
+        BootStrapSaveAndTest(maintenancePolicyInstance)
+
+//PlannedMaintenance
+        def plannedMaintenanceInstance
+
+        //PM #1
+        plannedMaintenanceInstance = new PlannedMaintenance(name: "PM1",
+                                                                                                            recurringSchedule: RecurringSchedule.get(1))
+        BootStrapSaveAndTest(plannedMaintenanceInstance)
+
+//MaintenanceAction
+        def maintenanceActionInstance
+
+        maintenanceActionInstance = new MaintenanceAction(description: "Do this",
+                                                                                                        maintenancePolicy: MaintenancePolicy.get(1),
+                                                                                                        plannedMaintenance: PlannedMaintenance.get(1))
+        BootStrapSaveAndTest(maintenanceActionInstance)
+                                                                                                    
 //SystemSection
     def systemSectionInstance 
 
     systemSectionInstance = new SystemSection(name: "Press Section",
-                                                                                   lifeplan: LifePlan.get(1))
+                                                                                   site: Site.get(1))
     BootStrapSaveAndTest(systemSectionInstance)
 
 //AssetType
         def assetTypeInstance
-        assetTypeInstance = new AssetType(name: "Folder", 
-                        lifeplan: LifePlan.get(1),
-                        systemSection: SystemSection.get(1))
+
+        //AssetType #1
+        assetTypeInstance = new AssetType(name: "Folder")
         BootStrapSaveAndTest(assetTypeInstance)
 
-        assetTypeInstance = new AssetType(name: "Print Unit", 
-                        lifeplan: LifePlan.get(1),
-                        systemSection: SystemSection.get(1))
+        //AssetType #2
+        assetTypeInstance = new AssetType(name: "Print Unit")
         BootStrapSaveAndTest(assetTypeInstance)
+
+//AssetExtendedAttributeType
+        def assetExtendedAttributeInstanceType
+
+        assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Model Number")
+        BootStrapSaveAndTest(assetExtendedAttributeInstanceType)
+
+//AssetExtendedAttribute
+        def assetExtendedAttributeInstance
+
+        //AssetExtendedAttribute #1
+        assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "mark 2",
+                                                                                                                    assetType: AssetType.get(1),
+                                                                                                                    assetExtendedAttributeType: AssetExtendedAttributeType.get(1))
+        BootStrapSaveAndTest(assetExtendedAttributeInstance)
     
 //Assembly
         def assemblyInstance
-        assemblyInstance = new Assembly(name: "Delivery Belts",
-                        lifeplan: LifePlan.get(1))
+
+        //Assembly #1
+        assemblyInstance = new Assembly(name: "Delivery Belts")
         BootStrapSaveAndTest(assemblyInstance)
-    
+//        assemblyInstance.addToMaintenanceActions(MaintenanceAction.get(1))
+        
+        //Assembly #2
         assemblyInstance = new Assembly(name: "Print Couple",
                         lifeplan: LifePlan.get(1))
@@ -585,23 +631,23 @@
 //SubAssembly
         def subAssemblyInstance
-        subAssemblyInstance = new SubAssembly(name: "Centre Belt",
-                        lifeplan: LifePlan.get(1))
+
+        //SubAssembly #1
+        subAssemblyInstance = new SubAssembly(name: "Centre Belt")
         BootStrapSaveAndTest(subAssemblyInstance)
+ 
+         //SubAssembly #2
+        subAssemblyInstance = new SubAssembly(name: "Form Roller")
+        BootStrapSaveAndTest(subAssemblyInstance)
+
+//ComponentItem
+        def componentItemInstance
     
-        subAssemblyInstance = new SubAssembly(name: "Form Roller",
-                        lifeplan: LifePlan.get(1))
-        BootStrapSaveAndTest(subAssemblyInstance)
-
-//ComponentItem
-    def componentItemInstance
-    componentItemInstance = new ComponentItem(name: "Centre Pulley",
-                                                                                        fmeaNumber: 1,
-                                                                                       lifeplan: LifePlan.get(1))
-    BootStrapSaveAndTest(componentItemInstance)
-
-    componentItemInstance = new ComponentItem(name: "Bearing",
-                                                                                        fmeaNumber: 1,
-                                                                                       lifeplan: LifePlan.get(1))
-    BootStrapSaveAndTest(componentItemInstance)
+        //ComponentItem #1
+        componentItemInstance = new ComponentItem(name: "Centre Pulley")
+        BootStrapSaveAndTest(componentItemInstance)
+
+         //ComponentItem #2
+        componentItemInstance = new ComponentItem(name: "Bearing")
+        BootStrapSaveAndTest(componentItemInstance)
 
 
@@ -611,7 +657,6 @@
         //Asset #1
         assetInstance = new Asset(name: "Print Unit 23",
-                                                        lifeplan: LifePlan.get(1),
                                                         assetType: AssetType.get(1),
-                                                        riskPriorityNumber: 1)
+                                                        systemSection: SystemSection.get(1))
         BootStrapSaveAndTest(assetInstance)
 
