Changeset 54 for trunk/Client/Module
- Timestamp:
- Oct 12, 2012, 11:43:43 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Client/Module/UModuleSystem.pas
r53 r54 52 52 ModuleId: Integer; 53 53 ModuleBaseId: Integer; 54 ActionId: Integer; 55 ObjectActionId: Integer; 54 56 begin 55 57 with TChronisBase(System) do begin … … 85 87 AddEnumerationState(EnumId, 'High'); 86 88 87 GroupId := AddObjectGroup('System'); 88 89 ObjectGroupId := AddObject('Object groups', 'ObjectGroup', Client.Schema, GroupId); 89 ActionId := AddObject('Action', 'SystemAction', Client.Schema); 90 AddPropertyNumber(ActionId, 'Id', 'Id', False); 91 AddPropertyString(ActionId, 'Name', 'Name', True); 92 93 ObjectGroupId := AddObject('Menu', 'SystemMenu', Client.Schema); 90 94 AddPropertyNumber(ObjectGroupId, 'Id', 'Id', False); 91 95 AddPropertyString(ObjectGroupId, 'Name', 'Name', True); 96 AddPropertyRelationOne(ObjectGroupId, 'Action', 'Action', True, ActionId); 92 97 ObjectGroupParentId := AddPropertyRelationOne(ObjectGroupId, 'Parent', 'Parent', True, ObjectGroupId); 93 98 94 ObjectId := AddObject('Objects', 'Object', Client.Schema , GroupId);99 ObjectId := AddObject('Objects', 'Object', Client.Schema); 95 100 AddPropertyNumber(ObjectId, 'Id', 'Id', False); 96 101 AddPropertyString(ObjectId, 'Name', 'Name', True); … … 100 105 AddPropertyString(ObjectId, 'Primary key', 'PrimaryKey', True); 101 106 AddPropertyNumber(ObjectId, 'Sequence', 'Sequence', True); 102 103 PropertyTypeId := AddObject('Property types', 'Type', Client.Schema, GroupId); 107 ObjectActionId := AddAction('Show objects', 'Object', ObjectId); 108 AddMenu('Objects', 0, ObjectActionId); 109 110 PropertyTypeId := AddObject('Property types', 'Type', Client.Schema); 104 111 AddPropertyNumber(PropertyTypeId, 'Id', 'Id', False); 105 112 AddPropertyString(PropertyTypeId, 'Name', 'Name', True); … … 107 114 //AddPropertyNumber(ObjectId, 'Parent', 'Parent'); 108 115 109 CustomTypeId := AddObject('Custom types', 'TypeCustom', Client.Schema , GroupId);116 CustomTypeId := AddObject('Custom types', 'TypeCustom', Client.Schema); 110 117 AddPropertyNumber(CustomTypeId, 'Id', 'Id', False); 111 118 CustomTypeIdType := AddPropertyRelationOne(CustomTypeId, 'Type', 'Type', True, PropertyTypeId); 112 119 113 ObjectPropertyGroupId := AddObject('Property groups', 'PropertyGroup', Client.Schema , GroupId);120 ObjectPropertyGroupId := AddObject('Property groups', 'PropertyGroup', Client.Schema); 114 121 AddPropertyNumber(ObjectPropertyGroupId, 'Id', 'Id', False); 115 122 116 ObjectPropertyId := AddObject('Properties', 'Property', Client.Schema , GroupId);123 ObjectPropertyId := AddObject('Properties', 'Property', Client.Schema); 117 124 AddPropertyNumber(ObjectPropertyId, 'Id', 'Id', False); 118 125 AddPropertyString(ObjectPropertyId, 'Name', 'Name', True); … … 129 136 AddPropertyRelationMany(PropertyTypeId, 'Custom types', 'CustomTypes', True, CustomTypeIdType); 130 137 131 ModuleId := AddObject('Modules', ' Module', Client.Schema, GroupId);138 ModuleId := AddObject('Modules', 'SystemModule', Client.Schema); 132 139 AddPropertyNumber(ModuleId, 'Id', 'Id', False); 140 AddPropertyString(ModuleId, 'System name', 'SysName', True); 133 141 AddPropertyString(ModuleId, 'Name', 'Name', True); 134 AddPropertyString(ModuleId, ' Author', 'Author', True);142 AddPropertyString(ModuleId, 'Creator', 'Creator', True); 135 143 AddPropertyString(ModuleId, 'Website', 'Website', False); 136 144 AddPropertyString(ModuleId, 'Version', 'Version', True); 137 145 AddPropertyText(ModuleId, 'Description', 'Description', False); 138 146 AddPropertyString(ModuleId, 'License', 'License', False); 139 140 ModuleBaseId := AddModule('Base', 'Chronos', '', '0.1', '', 'GNU/GPL'); 147 AddPropertyBoolean(ModuleId, 'Installed', 'Installed', False); 141 148 end; 142 149 end; … … 144 151 procedure TModuleSystem.Install; 145 152 begin 153 InitStructure; 146 154 inherited Install; 147 InitStructure; 148 InitSystemValues; 155 //InitSystemValues; 149 156 end; 150 157 … … 153 160 with TChronisBase(System).Client do 154 161 try 155 with Types.AddType(ObjectTable) do begin 156 with Properties do begin 157 Add('Name', 'String'); 158 Add('Schema', 'String'); 159 Add('Table', 'String'); 160 Add('PrimaryKey', 'String'); 161 Add('Sequence', 'Integer'); 162 Add('Group', 'RelationOne'); 163 end; 164 end; 165 166 with Types.AddType(ObjectGroupTable) do begin 167 with Properties do begin 168 Add('Name', 'String'); 169 Add('Schema', 'String'); 170 Add('Parent', 'RelationOne'); 171 Add('Sequence', 'Integer'); 162 with Types.AddType(SystemObjectTable) do begin 163 with Properties do begin 164 AddSimple('Name', 'String'); 165 AddSimple('Schema', 'String'); 166 AddSimple('Table', 'String'); 167 AddSimple('PrimaryKey', 'String'); 168 AddSimple('Sequence', 'Integer'); 169 end; 170 end; 171 172 with Types.AddType(SystemMenuTable) do begin 173 with Properties do begin 174 AddSimple('Name', 'String'); 175 AddSimple('Action', 'RelationOne'); 176 AddSimple('Parent', 'RelationOne'); 177 AddSimple('Sequence', 'Integer'); 178 end; 179 end; 180 181 with Types.AddType(SystemActionTable) do begin 182 with Properties do begin 183 AddSimple('Name', 'String'); 172 184 end; 173 185 end; … … 175 187 with Types.AddType(PropertyTable) do begin 176 188 with Properties do begin 177 Add ('Name', 'String');178 Add ('Object', 'RelationOne');179 Add ('PropertyGroup', 'RelationOne');180 Add ('CustomType', 'RelationOne');181 Add ('Editable', 'Boolean');182 Add ('ColumnName', 'String');189 AddSimple('Name', 'String'); 190 AddSimple('Object', 'RelationOne'); 191 AddSimple('PropertyGroup', 'RelationOne'); 192 AddSimple('CustomType', 'RelationOne'); 193 AddSimple('Editable', 'Boolean'); 194 AddSimple('ColumnName', 'String'); 183 195 end; 184 196 end; … … 186 198 with Types.AddType(PropertyTypeTable) do begin 187 199 with Properties do begin 188 Add ('Name', 'String');189 Add ('DbType', 'String');200 AddSimple('Name', 'String'); 201 AddSimple('DbType', 'String'); 190 202 end; 191 203 end; … … 193 205 with Types.AddType(PropertyGroupTable) do begin 194 206 with Properties do begin 195 Add ('Name', 'String');196 Add ('Object', 'RelationOne');207 AddSimple('Name', 'String'); 208 AddSimple('Object', 'RelationOne'); 197 209 end; 198 210 end; … … 200 212 with Types.AddType(EnumerationState) do begin 201 213 with Properties do begin 202 Add ('Enumeration', 'RelationOne');203 Add ('Name', 'String');204 Add ('Sequence', 'Integer');214 AddSimple('Enumeration', 'RelationOne'); 215 AddSimple('Name', 'String'); 216 AddSimple('Sequence', 'Integer'); 205 217 end; 206 218 end; … … 208 220 with Types.AddType(Enumeration) do begin 209 221 with Properties do begin 210 Add ('Name', 'String');222 AddSimple('Name', 'String'); 211 223 end; 212 224 end; … … 214 226 with Types.AddType(TypeEnumeration) do begin 215 227 with Properties do begin 216 Add ('Enumeration', 'RelationOne');228 AddSimple('Enumeration', 'RelationOne'); 217 229 end; 218 230 end; … … 220 232 with Types.AddType(TypeRelationOne) do begin 221 233 with Properties do begin 222 Add ('CustomType', 'RelationOne');223 Add ('Object', 'Integer');234 AddSimple('CustomType', 'RelationOne'); 235 AddSimple('Object', 'Integer'); 224 236 end; 225 237 end; … … 227 239 with Types.AddType(TypeRelationMany) do begin 228 240 with Properties do begin 229 Add ('CustomType', 'RelationOne');230 Add ('ObjectProperty', 'Integer');241 AddSimple('CustomType', 'RelationOne'); 242 AddSimple('ObjectProperty', 'Integer'); 231 243 end; 232 244 end; … … 234 246 with Types.AddType(TypeFile) do begin 235 247 with Properties do begin 236 Add ('Name', 'String');237 Add ('Size', 'Integer');248 AddSimple('Name', 'String'); 249 AddSimple('Size', 'Integer'); 238 250 end; 239 251 end; … … 241 253 with Types.AddType(TypeGPS) do begin 242 254 with Properties do begin 243 Add ('Latitude', 'Double');244 Add ('Longitude', 'Double');255 AddSimple('Latitude', 'Double'); 256 AddSimple('Longitude', 'Double'); 245 257 end; 246 258 end; … … 248 260 with Types.AddType(CustomTypeTableName) do begin 249 261 with Properties do begin 250 Add ('Type', 'RelationOne');262 AddSimple('Type', 'RelationOne'); 251 263 end; 252 264 end; … … 254 266 with Types.AddType(TypeNumber) do begin 255 267 with Properties do begin 256 Add ('CustomType', 'RelationOne');257 Add ('Default', 'Integer');258 Add ('Min', 'Integer');259 Add ('Max', 'Integer');268 AddSimple('CustomType', 'RelationOne'); 269 AddSimple('Default', 'Integer'); 270 AddSimple('Min', 'Integer'); 271 AddSimple('Max', 'Integer'); 260 272 end; 261 273 end; … … 263 275 with Types.AddType(TypeFloat) do begin 264 276 with Properties do begin 265 Add ('CustomType', 'RelationOne');266 Add ('Default', 'Double');267 Add ('Min', 'Double');268 Add ('Max', 'Double');277 AddSimple('CustomType', 'RelationOne'); 278 AddSimple('Default', 'Double'); 279 AddSimple('Min', 'Double'); 280 AddSimple('Max', 'Double'); 269 281 end; 270 282 end; … … 272 284 with Types.AddType(TypeDateTime) do begin 273 285 with Properties do begin 274 Add ('CustomType', 'RelationOne');275 Add ('Default', 'DateTime');276 Add ('Min', 'DateTime');277 Add ('Max', 'DateTime');286 AddSimple('CustomType', 'RelationOne'); 287 AddSimple('Default', 'DateTime'); 288 AddSimple('Min', 'DateTime'); 289 AddSimple('Max', 'DateTime'); 278 290 end; 279 291 end; … … 281 293 with Types.AddType(TypeString) do begin 282 294 with Properties do begin 283 Add('CustomType', 'RelationOne'); 284 Add('Default', 'String'); 285 Add('MaxLength', 'Integer'); 286 end; 287 end; 288 289 with Types.AddType(ModuleTable) do begin 290 with Properties do begin 291 Add('Name', 'String'); 292 Add('Author', 'String'); 293 Add('Website', 'String'); 294 Add('Version', 'String'); 295 Add('License', 'String'); 296 Add('Description', 'Text'); 297 end; 298 end; 299 295 AddSimple('CustomType', 'RelationOne'); 296 AddSimple('Default', 'String'); 297 AddSimple('MaxLength', 'Integer'); 298 end; 299 end; 300 300 CheckTypes; 301 301 finally
Note:
See TracChangeset
for help on using the changeset viewer.