Changeset 54


Ignore:
Timestamp:
Oct 12, 2012, 11:43:43 AM (12 years ago)
Author:
chronos
Message:
  • Added: ChronisAppServer base project.
  • Modified: Changes in client virtual database layer handling.
Location:
trunk
Files:
8 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Client/Application/UChronisModule.pas

    r53 r54  
    1313
    1414  TChronisModule = class
    15     System: TObject; // TChronisSystem;
     15    System: TObject; // TChronisBase;
    1616    SysName: string;
    1717    Name: string;
     
    1919    Creator: string;
    2020    License: string;
    21     HomePage: string;
     21    Website: string;
     22    Description: TStringList;
    2223    Dependencies: TStringList;
    2324    function IsInstalled: Boolean;
     
    104105begin
    105106  Dependencies := TStringList.Create;
     107  Description := TStringList.Create;
    106108end;
    107109
    108110destructor TChronisModule.Destroy;
    109111begin
     112  Description.Free;
    110113  Dependencies.Free;
    111114  inherited Destroy;
  • trunk/Client/Forms/UFormImportStructure.pas

    r49 r54  
    126126
    127127    SQLTables.Clear;
    128     GroupId := Core.System.AddGroup(Database.Database, 0);
     128    GroupId := Core.System.AddMenu(Database.Database, 0);
    129129    Database.Query(DbRows, 'SHOW TABLES');
    130130    for T := 0 to DbRows.Count - 1 do begin
     
    133133      TableName := DbRows[T].Items[0].Value;
    134134      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)));
    136136    end;
    137137
  • trunk/Client/Forms/UFormItemEdit.pas

    r53 r54  
    141141    Proxy.Free;
    142142  end;
    143   if (SelectedObject.Table = ObjectGroupTable) or
    144   (SelectedObject.Table = ObjectTable) then
     143  if (SelectedObject.Table = SystemMenuTable) or
     144  (SelectedObject.Table = SystemObjectTable) then
    145145    FormMenu.LoadTree;
    146146  //MainForm.LoadItemList;
  • trunk/Client/Forms/UFormMain.lfm

    r50 r54  
    66  ActiveControl = PanelMenu
    77  Caption = 'ChronIS'
    8   ClientHeight = 421
     8  ClientHeight = 427
    99  ClientWidth = 640
    1010  Icon.Data = {
     
    153153  object PanelMenu: TPanel
    154154    Left = 0
    155     Height = 374
     155    Height = 381
    156156    Top = 26
    157157    Width = 184
     
    162162  object PanelData: TPanel
    163163    Left = 189
    164     Height = 374
     164    Height = 381
    165165    Top = 26
    166166    Width = 451
     
    171171  object Splitter1: TSplitter
    172172    Left = 184
    173     Height = 374
     173    Height = 381
    174174    Top = 26
    175175    Width = 5
     
    177177  object StatusBar1: TStatusBar
    178178    Left = 0
    179     Height = 21
    180     Top = 400
     179    Height = 20
     180    Top = 407
    181181    Width = 640
    182182    Panels = <   
  • trunk/Client/Forms/UFormMain.pas

    r52 r54  
    150150  if Core.System.Active then
    151151  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 := '';
    153154
    154155  for I := 0 to ToolBar1.ButtonCount - 1 do
  • trunk/Client/Forms/UFormMenu.lfm

    r51 r54  
    11object FormMenu: TFormMenu
    2   Left = 333
     2  Left = 335
    33  Height = 487
    4   Top = 70
     4  Top = 108
    55  Width = 262
    66  Caption = 'Navigation'
     
    1010  OnDestroy = FormDestroy
    1111  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
    1226  object TreeViewMenu: TTreeView
    1327    Left = 2
    14     Height = 483
    15     Top = 2
     28    Height = 457
     29    Top = 28
    1630    Width = 258
    1731    Align = alClient
    1832    BorderSpacing.Around = 2
    1933    DefaultItemHeight = 16
    20     Images = MainForm.ImageListActions
    2134    PopupMenu = PopupMenuObjectGroup
    2235    ReadOnly = True
    23     TabOrder = 0
     36    TabOrder = 1
    2437    OnChange = TreeViewMenuChange
    2538    OnDblClick = AObjectGroupShowExecute
  • trunk/Client/Forms/UFormMenu.pas

    r53 r54  
    3131    PopupMenuObject: TPopupMenu;
    3232    PopupMenuObjectGroup: TPopupMenu;
     33    TabControl1: TTabControl;
    3334    TreeViewMenu: TTreeView;
    3435    procedure AObjectEditExecute(Sender: TObject);
     
    141142      Groups := TListProxy.Create;
    142143      Groups.Client := Core.System.Client;
    143       Groups.ObjectName := ObjectGroupTable;
     144      Groups.ObjectName := SystemMenuTable;
    144145      Groups.Path := Core.System.Client.Schema;
    145146      Groups.Load;
     
    153154          Objects := TListProxy.Create;
    154155          Objects.Client := Core.System.Client;
    155           Objects.ObjectName := ObjectTable;
     156          Objects.ObjectName := SystemObjectTable;
    156157          Objects.Path := Core.System.Client.Schema;
    157158          Objects.Condition := '`Group`="' + Obj.Properties.Values['Id'] + '"';
  • trunk/Client/Module/UModuleSystem.pas

    r53 r54  
    5252  ModuleId: Integer;
    5353  ModuleBaseId: Integer;
     54  ActionId: Integer;
     55  ObjectActionId: Integer;
    5456begin
    5557  with TChronisBase(System) do begin
     
    8587  AddEnumerationState(EnumId, 'High');
    8688
    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);
    9094    AddPropertyNumber(ObjectGroupId, 'Id', 'Id', False);
    9195    AddPropertyString(ObjectGroupId, 'Name', 'Name', True);
     96    AddPropertyRelationOne(ObjectGroupId, 'Action', 'Action', True, ActionId);
    9297    ObjectGroupParentId := AddPropertyRelationOne(ObjectGroupId, 'Parent', 'Parent', True, ObjectGroupId);
    9398
    94   ObjectId := AddObject('Objects', 'Object', Client.Schema, GroupId);
     99  ObjectId := AddObject('Objects', 'Object', Client.Schema);
    95100    AddPropertyNumber(ObjectId, 'Id', 'Id', False);
    96101    AddPropertyString(ObjectId, 'Name', 'Name', True);
     
    100105    AddPropertyString(ObjectId, 'Primary key', 'PrimaryKey', True);
    101106    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);
    104111    AddPropertyNumber(PropertyTypeId, 'Id', 'Id', False);
    105112    AddPropertyString(PropertyTypeId, 'Name', 'Name', True);
     
    107114    //AddPropertyNumber(ObjectId, 'Parent', 'Parent');
    108115
    109   CustomTypeId := AddObject('Custom types', 'TypeCustom', Client.Schema, GroupId);
     116  CustomTypeId := AddObject('Custom types', 'TypeCustom', Client.Schema);
    110117    AddPropertyNumber(CustomTypeId, 'Id', 'Id', False);
    111118    CustomTypeIdType := AddPropertyRelationOne(CustomTypeId, 'Type', 'Type', True, PropertyTypeId);
    112119
    113   ObjectPropertyGroupId := AddObject('Property groups', 'PropertyGroup', Client.Schema, GroupId);
     120  ObjectPropertyGroupId := AddObject('Property groups', 'PropertyGroup', Client.Schema);
    114121    AddPropertyNumber(ObjectPropertyGroupId, 'Id', 'Id', False);
    115122
    116   ObjectPropertyId := AddObject('Properties', 'Property', Client.Schema, GroupId);
     123  ObjectPropertyId := AddObject('Properties', 'Property', Client.Schema);
    117124    AddPropertyNumber(ObjectPropertyId, 'Id', 'Id', False);
    118125    AddPropertyString(ObjectPropertyId, 'Name', 'Name', True);
     
    129136    AddPropertyRelationMany(PropertyTypeId, 'Custom types', 'CustomTypes', True, CustomTypeIdType);
    130137
    131   ModuleId := AddObject('Modules', 'Module', Client.Schema, GroupId);
     138  ModuleId := AddObject('Modules', 'SystemModule', Client.Schema);
    132139    AddPropertyNumber(ModuleId, 'Id', 'Id', False);
     140    AddPropertyString(ModuleId, 'System name', 'SysName', True);
    133141    AddPropertyString(ModuleId, 'Name', 'Name', True);
    134     AddPropertyString(ModuleId, 'Author', 'Author', True);
     142    AddPropertyString(ModuleId, 'Creator', 'Creator', True);
    135143    AddPropertyString(ModuleId, 'Website', 'Website', False);
    136144    AddPropertyString(ModuleId, 'Version', 'Version', True);
    137145    AddPropertyText(ModuleId, 'Description', 'Description', False);
    138146    AddPropertyString(ModuleId, 'License', 'License', False);
    139 
    140   ModuleBaseId := AddModule('Base', 'Chronos', '', '0.1', '', 'GNU/GPL');
     147    AddPropertyBoolean(ModuleId, 'Installed', 'Installed', False);
    141148  end;
    142149end;
     
    144151procedure TModuleSystem.Install;
    145152begin
     153  InitStructure;
    146154  inherited Install;
    147   InitStructure;
    148   InitSystemValues;
     155  //InitSystemValues;
    149156end;
    150157
     
    153160  with TChronisBase(System).Client do
    154161  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');
    172184      end;
    173185    end;
     
    175187    with Types.AddType(PropertyTable) do begin
    176188      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');
    183195      end;
    184196    end;
     
    186198    with Types.AddType(PropertyTypeTable) do begin
    187199      with Properties do begin
    188         Add('Name', 'String');
    189         Add('DbType', 'String');
     200        AddSimple('Name', 'String');
     201        AddSimple('DbType', 'String');
    190202      end;
    191203    end;
     
    193205    with Types.AddType(PropertyGroupTable) do begin
    194206      with Properties do begin
    195         Add('Name', 'String');
    196         Add('Object', 'RelationOne');
     207        AddSimple('Name', 'String');
     208        AddSimple('Object', 'RelationOne');
    197209      end;
    198210    end;
     
    200212    with Types.AddType(EnumerationState) do begin
    201213      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');
    205217      end;
    206218    end;
     
    208220    with Types.AddType(Enumeration) do begin
    209221      with Properties do begin
    210         Add('Name', 'String');
     222        AddSimple('Name', 'String');
    211223      end;
    212224    end;
     
    214226    with Types.AddType(TypeEnumeration) do begin
    215227      with Properties do begin
    216         Add('Enumeration', 'RelationOne');
     228        AddSimple('Enumeration', 'RelationOne');
    217229      end;
    218230    end;
     
    220232    with Types.AddType(TypeRelationOne) do begin
    221233      with Properties do begin
    222         Add('CustomType', 'RelationOne');
    223         Add('Object', 'Integer');
     234        AddSimple('CustomType', 'RelationOne');
     235        AddSimple('Object', 'Integer');
    224236      end;
    225237    end;
     
    227239    with Types.AddType(TypeRelationMany) do begin
    228240      with Properties do begin
    229         Add('CustomType', 'RelationOne');
    230         Add('ObjectProperty', 'Integer');
     241        AddSimple('CustomType', 'RelationOne');
     242        AddSimple('ObjectProperty', 'Integer');
    231243      end;
    232244    end;
     
    234246    with Types.AddType(TypeFile) do begin
    235247      with Properties do begin
    236         Add('Name', 'String');
    237         Add('Size', 'Integer');
     248        AddSimple('Name', 'String');
     249        AddSimple('Size', 'Integer');
    238250      end;
    239251    end;
     
    241253    with Types.AddType(TypeGPS) do begin
    242254      with Properties do begin
    243         Add('Latitude', 'Double');
    244         Add('Longitude', 'Double');
     255        AddSimple('Latitude', 'Double');
     256        AddSimple('Longitude', 'Double');
    245257      end;
    246258    end;
     
    248260    with Types.AddType(CustomTypeTableName) do begin
    249261      with Properties do begin
    250         Add('Type', 'RelationOne');
     262        AddSimple('Type', 'RelationOne');
    251263      end;
    252264    end;
     
    254266    with Types.AddType(TypeNumber) do begin
    255267      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');
    260272      end;
    261273    end;
     
    263275    with Types.AddType(TypeFloat) do begin
    264276      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');
    269281      end;
    270282    end;
     
    272284    with Types.AddType(TypeDateTime) do begin
    273285      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');
    278290      end;
    279291    end;
     
    281293    with Types.AddType(TypeString) do begin
    282294      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;
    300300    CheckTypes;
    301301  finally
  • trunk/Client/UCore.pas

    r53 r54  
    5757  System := TChronisBase.Create;
    5858  //TChronisClientMySQL(System.Client).Database := SqlDatabase1;
    59   System.RegisterModule(TModuleSystem);
     59  System.Modules.RegisterModule(TModuleSystem);
    6060  System.ModuleSystem := TModuleSystem(System.Modules.Last);
    61   System.RegisterModule(TModuleUser);
     61  System.Modules.RegisterModule(TModuleUser);
    6262
    6363  {$IFDEF DEBUG}
  • trunk/Client/USystem.pas

    r53 r54  
    1212const
    1313  SystemModuleObject = 'SystemModule';
    14   ObjectGroupTable = 'ObjectGroup';
    15   ObjectTable = 'Object';
     14  SystemMenuTable = 'SystemMenu';
     15  SystemActionTable = 'SystemAction';
     16  SystemObjectTable = 'Object';
    1617  InformationTable = 'Information';
    1718  PropertyTable = 'Property';
     
    9293  TChronisModuleList = class(TListObject) // TListObject<TChronisModule>
    9394    Base: TChronisBase;
     95    procedure RegisterModule(ModuleClass: TChronisModuleClass);
    9496    procedure UpdateList;
    9597    function IsInstalled: Boolean;
     
    109111    Modules: TChronisModuleList;
    110112    ModuleSystem: TChronisModule;
    111     procedure RegisterModule(ModuleClass: TChronisModuleClass);
    112113    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;
    115117    function AddProperty(ObjectId: Integer; Name, ColumnName: string;
    116118      CustomType: Integer; Editable: Boolean): Integer;
     
    126128    function AddPropertyString(ObjectId: Integer; Name, ColumnName: string;
    127129      Editable: Boolean; Default: string = ''; MaxLength: Integer = 255): Integer;
     130    function AddPropertyBoolean(ObjectId: Integer; Name, ColumnName: string;
     131      Editable: Boolean; Default: Boolean = False): Integer;
    128132    function AddPropertyText(ObjectId: Integer; Name, ColumnName: string;
    129133      Editable: Boolean; Default: string = ''): Integer;
     
    132136    function AddPropertyRelationMany(ObjectId: Integer; Name, ColumnName: string;
    133137      Editable: Boolean; ReferedObjectProperty: Integer): Integer;
    134     function AddObjectGroup(Name: string): Integer;
    135138    function AddEnumeration(Name: string): Integer;
    136139    function AddEnumerationState(Enum: Integer; Name: string): Integer;
    137     function AddModule(Name, Author, Website, Version, Description, License: string): Integer;
    138140    procedure LoadTypes;
    139     function IsDatabaseEmpty: Boolean;
    140141    constructor Create;
    141142    destructor Destroy; override;
     
    264265end;
    265266
    266 procedure TChronisBase.RegisterModule(ModuleClass: TChronisModuleClass);
    267 begin
    268   Modules.AddNew(ModuleClass.Create);
    269   TChronisModule(Modules.Last).System := TChronisBase(Self);
     267procedure TChronisModuleList.RegisterModule(ModuleClass: TChronisModuleClass);
     268begin
     269  AddNew(ModuleClass.Create);
     270  TChronisModule(Last).System := TChronisBase(Base);
    270271end;
    271272
    272273function 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;
     274begin
     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;
     289end;
     290
     291function TChronisBase.AddMenu(Name: string; ParentId: Integer = 0; ActionId: Integer = 0): Integer;
     292begin
     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;
     307end;
     308
     309function TChronisBase.AddAction(Name: string; TargetType: string;
     310  TargetId: Integer): Integer;
     311begin
     312
     313end;
     314
     315function TChronisBase.AddObject(Name, TableName, Schema: string): Integer;
     316var
     317  Proxy: TObjectProxy;
     318begin
     319  try
     320    Proxy := TObjectProxy.Create;
     321    Proxy.Client := Client;
     322    Proxy.ObjectName := SystemObjectTable;
    316323    with Proxy.Properties do begin
    317324      Add('Name', Name);
    318325      Add('Schema', Schema);
    319326      Add('Table', TableName);
    320       Add('Group', IntToStr(GroupId));
    321327      Add('PrimaryKey', 'Id');
    322328    end;
     
    471477end;
    472478
     479function TChronisBase.AddPropertyBoolean(ObjectId: Integer; Name,
     480  ColumnName: string; Editable: Boolean; Default: Boolean): Integer;
     481begin
     482
     483end;
     484
    473485function TChronisBase.AddPropertyText(ObjectId: Integer; Name,
    474486  ColumnName: string; Editable: Boolean; Default: string): Integer;
     
    556568end;
    557569
    558 function TChronisBase.AddObjectGroup(Name: string): Integer;
    559 var
    560   Proxy: TObjectProxy;
    561 begin
    562   try
    563     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   finally
    570     Proxy.Free;
    571   end;
    572 end;
    573 
    574570function TChronisBase.AddEnumeration(Name: string): Integer;
    575571var
     
    600596    Proxy.Properties.Add('Name', Name);
    601597    Proxy.Properties.Add('Sequence', '0');
    602     Proxy.Save;
    603     Result := Proxy.Id;
    604   finally
    605     Proxy.Free;
    606   end;
    607 end;
    608 
    609 function TChronisBase.AddModule(Name, Author, Website, Version, Description,
    610   License: string): Integer;
    611 var
    612   Proxy: TObjectProxy;
    613 begin
    614   try
    615     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);
    624598    Proxy.Save;
    625599    Result := Proxy.Id;
     
    653627end;
    654628
    655 function TChronisBase.IsDatabaseEmpty: Boolean;
    656 var
    657   Proxy: TListProxy;
    658 begin
    659   try
    660     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   finally
    669     Proxy.Free;
    670   end;
    671 end;
    672 
    673629constructor TChronisBase.Create;
    674630begin
     
    723679    List := TListProxy.Create;
    724680    List.Client := Core.System.Client;
    725     List.ObjectName := ObjectTable;
     681    List.ObjectName := SystemObjectTable;
    726682    List.Path := Core.System.Client.Schema;
    727683    List.Condition := 'Id=' + IntToStr(ObjectId);
     
    782738      Add('License', License);
    783739      Add('Creator', Creator);
    784       Add('HomePage', HomePage);
     740      Add('Website', Website);
     741      Add('Description', Description.Text);
    785742    end;
    786743    NewObject.Save;
     
    813770    Name := SystemModuleObject;
    814771    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');
    822780    end;
    823781    Define;
  • trunk/Server

    • Property svn:ignore set to
      ChronisAppServer.exe
      ChronisAppServer.lps
      lib
Note: See TracChangeset for help on using the changeset viewer.