You are not logged in.
Pages: 1
Incredible!
77.967.968 thanks to mORMot!!!
Have you noticed that the links that refer to other html files in the documentation don't work?
Sorry, I don't understand you.
From client side you need to do something like that (extracted from sample 14):
...
Client := TSQLHttpClient.Create('localhost', PORT_NAME,Model);
Client.ServiceDefine([ICalculator],sicShared);
And service is prepared to be consumed from client:
...
if Client.Services['Calculator'].Get(I) then
writeln(IntToStr(I.Add(a,b));
I guess you have something misunderstood.
Is this on server side or client side ?
I think the documentation it's very very clear.
a question mark is missing before "post/2013/12/10/JSON-record-serialization"
The correct url is:
https://blog.synopse.info/?post/2013/12 … ialization
You can obtain i.e. when calling .ServiceDefine:
var ServiceFactoryServer : TServiceFactoryServer;
InstanceOfTServer : IServer;
...
ServiceFactoryServer := Server.ServiceDefine(TServer, [IServer], sicShared);
ServiceFactoryServer.Obj(InstanceOfTServer);
If you also want to access to a TSQLRestServer instance simply change class definition by the following
TServer = class(TInjectableObjectRest, IServer)
See Implement your service from TInjectableObjectRest
Note: IMHO your naming in your example it's a little confusing
Amazing!!!
Many many thanks Arnaud!
It's amazing!! Just one word in my language:
B R A V O!!!!
To sumup, the prefix are the following:
- TSyn* for core types
- TRTTI* for RTTI
- TOrm* for ORM process
- TRest* for REST process
- TInterface* for interface process
- TService* for service process
- TNet* THttp* TWebSockets* for communication
- and so on...So I guess it won't be a good idea to get rid of the TSyn* prefix.
I'm fully agree with this pattern @ab. It's very semantic, consistent and furthermore the simpler the better.
IMHO TSyn* for all types is not necessary at all. When we use some type (ie TOrm), you are in a "bounded context" where each type has its meaning in the context of its domain.
If there is a conflict, there are several easy solutions.
This is great!
Have you any trick regarding remove a column from an SQLite table?
IMHO the Customized serialization would be a better approach.
Great!
So what would you specifically improve on this point for a better future understanding and thus improve the current documentation?
Please, read the great documentation where it is perfectly explained. Refer to this section
Yes Johnnysynop, I read the thread two times, have you read the answers?
With all my respects to you, I think the first step to solving any conflict for all parts it's to get things clear:
The work and support given by @ab in this project it's 'UltraExcellent'. Nothing to say. It's not an opinion. It's a fact.
The definition provided was to get a 'common sense' what is an 'open source project'
So sorry but I love definitions :-) (extracted from Wikipedia):
In Internet slang, a troll is a person who starts quarrels or upsets people on the Internet to distract and sow discord by posting inflammatory and digressive,[1] extraneous, or off-topic messages in an online community (such as a newsgroup, forum, chat room, or blog) with the intent of provoking readers into displaying emotional responses[2] and normalizing tangential discussion,[3] whether for the troll's amusement or a specific gain.
Please, I think it's extra justified that you change the title of this thread.
Many many thanks for your comprehension and have a nice day
IIRC there's no automatic procedure to do this task. But IMHO it's not much work to do with 34 tables->classes and you can adapt, map, improve, etc... some classes to fit ORM. It was for me a good point to read first ORM is not Database
Open Source Software definition (extracted from Wikipedia):
Open-source software (OSS) is a type of computer software in which source code is released under a license in which the copyright holder grants users the rights to study, change, and distribute the software to anyone and for any purpose.[1] Open-source software may be developed in a collaborative public manner . Open-source software is a prominent example of open collaboration.[2]
IMHO you should/must to change the title of this thread to be more accurate. Thanks!.
Yes @ab, but if the call is not in the main thread you have to call:
fProps.EndCurrentThread;
IIRC in SQL server you have to proceed as stated.
IMHO it's something related regarding some databases drivers needs to free connection in each thread that you create it, therefore you should call
.EndCurrentThread in each call. Something like this:
...
var SQLDBConnection : TSQLDBConnection;
begin
SQLDBConnection:=fProps.NewConnection;
try
...
finally
SQLConnection.Free;
fProps.EndCurrentThread;
end;
end;
This behavior is controlled by SessionTimeout per sessión established in TSQLAuthGroup as documented here
Even you can react to an authentication error through as documented here
But, if I've understood it correctly, why not simply open a port in the office redirected to the server using an httpS protocol (end-to-end encryption as it was designed) and use the mORMot secure RESTful authentication?
What it would be the actual mission of the 'relay' for you?
Obviously, you're not alone Eugene :-)
But IMHO we should wait after 28th October...
It looks great!
Hi,
If I'm not wrong, the way to return custom response it's via TServiceCustomAnswer record type.
Please check related section in documentation for further details.
I think there are some mistakes in your code. Please, see below a https authorization example of the Asana API:
http := TWinHttp.Create('app.asana.com','443',true);
try
Status := http.Request('/api/1.0/tasks',
'POST',0,
FormatUTF8('Authorization: Bearer %',[fPersonalAccessToken]),
VariantSaveJson(Json),
'',ResHeader,ResData);
finally
http.Free;
end;
In case to send a POST request to a http webservice:
http := TWinHttp.Create(HostName,'8888',false);
try
Status := http.Request(FormatUTF8('/things/link/%',[ThingCode]),
'POST',0,
'Content-Type: application/json'+#10+'Accept: application/json',
json,
'',ResHeader,ResData);
finally
http.Free;
end;
Please read the incredible documentation to get further details.
I think this is an issue related with windows firewall or antivirus.
Please, first check locally
· http://192.168.xxx.xxx:8092/<root defined>/timestamp
· or http://192.168.xxx.xxx:8092/<root defined>/mvc-info
then disable firewall and any antivirus and check from another computer same urls.
If it works, create an exception in firewall and enable again, and recheck it.
If the issue persists, please publish the results.
Hope it help
Sorry, but I'm not able to see the function of IIS in this case.
The purpose is to switch from mORMot authentication to Microsoft Active directory Federation Services.
AFAIk, this is valid for a logged user or domain member, but if the domain are not reachable is when ADFS makes sense.
Currently, client-server via interfaces with mORMot authentication are implemented with awesome performance and realiability, and I need to switch to ADFS authentication model to achieve single sign on.
Any suggestion will be welcome
I've found in TSQLTableToGrid.SetCustomFormatByType or TSQLTableToGrid.CustomFormat when Fieldtype is sftCreateTime or sftModTime the output is not the expected.
I think the issue is in the following code in mORMotUI.pas:
case Table.ExpandAsString(ARow,ACol,Client,StringValue,GetCustomFormat(ACol)) of
// very fast response (calculated once)
sftBoolean:
// display boolean as checkbox
DrawCheckBox(TDrawGrid(Owner).Handle, Handle, Rect,
PWord(Table.Get(ARow,ACol))^<>ord('0')); // fast StrComp(,'0')
sftInteger, sftFloat, sftCurrency,
sftEnumerate, sftTimeLog, sftRecord,
sftDateTime, sftDateTimeMS, sftUnixTime, sftUnixMSTime:
ExtTextOut(Handle, Rect.Left+XInc, Rect.Top+2, Options, @Rect, pointer(StringValue),
length(StringValue), nil); // translated short text
and it should be: (I've added sftCreateTime, sftModTime)
case Table.ExpandAsString(ARow,ACol,Client,StringValue,GetCustomFormat(ACol)) of
// very fast response (calculated once)
sftBoolean:
// display boolean as checkbox
DrawCheckBox(TDrawGrid(Owner).Handle, Handle, Rect,
PWord(Table.Get(ARow,ACol))^<>ord('0')); // fast StrComp(,'0')
sftInteger, sftFloat, sftCurrency,
sftEnumerate, sftTimeLog, sftCreateTime, sftModTime, sftRecord,
sftDateTime, sftDateTimeMS, sftUnixTime, sftUnixMSTime:
ExtTextOut(Handle, Rect.Left+XInc, Rect.Top+2, Options, @Rect, pointer(StringValue),
length(StringValue), nil); // translated short text
Many thanks in advance
Great and perfect suggestion!
This solves the weird results. I've changed TRawUTF8DynArray by variant field type and field name and now works like a charm.
I'm so grateful with you... and with the mORMot,of course! ;-)
I'm agree @ab that is a nigthmare changing TSQLRecord field...
There is any way to check in SQLite3 if some field has multi-type in a column?
I have some weird behabiours in BLOB fields related to TRawUTF8DynArray for some records only, as you stated.
Any suggestion to intercept wich field I could have changed type in the past and solve the issues?
ok!...but is so so so fast!!! :-(
Maybe it would be possible apply only one condition for prepare, and the second one through a fillone iterating.
Really really good framework!
Awesome!
Many thanks
Hi,
With the following code, it doesn't work in a TSQLRestStorageInMemory REST storage, but in TSQLRestServerDB works like a charm:
TSQLiniDB = class(TSQLRecordVirtualTableAutoID)
private
fSeccio : RawUTF8;
fCamp : RawUTF8;
fValor : RawUTF8;
published
property Seccio : RawUTF8 read fSeccio write fSeccio;
property Camp : RawUTF8 read fCamp write fCamp;
property Valor : RawUTF8 read fValor write fValor;
end;
...
...
var
ModelSettings : TSQLModel;
SettingsDB : TSQLRestServer;
...
...
procedure ORMInit;
begin
ModelSettings := TSQLModel.Create([TSQLiniDB]);
ModelSettings.VirtualTableRegister(TSQLiniDB,TSQLVirtualTableJSON);
SettingsDB := TSQLRestServerFullMemory.create(ModelSettings,'settings.json',false,false);
end;
...
...
var ORMiniDB : TSQLiniDB
Seccio,Camp,Valor:string;
begin
Seccio := 'General';
Camp := 'Path';
Valor := 'c:\';
ORMiniDB := TSQLiniDB.CreateAndFillPrepare(SettingsDB,'Seccio=? AND Camp=?',[StringToutf8(Seccio),StringToUTF8(Camp)]);;
try
ORMiniDB.FillOne;
ORMiniDB.Seccio := StringToUTF8(Seccio);
ORMiniDB.Camp := StringToUTF8(Camp);
ORMiniDB.Valor := StringToUTF8(Valor);
SettingsDB.AddOrUpdate(ORMiniDB);
finally
ORMiniDB.Free
end;
end;
Even the pair fields 'Seccio' 'Camp' exists, AddOrUpdate adds a new register instead of update. In a sqlite database storage it works well.
Is there something wrong?
Many thanks
Pages: 1