- Timestamp:
- Oct 12, 2012, 11:43:43 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Client/Application/UChronisModule.pas
r53 r54 13 13 14 14 TChronisModule = class 15 System: TObject; // TChronis System;15 System: TObject; // TChronisBase; 16 16 SysName: string; 17 17 Name: string; … … 19 19 Creator: string; 20 20 License: string; 21 HomePage: string; 21 Website: string; 22 Description: TStringList; 22 23 Dependencies: TStringList; 23 24 function IsInstalled: Boolean; … … 104 105 begin 105 106 Dependencies := TStringList.Create; 107 Description := TStringList.Create; 106 108 end; 107 109 108 110 destructor TChronisModule.Destroy; 109 111 begin 112 Description.Free; 110 113 Dependencies.Free; 111 114 inherited Destroy; -
trunk/Client/Forms/UFormImportStructure.pas
r49 r54 126 126 127 127 SQLTables.Clear; 128 GroupId := Core.System.Add Group(Database.Database, 0);128 GroupId := Core.System.AddMenu(Database.Database, 0); 129 129 Database.Query(DbRows, 'SHOW TABLES'); 130 130 for T := 0 to DbRows.Count - 1 do begin … … 133 133 TableName := DbRows[T].Items[0].Value; 134 134 Memo1.Lines.Add('Create object "' + TableName + '"'); 135 NewTable.Table.Add('ObjId', IntToStr(Core.System.AddObject(TableName, TableName, Database.Database , GroupId)));135 NewTable.Table.Add('ObjId', IntToStr(Core.System.AddObject(TableName, TableName, Database.Database))); 136 136 end; 137 137 -
trunk/Client/Forms/UFormItemEdit.pas
r53 r54 141 141 Proxy.Free; 142 142 end; 143 if (SelectedObject.Table = ObjectGroupTable) or144 (SelectedObject.Table = ObjectTable) then143 if (SelectedObject.Table = SystemMenuTable) or 144 (SelectedObject.Table = SystemObjectTable) then 145 145 FormMenu.LoadTree; 146 146 //MainForm.LoadItemList; -
trunk/Client/Forms/UFormMain.lfm
r50 r54 6 6 ActiveControl = PanelMenu 7 7 Caption = 'ChronIS' 8 ClientHeight = 42 18 ClientHeight = 427 9 9 ClientWidth = 640 10 10 Icon.Data = { … … 153 153 object PanelMenu: TPanel 154 154 Left = 0 155 Height = 3 74155 Height = 381 156 156 Top = 26 157 157 Width = 184 … … 162 162 object PanelData: TPanel 163 163 Left = 189 164 Height = 3 74164 Height = 381 165 165 Top = 26 166 166 Width = 451 … … 171 171 object Splitter1: TSplitter 172 172 Left = 184 173 Height = 3 74173 Height = 381 174 174 Top = 26 175 175 Width = 5 … … 177 177 object StatusBar1: TStatusBar 178 178 Left = 0 179 Height = 2 1180 Top = 40 0179 Height = 20 180 Top = 407 181 181 Width = 640 182 182 Panels = < -
trunk/Client/Forms/UFormMain.pas
r52 r54 150 150 if Core.System.Active then 151 151 with Core.System.Client do 152 StatusBar1.Panels[0].Text := User + '@' + Host + ':' + IntToStr(Port) + '/' + Schema; 152 StatusBar1.Panels[0].Text := User + '@' + Host + ':' + IntToStr(Port) + '/' + Schema 153 else StatusBar1.Panels[0].Text := ''; 153 154 154 155 for I := 0 to ToolBar1.ButtonCount - 1 do -
trunk/Client/Forms/UFormMenu.lfm
r51 r54 1 1 object FormMenu: TFormMenu 2 Left = 33 32 Left = 335 3 3 Height = 487 4 Top = 704 Top = 108 5 5 Width = 262 6 6 Caption = 'Navigation' … … 10 10 OnDestroy = FormDestroy 11 11 LCLVersion = '0.9.31' 12 object TabControl1: TTabControl 13 Left = 0 14 Height = 26 15 Top = 0 16 Width = 262 17 TabIndex = 0 18 Tabs.Strings = ( 19 'All' 20 'Favorite' 21 'History' 22 ) 23 Align = alTop 24 TabOrder = 0 25 end 12 26 object TreeViewMenu: TTreeView 13 27 Left = 2 14 Height = 4 8315 Top = 2 28 Height = 457 29 Top = 28 16 30 Width = 258 17 31 Align = alClient 18 32 BorderSpacing.Around = 2 19 33 DefaultItemHeight = 16 20 Images = MainForm.ImageListActions21 34 PopupMenu = PopupMenuObjectGroup 22 35 ReadOnly = True 23 TabOrder = 036 TabOrder = 1 24 37 OnChange = TreeViewMenuChange 25 38 OnDblClick = AObjectGroupShowExecute -
trunk/Client/Forms/UFormMenu.pas
r53 r54 31 31 PopupMenuObject: TPopupMenu; 32 32 PopupMenuObjectGroup: TPopupMenu; 33 TabControl1: TTabControl; 33 34 TreeViewMenu: TTreeView; 34 35 procedure AObjectEditExecute(Sender: TObject); … … 141 142 Groups := TListProxy.Create; 142 143 Groups.Client := Core.System.Client; 143 Groups.ObjectName := ObjectGroupTable;144 Groups.ObjectName := SystemMenuTable; 144 145 Groups.Path := Core.System.Client.Schema; 145 146 Groups.Load; … … 153 154 Objects := TListProxy.Create; 154 155 Objects.Client := Core.System.Client; 155 Objects.ObjectName := ObjectTable;156 Objects.ObjectName := SystemObjectTable; 156 157 Objects.Path := Core.System.Client.Schema; 157 158 Objects.Condition := '`Group`="' + Obj.Properties.Values['Id'] + '"'; -
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 -
trunk/Client/UCore.pas
r53 r54 57 57 System := TChronisBase.Create; 58 58 //TChronisClientMySQL(System.Client).Database := SqlDatabase1; 59 System. RegisterModule(TModuleSystem);59 System.Modules.RegisterModule(TModuleSystem); 60 60 System.ModuleSystem := TModuleSystem(System.Modules.Last); 61 System. RegisterModule(TModuleUser);61 System.Modules.RegisterModule(TModuleUser); 62 62 63 63 {$IFDEF DEBUG} -
trunk/Client/USystem.pas
r53 r54 12 12 const 13 13 SystemModuleObject = 'SystemModule'; 14 ObjectGroupTable = 'ObjectGroup'; 15 ObjectTable = 'Object'; 14 SystemMenuTable = 'SystemMenu'; 15 SystemActionTable = 'SystemAction'; 16 SystemObjectTable = 'Object'; 16 17 InformationTable = 'Information'; 17 18 PropertyTable = 'Property'; … … 92 93 TChronisModuleList = class(TListObject) // TListObject<TChronisModule> 93 94 Base: TChronisBase; 95 procedure RegisterModule(ModuleClass: TChronisModuleClass); 94 96 procedure UpdateList; 95 97 function IsInstalled: Boolean; … … 109 111 Modules: TChronisModuleList; 110 112 ModuleSystem: TChronisModule; 111 procedure RegisterModule(ModuleClass: TChronisModuleClass);112 113 function AddType(Name, DataType: string; TypeIndex: TDbValueType): Integer; 113 function AddGroup(Name: string; ParentGroupId: Integer = 0): Integer; 114 function AddObject(Name, TableName, Schema: string; GroupId: Integer): Integer; 114 function AddMenu(Name: string; ParentId: Integer = 0; ActionId: Integer = 0): Integer; 115 function AddAction(Name: string; TargetType: string; TargetId: Integer): Integer; 116 function AddObject(Name, TableName, Schema: string): Integer; 115 117 function AddProperty(ObjectId: Integer; Name, ColumnName: string; 116 118 CustomType: Integer; Editable: Boolean): Integer; … … 126 128 function AddPropertyString(ObjectId: Integer; Name, ColumnName: string; 127 129 Editable: Boolean; Default: string = ''; MaxLength: Integer = 255): Integer; 130 function AddPropertyBoolean(ObjectId: Integer; Name, ColumnName: string; 131 Editable: Boolean; Default: Boolean = False): Integer; 128 132 function AddPropertyText(ObjectId: Integer; Name, ColumnName: string; 129 133 Editable: Boolean; Default: string = ''): Integer; … … 132 136 function AddPropertyRelationMany(ObjectId: Integer; Name, ColumnName: string; 133 137 Editable: Boolean; ReferedObjectProperty: Integer): Integer; 134 function AddObjectGroup(Name: string): Integer;135 138 function AddEnumeration(Name: string): Integer; 136 139 function AddEnumerationState(Enum: Integer; Name: string): Integer; 137 function AddModule(Name, Author, Website, Version, Description, License: string): Integer;138 140 procedure LoadTypes; 139 function IsDatabaseEmpty: Boolean;140 141 constructor Create; 141 142 destructor Destroy; override; … … 264 265 end; 265 266 266 procedure TChronis Base.RegisterModule(ModuleClass: TChronisModuleClass);267 begin 268 Modules.AddNew(ModuleClass.Create);269 TChronisModule( Modules.Last).System := TChronisBase(Self);267 procedure TChronisModuleList.RegisterModule(ModuleClass: TChronisModuleClass); 268 begin 269 AddNew(ModuleClass.Create); 270 TChronisModule(Last).System := TChronisBase(Base); 270 271 end; 271 272 272 273 function TChronisBase.AddType(Name, DataType: string; TypeIndex: TDbValueType): Integer; 273 var 274 Proxy: TObjectProxy; 275 begin 276 try 277 Proxy := TObjectProxy.Create; 278 Proxy.Client := Client; 279 Proxy.ObjectName := PropertyTypeTable; 280 Proxy.Id := Integer(TypeIndex); 281 Proxy.Properties.Add('Name', Name); 282 Proxy.Properties.Add('DbType', DataType); 283 Proxy.Save; 284 Result := Proxy.Id; 285 finally 286 Proxy.Free; 287 end; 288 end; 289 290 function TChronisBase.AddGroup(Name: string; ParentGroupId: Integer): Integer; 291 var 292 Proxy: TObjectProxy; 293 begin 294 try 295 Proxy := TObjectProxy.Create; 296 Proxy.Client := Client; 297 Proxy.ObjectName := ObjectGroupTable; 298 Proxy.Properties.Add('Name', Name); 299 Proxy.Properties.Add('Parent', IntToStr(ParentGroupId)); 300 Proxy.Save; 301 Result := Proxy.Id; 302 finally 303 Proxy.Free; 304 end; 305 end; 306 307 function TChronisBase.AddObject(Name, TableName, Schema: string; 308 GroupId: Integer): Integer; 309 var 310 Proxy: TObjectProxy; 311 begin 312 try 313 Proxy := TObjectProxy.Create; 314 Proxy.Client := Client; 315 Proxy.ObjectName := ObjectTable; 274 begin 275 with TObjectProxy.Create do 276 try 277 Client := Self.Client; 278 ObjectName := PropertyTypeTable; 279 Id := Integer(TypeIndex); 280 with Properties do begin 281 Add('Name', Name); 282 Add('DbType', DataType); 283 end; 284 Save; 285 Result := Id; 286 finally 287 Free; 288 end; 289 end; 290 291 function TChronisBase.AddMenu(Name: string; ParentId: Integer = 0; ActionId: Integer = 0): Integer; 292 begin 293 with TObjectProxy.Create do 294 try 295 Client := Self.Client; 296 ObjectName := SystemMenuTable; 297 with Properties do begin 298 Add('Name', Name); 299 Add('Parent', IntToStr(ParentId)); 300 Add('Action', IntToStr(ActionId)); 301 end; 302 Save; 303 Result := Id; 304 finally 305 Free; 306 end; 307 end; 308 309 function TChronisBase.AddAction(Name: string; TargetType: string; 310 TargetId: Integer): Integer; 311 begin 312 313 end; 314 315 function TChronisBase.AddObject(Name, TableName, Schema: string): Integer; 316 var 317 Proxy: TObjectProxy; 318 begin 319 try 320 Proxy := TObjectProxy.Create; 321 Proxy.Client := Client; 322 Proxy.ObjectName := SystemObjectTable; 316 323 with Proxy.Properties do begin 317 324 Add('Name', Name); 318 325 Add('Schema', Schema); 319 326 Add('Table', TableName); 320 Add('Group', IntToStr(GroupId));321 327 Add('PrimaryKey', 'Id'); 322 328 end; … … 471 477 end; 472 478 479 function TChronisBase.AddPropertyBoolean(ObjectId: Integer; Name, 480 ColumnName: string; Editable: Boolean; Default: Boolean): Integer; 481 begin 482 483 end; 484 473 485 function TChronisBase.AddPropertyText(ObjectId: Integer; Name, 474 486 ColumnName: string; Editable: Boolean; Default: string): Integer; … … 556 568 end; 557 569 558 function TChronisBase.AddObjectGroup(Name: string): Integer;559 var560 Proxy: TObjectProxy;561 begin562 try563 Proxy := TObjectProxy.Create;564 Proxy.Client := Client;565 Proxy.ObjectName := ObjectGroupTable;566 Proxy.Properties.Add('Name', Name);567 Proxy.Save;568 Result := Proxy.Id;569 finally570 Proxy.Free;571 end;572 end;573 574 570 function TChronisBase.AddEnumeration(Name: string): Integer; 575 571 var … … 600 596 Proxy.Properties.Add('Name', Name); 601 597 Proxy.Properties.Add('Sequence', '0'); 602 Proxy.Save;603 Result := Proxy.Id;604 finally605 Proxy.Free;606 end;607 end;608 609 function TChronisBase.AddModule(Name, Author, Website, Version, Description,610 License: string): Integer;611 var612 Proxy: TObjectProxy;613 begin614 try615 Proxy := TObjectProxy.Create;616 Proxy.Client := Client;617 Proxy.ObjectName := ModuleTable;618 Proxy.Properties.Add('Name', Name);619 Proxy.Properties.Add('Author', Author);620 Proxy.Properties.Add('Website', Website);621 Proxy.Properties.Add('Version', Version);622 Proxy.Properties.Add('Description', Description);623 Proxy.Properties.Add('License', License);624 598 Proxy.Save; 625 599 Result := Proxy.Id; … … 653 627 end; 654 628 655 function TChronisBase.IsDatabaseEmpty: Boolean;656 var657 Proxy: TListProxy;658 begin659 try660 Proxy := TListProxy.Create;661 Proxy.Client := Client;662 Proxy.Path := 'information_schema';663 Proxy.ObjectName := 'tables';664 Proxy.Condition := 'table_name = "SystemModule" AND table_schema = "' +665 Client.Schema + '"';666 Proxy.Load;667 Result := Proxy.Objects.Count = 0;668 finally669 Proxy.Free;670 end;671 end;672 673 629 constructor TChronisBase.Create; 674 630 begin … … 723 679 List := TListProxy.Create; 724 680 List.Client := Core.System.Client; 725 List.ObjectName := ObjectTable;681 List.ObjectName := SystemObjectTable; 726 682 List.Path := Core.System.Client.Schema; 727 683 List.Condition := 'Id=' + IntToStr(ObjectId); … … 782 738 Add('License', License); 783 739 Add('Creator', Creator); 784 Add('HomePage', HomePage); 740 Add('Website', Website); 741 Add('Description', Description.Text); 785 742 end; 786 743 NewObject.Save; … … 813 770 Name := SystemModuleObject; 814 771 with Properties do begin 815 Add('SysName', 'String'); 816 Add('Name', 'String'); 817 Add('Version', 'String'); 818 Add('License', 'String'); 819 Add('Creator', 'String'); 820 Add('HomePage', 'String'); 821 Add('Installed', 'Boolean'); 772 AddSimple('SysName', 'String'); 773 AddSimple('Name', 'String'); 774 AddSimple('Version', 'String'); 775 AddSimple('License', 'String'); 776 AddSimple('Creator', 'String'); 777 AddSimple('Website', 'String'); 778 AddSimple('Installed', 'Boolean'); 779 AddSimple('Description', 'Text'); 822 780 end; 823 781 Define; -
trunk/Server
-
Property svn:ignore
set to
ChronisAppServer.exe
ChronisAppServer.lps
lib
-
Property svn:ignore
set to
Note:
See TracChangeset
for help on using the changeset viewer.