- Timestamp:
- Jan 15, 2010, 7:59:58 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r268 r270 13 13 { 14 14 case "development": 15 //createDataService.ensureSystemAndAdminAccess()16 //createDataService.createBaseData()17 //createDataService.createDemoData()15 createDataService.ensureSystemAndAdminAccess() 16 createDataService.createBaseData() 17 createDataService.createDemoData() 18 18 break 19 19 case "test": -
trunk/grails-app/services/CreateDataService.groovy
r268 r270 60 60 createBaseSupplierType() 61 61 createBaseManufacturerType() 62 createBaseExtenededAttributeTypes()63 62 64 63 // Tasks … … 74 73 createBaseInventoryTypes() 75 74 createBaseInventoryMovementTypes() 75 76 // Assets 77 createBaseExtenededAttributeTypes() 76 78 createBaseMaintenancePolicies() 77 78 // Assets79 79 80 80 // Record that data has been created. … … 129 129 createDemoMaintenanceActions() 130 130 createDemoSections() 131 createDemoAssetSubItems()132 131 createDemoAssets() 133 132 createDemoAssetExtenedAttributes() 133 createDemoAssetSubItems() 134 134 135 135 // Record that data has been created. … … 927 927 } 928 928 929 def createBaseExtenededAttributeTypes() { 930 931 //ExtendedAttributeType 932 def extendedAttributeTypeInstance 933 934 //ExtendedAttributeType #1 935 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Model Number") 936 saveAndTest(extendedAttributeTypeInstance) 937 938 //ExtendedAttributeType #2 939 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Purchase Cost") 940 saveAndTest(extendedAttributeTypeInstance) 941 942 //ExtendedAttributeType #3 943 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Serial Number") 944 saveAndTest(extendedAttributeTypeInstance) 945 946 //ExtendedAttributeType #4 947 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Manufactured Date") 948 saveAndTest(extendedAttributeTypeInstance) 949 950 //ExtendedAttributeType #5 951 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Location Description") 952 saveAndTest(extendedAttributeTypeInstance) 953 954 //ExtendedAttributeType #6 955 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Cost Centre") 956 saveAndTest(extendedAttributeTypeInstance) 957 958 //ExtendedAttributeType #7 959 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Cost Code") 960 saveAndTest(extendedAttributeTypeInstance) 961 962 //ExtendedAttributeType #8 963 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Manufacturer's Number") 964 saveAndTest(extendedAttributeTypeInstance) 965 966 //ExtendedAttributeType #9 967 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Inventory Number") 968 saveAndTest(extendedAttributeTypeInstance) 969 } 970 929 971 def createBaseMaintenancePolicies() { 930 972 … … 1014 1056 } 1015 1057 1058 def createDemoAssets() { 1059 1060 //Asset 1061 def assetInstance 1062 1063 //Asset #1 1064 assetInstance = new Asset(name: "Print Tower 22", 1065 section: Section.get(1)) 1066 saveAndTest(assetInstance) 1067 // assetInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 1068 1069 //Asset #2 1070 assetInstance = new Asset(name: "Print Tower 21", 1071 section: Section.get(1)) 1072 saveAndTest(assetInstance) 1073 1074 //Asset #3 1075 assetInstance = new Asset(name: "Print Tower 23", 1076 section: Section.get(1)) 1077 saveAndTest(assetInstance) 1078 1079 //Asset #4 1080 assetInstance = new Asset(name: "RO 1", 1081 section: Section.get(2)) 1082 saveAndTest(assetInstance) 1083 } 1084 1016 1085 def createDemoAssetSubItems() { 1017 1086 1018 // //AssetSubItem 1019 // def assetSubItemInstance 1020 // 1021 // //AssetSubItem #1 1022 // assetSubItemInstance = new AssetSubItem(name: "Print Unit") 1023 // saveAndTest(assetSubItemInstance) 1024 // 1025 // //AssetSubItem #2 1026 // assetSubItemInstance = new AssetSubItem(name: "Reactor Tower") 1027 // saveAndTest(assetSubItemInstance) 1028 } 1029 1030 def createDemoAssets() { 1031 1032 // //Asset 1033 // def assetInstance 1034 // 1035 // //Asset #1 1036 // assetInstance = new Asset(name: "Print Unit 22", 1037 // section: Section.get(1)) 1038 // saveAndTest(assetInstance) 1039 // // assetInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 1040 // 1041 // //Asset #2 1042 // assetInstance = new Asset(name: "Print Unit 21", 1043 // assetSubItem: AssetSubItem.get(1), 1044 // section: Section.get(1)) 1045 // saveAndTest(assetInstance) 1046 // 1047 // //Asset #3 1048 // assetInstance = new Asset(name: "Print Unit 23", 1049 // assetSubItem: AssetSubItem.get(1), 1050 // section: Section.get(1)) 1051 // saveAndTest(assetInstance) 1052 // 1053 // //Asset #4 1054 // assetInstance = new Asset(name: "RO 1", 1055 // assetSubItem: AssetSubItem.get(2), 1056 // section: Section.get(2)) 1057 // saveAndTest(assetInstance) 1058 } 1059 1060 def createBaseExtenededAttributeTypes() { 1061 1062 //ExtendedAttributeType 1063 def extendedAttributeTypeInstance 1064 1065 //ExtendedAttributeType #1 1066 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Model Number") 1067 saveAndTest(extendedAttributeTypeInstance) 1068 1069 //ExtendedAttributeType #2 1070 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Purchase Cost") 1071 saveAndTest(extendedAttributeTypeInstance) 1072 1073 //ExtendedAttributeType #3 1074 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Serial Number") 1075 saveAndTest(extendedAttributeTypeInstance) 1076 1077 //ExtendedAttributeType #4 1078 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Manufactured Date") 1079 saveAndTest(extendedAttributeTypeInstance) 1080 1081 //ExtendedAttributeType #5 1082 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Location Description") 1083 saveAndTest(extendedAttributeTypeInstance) 1084 1085 //ExtendedAttributeType #6 1086 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Cost Centre") 1087 saveAndTest(extendedAttributeTypeInstance) 1088 1089 //ExtendedAttributeType #7 1090 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Cost Code") 1091 saveAndTest(extendedAttributeTypeInstance) 1092 1093 //ExtendedAttributeType #8 1094 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Manufacturer's Number") 1095 saveAndTest(extendedAttributeTypeInstance) 1096 1097 //ExtendedAttributeType #9 1098 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Inventory Number") 1099 saveAndTest(extendedAttributeTypeInstance) 1087 //AssetSubItem 1088 def assetSubItemInstance 1089 1090 //AssetSubItem #1 1091 assetSubItemInstance = new AssetSubItem(name: "Print Unit Lower", 1092 asset: Asset.get(2)) 1093 saveAndTest(assetSubItemInstance) 1094 1095 //AssetSubItem #2 1096 assetSubItemInstance = new AssetSubItem(name: "Print Unit Upper", 1097 asset: Asset.get(2)) 1098 saveAndTest(assetSubItemInstance) 1099 1100 //AssetSubItem #3 1101 assetSubItemInstance = new AssetSubItem(name: "Reactor Tower", 1102 asset: Asset.get(1)) 1103 saveAndTest(assetSubItemInstance) 1100 1104 } 1101 1105 1102 1106 def createDemoAssetExtenedAttributes() { 1103 1107 1104 ////AssetExtendedAttribute1105 //def assetExtendedAttributeInstance1106 // 1107 ////AssetExtendedAttribute #11108 //assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "PU Mark 2",1109 //asset: Asset.get(1),1110 // assetExtendedAttributeType: ExtendedAttributeType.get(1))1111 //saveAndTest(assetExtendedAttributeInstance)1112 // 1113 ////AssetExtendedAttribute #21114 //assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "On the far side of Tank 5",1115 //asset: Asset.get(1),1116 // assetExtendedAttributeType: ExtendedAttributeType.get(5))1117 //saveAndTest(assetExtendedAttributeInstance)1108 //AssetExtendedAttribute 1109 def assetExtendedAttributeInstance 1110 1111 //AssetExtendedAttribute #1 1112 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "PU Mark 2", 1113 asset: Asset.get(1), 1114 extendedAttributeType: ExtendedAttributeType.get(1)) 1115 saveAndTest(assetExtendedAttributeInstance) 1116 1117 //AssetExtendedAttribute #2 1118 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "On the far side of Tank 5", 1119 asset: Asset.get(1), 1120 extendedAttributeType: ExtendedAttributeType.get(5)) 1121 saveAndTest(assetExtendedAttributeInstance) 1118 1122 } 1119 1123
Note: See TracChangeset
for help on using the changeset viewer.