You are not logged in.
The SQLite3 MainDemo source code has just been uploaded to the repository
- also the SQLite3 framework has been updated this week, in order to provide easier UI integration
- still in draft, but working and compiling under both Delphi 7 and Delphi 2010
See the source code in http://synopse.info/fossil/dir?name=SQL … s/MainDemo
You'll notice that all is done in code (no RAD/IDE approach here), but with very little code lines count...
An executable (still in draft status) can be downloaded from http://synopse.info/files/samples/synfile.zip
Offline
This application is just a database tool which stores text content and files into the database, in both clear and safe manner. Safe records are stored using AES-256/SHA-256 encryption.
There is an Audit Trail table for tracking the record changes.
We used TMS components for the User ribbon interface. They are not so well written (from the code point of view: TMS source has a lot of code duplication, and don't use RTTI as it should) but they do work well, and the final result on screen is very good, which was the key point for our customer.
The ribbon component shipped with Delphi 2009 was buggy, and our managers didn't want to go to this compiler version with a sensitive application like the one we were working for (a medical application). Delphi 7 was just fine for our projects, since our framework is natively UTF-8, so unicode ready, even on Delphi 7.
The ribbon in Delphi 2010 seems smooth enough to be used in production. It could be used instead.
In all cases, I want to make the option of using pure Delphi components for creating the user interface. But for a first main demo, you can even use the trail version of the TMS components to compile the sources.
Offline
Here is how this demo works.
Database Model
First, the database tables are defined with regular Delphi classes, like a true ORM framework. Classes are translated to database tables. Published properties of these classes are translated to table fields. Nice and easy.
See http://synopse.info/fossil/artifact/bf6 … e852e0326f unit.
This unit is share by both client and server sides, with a shared data model, i.e. a TSQLModel class instance, describing all ORM tables/classes.
It contains also internal event descriptions, and actions, which will be used to describe the software UI.
Business Logic
Then the server side is just another class, which implements an automated Audit Trail, and a service named "Event" to easily populate the Audit Trail from the Client side.
See http://synopse.info/fossil/artifact/f88 … 1f7267ea68
The client side is another class, which is able to communicate with the server, and fill/update/delete/add the database content playing with classes instances. It's also used to call the Audit Trail related service, and create the reports.
See http://synopse.info/fossil/artifact/2f8 … 325de038cb
You'll see that BLOB fields are handled just like other fields, even if they use their own RESTful GET/PUT dedicated URL (they are not JSON encoded, but transmitted as raw data, to save bandwidth and maintain the RESTful model). The framework handles it for you, thanks to its ORM orientation, and the ForceBlobTransfert := true line in TFileClient.Create method.
Presentation
The main form of the Client is void, if you open its dfm file. All the User Interface is created by the framework, dynamically from the database model and some const values and enumeration types (thanks to Delphi RTTI) defined in FileTables unit (the first one, which defines also the classes/tables).
It's main method is TMainForm.ActionClick, which will handle the actions, triggered when a button is pressed.
See http://synopse.info/fossil/artifact/e7c … 1de450bc15
The reports use GDI+ for anti-aliased drawing, can be zoomed and saved as pdf or text files.
The last unit is just the form used for editing the data. It also performs the encryption of "safe memo" and "safe data" records, using our SynCrypto unit.
You'll discover how the ORM plays its role here: you change the data, just like changing any class instance properties.
See http://synopse.info/fossil/artifact/503 … 2214b396fa
It also use our SynGdiPlus unit to create thumbnails of any picture (emf+jpg+tif+gif+bmp) of data inserted in the database, and add a blob data field containing these thumbnails.
This demo has been compiled with Delphi 7, but you can recompile it with Delphi 2009/2010, and get all Unicode related benefits if you want.
Offline
As stated above, the User Interface part of our SQLite3 framework was using proprietary components from TMS software.
See http://www.tmssoftware.com
It can now generate a Ribbon interface using plain VCL components.
Offline
Is it possible to use this idea in a multi-machine idea.
i.e. to have a commeon database for any user of synFile.
if so can any machine be notified of changes to the memo's sent etc.
Tom
Offline
You can deploy the SynFile in a Client-Server mode, without any huge code change.
See the documentation about Client-Server, stand-alone, and remote access.
It already instantiate a HTTP server - you'll just have to use the client part without creating a new server instance.
Offline
How to read customs Field from TSQLRibbonTabParameters?
TFileRibbonTabParameters = object(TSQLRibbonTabParameters)
/// the SynFile actions
Actions: TFileActions;
Test1: string;
..
end;
...
var
T: TFileRibbonTabParameters;
Test: string;
begin
T:= Ribbon.GetParameter(TSQLSomeRecord)^;
Test:= T.Test1;
...
end;
is it possible to Save and load TSQLRibbonTabParameters to file on-the-fly?
thanks
Offline
You can just use a pointer typecast:
TFileRibbonTabParameters = object(TSQLRibbonTabParameters)
/// the SynFile actions
Actions: TFileActions;
Test1: string;
..
end;
...
var
T: ^TFileRibbonTabParameters;
Test: string;
begin
T:= Ribbon.GetParameter(TSQLSomeRecord);
Test:= T^.Test1; // or just Test := T.Test1;
...
end;
You can safe a record content using RecordLoad and RecordSave, as supplied by SynCommons.pas.
Offline
ok, thank you. i'll try it.
Offline
Hallo ab, i tried create a unit to handle TSQLRecord and TSQLRecordMany published property. Just Inpired by TDBNavigatorButton from DB.pas unit.
i need some suggestion, the unit contain aroun 1200 lines of code. i want to share with the others even not so good code.
can i post here? or can i send to your email please?
Offline
hallo ab, i cannot compile this code:
..
RTP: ^TFileRibbonTabParameters;
..
RTP:= fRibbon.GetParameter(RC);
//[Error] BPBaseEdit.pas(380): Incompatible types: 'TSQLRibbonTabParameters' and 'TFileRibbonTabParameters'
i also try this code
RTP:= TFileRibbonTabParameters(fRibbon.GetParameter(RC));
or
RTP^:= TFileRibbonTabParameters(fRibbon.GetParameter(RC));
or
RTP:= TFileRibbonTabParameters(fRibbon.GetParameter(RC)^);
//with compiler error: Invalid typecast
what i'm doing wrong? I don't know much about pointer.
thank you
Offline
finally.., after all day trying..
RTP:= Pointer(fRibbon.GetParameter(RC));
thank you..
Offline